CVE-2026-12046: pgAdmin 4: Unauthenticated pickle deserialization in SQL Editor close / update_connection routes enables remote code execution

Published Jun 18, 2026
·
Updated

Two state-mutating endpoints in pgAdmin 4's SQL Editor blueprint -- DELETE /sqleditor/close/<transid> and POST /sqleditor/initialize/sqleditor/updateconnection/<sgid>/<sid>/<did> -- were the only routes in the module missing the @pgaloginrequired decorator. Both reach a pickle.loads sink on session['gridData'][<transid>]['commandobj']: the close endpoint via closesqleditorsession(), and updatesqleditorconnection via checktransactionstatus(). In server mode these endpoints were reachable without any authenticated pgAdmin session.

The defect is a missing-authentication-on-critical-function (CWE-306) wrapper around a deserialization-of-untrusted-data sink (CWE-502). Exploiting it for remote code execution requires the attacker to also forge a server-side session file whose gridData entry contains a malicious pickle payload, which in turn requires both (a) knowledge of pgAdmin's Flask SECRETKEY (no chain to leak it is described here -- the attacker must already possess it) and (b) write access to pgAdmin's sessions/ directory on the host. Neither precondition is granted by this defect on its own. When those preconditions are met from another channel (misconfigured deployment, prior compromise, leaked configuration), the missing auth gate is the final hop that turns an existing partial compromise into unauthenticated code execution in the pgAdmin process -- and, by extension, on the host under whatever account runs pgAdmin.

Fix is a one-line @pgaloginrequired decorator on each of the two endpoints, matching the convention used by every other route in the module. The isauthenticated / MFA chain now runs before the transid is dereferenced, so an unauthenticated request is rejected before reaching the deserialization path.

The defect is server-mode only. In DESKTOP mode pgAdmin's beforerequest hook re-authenticates DESKTOPUSER on every request, so no endpoint can be exercised in an unauthenticated state and no auth decorator (or its absence) is meaningful. The accompanying regression test mirrors the attacker's path -- harvests an X-pgA-CSRFToken from GET /login and replays it against both endpoints -- and self-skips outside server mode for that reason; it is wired into the existing server-mode CI workflow alongside the data-isolation tests.

This issue affects pgAdmin 4: from 6.9 before 9.16.

Affected Software

2 affected components
pgAdmin pgAdmin 4>=6.9<9.16
pgAdmin Pgadmin 4 Postgresql>=6.9<9.16

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade pgAdmin 4 to a version that resolves this vulnerability.

    Fixed in from 6.9 before 9.16
  2. Configuration

    Add the missing @pga_login_required decorator to the endpoint DELETE /sqleditor/close/<trans_id> (two critical routes were missing this decorator).

    pgAdmin 4 SQL Editor blueprint authentication = add @pga_login_required decorator to DELETE /sqleditor/close/<trans_id>
  3. Configuration

    Add the missing @pga_login_required decorator to the endpoint POST /sqleditor/initialize/sqleditor/update_connection/<sgid>/<sid>/<did> (two critical routes were missing this decorator).

    pgAdmin 4 SQL Editor blueprint authentication = add @pga_login_required decorator to POST /sqleditor/initialize/sqleditor/update_connection/<sgid>/<sid>/<did>

Event History

Jun 18, 2026
CVE Published
via MITRE·11:37 PM
Data Sourced
via MITRE·11:37 PM
DescriptionSeverityWeakness
Jun 19, 2026
Data Sourced
via NVD·12:16 AM
RemedyDescriptionSeverityWeaknessAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2026-12046?

CVE-2026-12046 has a critical severity rating of 9.

2

What vulnerabilities exist in CVE-2026-12046?

CVE-2026-12046 allows unauthenticated remote code execution due to missing authentication in specific SQL Editor routes.

3

How do I fix CVE-2026-12046?

To mitigate CVE-2026-12046, ensure that the affected endpoints are secured with the @pga_login_required decorator to enforce authentication.

4

Who is affected by CVE-2026-12046?

Users of pgAdmin 4 are affected by CVE-2026-12046, specifically those using the SQL Editor functionality.

5

What are the potential impacts of CVE-2026-12046?

The potential impacts of CVE-2026-12046 include remote code execution, which can lead to unauthorized access and control of the affected system.

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