CVE-2026-12049: pgAdmin 4: Open redirect in multi-factor authentication flow via unvalidated 'next' parameter
Open redirect in pgAdmin 4's multi-factor authentication flow. The MFA validate and register endpoints honoured the user-supplied 'next' query/form parameter without confirming the target pointed back inside pgAdmin, so an authenticated victim who clicked /mfa/validate?next=<external> -- a link typically delivered by phishing -- would be sent to an attacker-controlled host directly out of the trusted auth flow.
The defect is a trusted-domain redirect, not a privilege bypass: the attacker gains no read/write access to pgAdmin or the victim's database, but the redirect launders the attacker's destination through pgAdmin's URL, which raises the success rate of credential-phishing follow-on against the victim.
Fix introduces a same-origin issaferedirecturl helper and gates every MFA redirect that consumes user-supplied 'next' values through it. The helper allows only relative paths and absolute URLs whose scheme is http(s) and whose host matches the current request host; it rejects external hosts in absolute and protocol-relative form, non-http schemes (javascript:, data:, mailto:), userinfo tricks (http://localhost@attacker/), and backslash variants that some browsers normalize to forward slashes. Unsafe targets fall back to the internal browser index. A dedicated regression test exercises each accept/reject category and the original reporter PoC.
This issue affects pgAdmin 4: from 6.0 before 9.16.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
pgAdmin 4to a version that resolves this vulnerability.Fixed in 9.16 - Configuration
Update pgAdmin 4 so that the MFA validate and register endpoints do not directly honor user-supplied 'next'. Instead, route all 'next' values through the _is_safe_redirect_url helper; if rejected, redirect the user to the internal browser index.
pgAdmin 4 MFA flow (/mfa/validate and /mfa/register) next parameter handling = Gated through same-origin _is_safe_redirect_url (allow only relative paths; and http(s) absolute URLs with host matching current request host; reject protocol-relative, non-http schemes (javascript:, data:, mailto:), userinfo tricks (e.g., http://localhost@attacker/), and backslash variants that normalize to forward slashes). Unsafe targets fall back to internal browser index
Event History
Frequently Asked Questions
What is the severity of CVE-2026-12049?
The severity of CVE-2026-12049 is rated as medium with a score of 4.3.
How does CVE-2026-12049 impact pgAdmin 4?
CVE-2026-12049 allows an open redirect in the multi-factor authentication flow, where unvalidated 'next' parameters can lead users to external sites.
Who is affected by CVE-2026-12049?
Authenticated users of pgAdmin 4 who interact with the multi-factor authentication flow are affected by CVE-2026-12049.
How do I fix CVE-2026-12049?
To fix CVE-2026-12049, ensure that the 'next' parameter is validated to redirect only to internal pgAdmin URLs.
Is there a workaround for CVE-2026-12049?
Currently, the best workaround for CVE-2026-12049 is to avoid clicking on links that contain unvalidated 'next' parameters.