CVE-2026-7814
Stored XSS in pgAdmin 4 Browser Tree and Explain Visualizer
Publication date: 2026-05-11
Last updated on: 2026-05-11
Assigner: PostgreSQL
Description
Description
CVSS Scores
EPSS Scores
| Probability: | |
| Percentile: |
Meta Information
Affected Vendors & Products
| Vendor | Product | Version / Range |
|---|---|---|
| pgadmin | pgadmin | to 9.15 (exc) |
Helpful Resources
Exploitability
| CWE ID | Description |
|---|---|
| CWE-UNKNOWN |
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?
This vulnerability is a stored cross-site scripting (XSS) issue found in pgAdmin 4's Browser Tree and Explain Visualizer modules. It occurs because user-controlled PostgreSQL object names (such as database, schema, table, or column names) are inserted into the web page's DOM using innerHTML. This allows an attacker to craft object names containing malicious HTML or JavaScript code, which then executes in the browser of any pgAdmin user who views or runs EXPLAIN on the malicious object.
The vulnerability is fixed by replacing innerHTML with textContent, which safely inserts text without interpreting it as HTML or script.
How can this vulnerability impact me? :
This vulnerability can allow an attacker to execute arbitrary JavaScript code in the browser of pgAdmin users who interact with maliciously named database objects. This can lead to unauthorized actions such as stealing session tokens, performing actions on behalf of the user, or displaying misleading information.
Because the attack is stored, it can affect any user who navigates to or executes EXPLAIN on the compromised object, potentially impacting multiple users and sessions.
How can this vulnerability be detected on my network or system? Can you suggest some commands?
This vulnerability involves stored cross-site scripting (XSS) in pgAdmin 4 triggered by user-controlled PostgreSQL object names containing malicious HTML/JavaScript. Detection involves identifying PostgreSQL object names (database, schema, table, column, etc.) that include suspicious HTML markup or script tags.
Since the vulnerability manifests in the browser when pgAdmin users navigate to or execute EXPLAIN over malicious objects, detection on the network or system can include monitoring for unusual or suspicious object names in the PostgreSQL database.
Suggested commands to detect potentially malicious object names include querying PostgreSQL system catalogs for object names containing HTML or script tags. For example:
- SELECT datname FROM pg_database WHERE datname ~* '<.*?>';
- SELECT nspname FROM pg_namespace WHERE nspname ~* '<.*?>';
- SELECT relname FROM pg_class WHERE relname ~* '<.*?>';
- SELECT attname FROM pg_attribute WHERE attname ~* '<.*?>';
These queries search for object names containing HTML tags, which could indicate attempts to exploit the XSS vulnerability.
What immediate steps should I take to mitigate this vulnerability?
The primary mitigation is to upgrade pgAdmin 4 to version 9.15 or later, where the vulnerability is fixed by replacing unsafe innerHTML assignments with safe textContent usage.
Until an upgrade is possible, avoid using or navigating to PostgreSQL objects with suspicious or untrusted names containing HTML or script content in pgAdmin 4.
Additionally, restrict access to pgAdmin 4 interfaces to trusted users only, and consider sanitizing or renaming any database objects with potentially malicious names.