# CVE-2026-12048: PostgreSQL pgAdmin 4 stored XSS in error and plan rendering

Source: https://junglewise.ai/threats/cve-2026-12048-postgresql-pgadmin-4-stored-xss-in-error-and-plan-rendering  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-06-19. Updated: 2026-06-21  
License: CC BY 4.0 with a link back

CVE-2026-12048 · Severity: critical · CVSS 9.3 · Published 2026-06-19

pgAdmin 4, a popular management tool for PostgreSQL databases, contains a security flaw that allows a malicious database server to take control of a user's management interface. If a user connects to a compromised server or views certain database plans containing malicious text, an attacker can inject hidden code into the pgAdmin window. This can be used to steal sensitive information, redirect the user to fraudulent websites, or perform unauthorized actions that appear to come from a legitimate source.

Technologies: [PostgreSQL pgAdmin 4](https://junglewise.ai/threats/technologies/pgadmin-4). Vendors: [PostgreSQL](https://junglewise.ai/threats/vendors/postgresql).

## Quick answers

**Is CVE-2026-12048 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-12048 being exploited in the wild.

**How severe is CVE-2026-12048?** Critical severity, with a CVSS score of 9.3, published 19 June 2026.

**Which products and versions are affected?** PostgreSQL pgAdmin 4 6.0 to 9.15.

**Is there a fix for CVE-2026-12048?** A patch was published on 2026-06-10: Fix committed to repository Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-12048 attacked?** It is attacked over the network, in a network appliance.

**Am I affected by CVE-2026-12048?** Check whether you run PostgreSQL pgAdmin 4 at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## Technical details

A stored cross-site scripting (XSS) vulnerability exists in pgAdmin 4's error-rendering and plan-node-rendering paths. The application passed text returned by a PostgreSQL server (such as ErrorResponse messages or EXPLAIN plan fields) verbatim through the html-react-parser across multiple user-facing sinks, including notification toasts, modal alerts, and the SQL editor. An attacker controlling a malicious server, or a low-privileged user capable of creating objects with crafted names, can inject arbitrary HTML/JavaScript into the pgAdmin DOM. This bypasses standard anti-clickjacking controls like X-Frame-Options because the injection occurs within the legitimate application's context. The issue is resolved in version 9.16 through a combination of DOMPurify sanitization, a new plain-text rendering contract for backend-derived strings, and backend-side HTML escaping.

## Affected products

- PostgreSQL pgAdmin 4 6.0 to 9.15

## Timeline

- 2026-06-10: patched: Fix committed to repository
- 2026-06-19: advisory: CVE published

## References

- [https://github.com/pgadmin-org/pgadmin4/blob/master/web/pgadmin/static/js/components/FormComponents.jsx](https://github.com/pgadmin-org/pgadmin4/blob/master/web/pgadmin/static/js/components/FormComponents.jsx)
- [https://github.com/pgadmin-org/pgadmin4/blob/master/web/pgadmin/static/js/Notifier.jsx](https://github.com/pgadmin-org/pgadmin4/blob/master/web/pgadmin/static/js/Notifier.jsx)
- [https://github.com/pgadmin-org/pgadmin4/blob/master/web/pgadmin/utils/driver/psycopg3/connection.py](https://github.com/pgadmin-org/pgadmin4/blob/master/web/pgadmin/utils/driver/psycopg3/connection.py)
- [https://github.com/pgadmin-org/pgadmin4/blob/master/web/pgadmin/tools/erd/static/js/erd_tool/components/Explain/Analysis.jsx](https://github.com/pgadmin-org/pgadmin4/blob/master/web/pgadmin/tools/erd/static/js/erd_tool/components/Explain/Analysis.jsx)
- [https://github.com/pgadmin-org/pgadmin4/commit/9e370d3cb67b83b3945f82969c959fad3f926517](https://github.com/pgadmin-org/pgadmin4/commit/9e370d3cb67b83b3945f82969c959fad3f926517)
- [https://github.com/pgadmin-org/pgadmin4/issues/10068](https://github.com/pgadmin-org/pgadmin4/issues/10068)

## Related threats

- [PostgreSQL pgAdmin 4 missing authorization in per-tool permissions](https://junglewise.ai/threats/cve-2026-17350-postgresql-pgadmin-4-missing-authorization-in-per-tool)
- [PostgreSQL pgAdmin 4 credential leak in Workspaces adhoc connection](https://junglewise.ai/threats/cve-2026-17349-postgresql-pgadmin-4-credential-leak-in-workspaces-adhoc)
- [PostgreSQL pgAdmin 4 HTML injection in cloud deployment module](https://junglewise.ai/threats/cve-2026-12047-postgresql-pgadmin-4-html-injection-in-cloud-deployment-module)
- [PostgreSQL pgAdmin 4 account lockout bypass in login views](https://junglewise.ai/threats/cve-2026-7820-postgresql-pgadmin-4-account-lockout-bypass-in-login-views)
- [PostgreSQL pgAdmin 4 symbolic-link path traversal in File Manager](https://junglewise.ai/threats/cve-2026-7819-postgresql-pgadmin-4-symbolic-link-path-traversal-in-file-manager)
