CVE-2026-86863: pgAdmin 4: Authentication bypass via a client-controlled identity header in Webserver authentication mode

Published Sep 17, 2026
·
Updated

pgAdmin 4's Webserver authentication source is intended to accept an identity asserted by the web server or reverse proxy in front of pgAdmin, delivered through the WSGI/CGI environment. WebserverAuthentication.getuser() read config.WEBSERVERREMOTEUSER from request.environ and, when that returned nothing, fell back to reading the same name directly from the inbound HTTP request headers via request.headers.get(). An inbound HTTP header is written by whoever sends the request, so any client able to reach pgAdmin could supply that header itself and be authenticated as any username it named, including an existing Administrator, without presenting a password or any other credential. The environment lookup could also be satisfied by a client-supplied header whenever WEBSERVERREMOTEUSER was configured to an HTTP-prefixed or hyphenated name such as HTTPXFORWARDEDUSER or X-Forwarded-User, since WSGI servers place inbound headers into the environment under exactly those names. Deployments are affected only when 'webserver' is enabled in AUTHENTICATIONSOURCES.

The fix distinguishes a genuine CGI/WSGI variable from a header-derived one and implicitly trusts only the former. A header-asserted identity is now accepted only when the operator explicitly opts in via WEBSERVERREMOTEUSERFROMHEADER, the request arrives from a peer listed in WEBSERVERTRUSTEDPROXIES, and, when configured, a shared secret supplied in WEBSERVERSHAREDSECRETHEADER matches WEBSERVERSHAREDSECRET under a constant-time comparison. The trusted-peer check deliberately reads the real socket peer address rather than request.remoteaddr, because ProxyFix rewrites the latter from the client-controlled X-Forwarded-For header and would otherwise allow an attacker to claim to be the trusted proxy. As defence in depth, login() now refuses any account whose authsource is not 'webserver', so a misconfigured trust gate cannot be used to assume an internal or LDAP account.

This issue affects pgAdmin 4: from 6.2 before 9.18.

Affected Software

1 affected component
pgAdmin pgAdmin 4>6.2<=9.18

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade pgAdmin 4 to a version that resolves this vulnerability.

    Fixed in 9.18
  2. Configuration

    Deployments are affected only when 'webserver' is enabled in AUTHENTICATION_SOURCES. If you do not require Webserver authentication, remove/disable 'webserver' from AUTHENTICATION_SOURCES.

    pgAdmin 4 Webserver authentication AUTHENTICATION_SOURCES (enablement of 'webserver') = exclude / do not enable 'webserver'
  3. Configuration

    Ensure WEBSERVER_REMOTE_USER_FROM_HEADER is not implicitly trusted; only accept a header-asserted identity when the operator explicitly opts in via WEBSERVER_REMOTE_USER_FROM_HEADER.

    pgAdmin 4 Webserver authentication WEBSERVER_REMOTE_USER_FROM_HEADER = explicit opt-in required
  4. Configuration

    Configure WEBSERVER_TRUSTED_PROXIES so that header-based identity is accepted only when the request arrives from a peer listed in WEBSERVER_TRUSTED_PROXIES (trusted-peer check uses the real socket peer address).

    pgAdmin 4 Webserver authentication WEBSERVER_TRUSTED_PROXIES = peer list
  5. Configuration

    If configured for defense in depth, set WEBSERVER_SHARED_SECRET and require a matching shared secret via WEBSERVER_SHARED_SECRET_HEADER, so the inbound secret must match WEBSERVER_SHARED_SECRET using a constant-time comparison.

    pgAdmin 4 Webserver authentication WEBSERVER_SHARED_SECRET_HEADER / WEBSERVER_SHARED_SECRET = match required with constant-time comparison
  6. Configuration

    Verify that login() refuses any account whose auth_source is not 'webserver', preventing misuse of misconfigured trust gates to assume internal or LDAP accounts when Webserver authentication is enabled.

    pgAdmin 4 login() authorization auth_source handling = refuse non-'webserver' accounts

Event History

Sep 17, 2026
CVE Published
via MITRE·03:30 PM
Data Sourced
via MITRE·03:30 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Which deployments are exposed?

Only deployments with 'webserver' enabled in AUTHENTICATION_SOURCES are affected. Any client that can reach the pgAdmin instance may be able to exploit the issue if the configured identity variable can be controlled through an inbound request header.

2

What does an attacker need to exploit this?

The attacker needs network access to pgAdmin and does not need a password or other credential. They can send the configured identity header themselves and name an arbitrary username, including an existing Administrator.

3

Are reverse-proxy identity-header configurations affected?

Yes. Configurations using HTTP_-prefixed or hyphenated names, such as HTTP_X_FORWARDED_USER or X-Forwarded-User, are vulnerable because WSGI servers place inbound headers into the environment under those names.

4

How can I assess whether my instance is at risk?

Check whether AUTHENTICATION_SOURCES includes 'webserver', then identify the value configured for WEBSERVER_REMOTE_USER. If it is an HTTP_-prefixed or hyphenated header-style name, or if requests can reach pgAdmin with that identity header client-controlled, the deployment is at risk.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203