CVE-2026-12047: HTML Injection in pgAdmin 4 Cloud Deployment Wizard
pgAdmin 4's cloud deployment wizard contains an HTML injection vulnerability in its AWS, Azure, and Google Cloud credential-verification endpoints. When pgAdmin receives an error message from a cloud provider's API (such as a rejected AWS access key), it forwards that error text directly into the web interface without removing HTML tags. An authenticated attacker can craft a malicious credential submission containing HTML/iframe code; when the cloud provider rejects it and echoes back the attacker's input in its error message, pgAdmin displays that message in the wizard—parsing it as HTML. This allows the attacker to inject an iframe pointing to a malicious site, redirecting the victim's browser away from pgAdmin. The vulnerability requires the attacker to be an authenticated pgAdmin user and requires user interaction (submitting the malicious credential). Redirecting another user would require an additional cross-site request-forgery vector.
Source data · NVD / CISA · public domain
- CVSS
- 3.1 · 3.5 LOW · CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:N/I:L/A:N
- Weaknesses (CWE)
- CWE-116, CWE-79
- Affected products
- 1 configuration(s)
- Published / Modified
- 2026-06-19 / 2026-06-29
NVD description (verbatim)
HTML injection in pgAdmin 4's cloud deployment module. The verify_credentials, deploy, regions, and update-server endpoints under /rds/, /azure/, /google/, and the top-level /cloud/ blueprint propagated AWS / Azure / Google SDK exception text — and the related file-resolution and database-commit exception text — into the JSON response body (the info and errormsg fields) without HTML-encoding. The Cloud Wizard frontend rendered these strings through html-react-parser, so an attacker-influenced exception message embedded structural HTML directly into the wizard's DOM. The reported entry point is /rds/verify_credentials/. An authenticated pgAdmin user submits a crafted access_key whose value contains an <iframe/src=...> payload; AWS STS rejects the credential with an IncompleteSignature exception whose text quotes the access_key verbatim; the pgAdmin backend forwards that text into the JSON info field; the Cloud Wizard's FormFooterMessage parses it as HTML. The browser fetches the iframe's src from an attacker-controlled host, and JavaScript executing inside the cross-origin iframe writes to parent.location, redirecting the victim's pgAdmin tab. Because the injection renders inside pgAdmin's own interface, X-Frame-Options and Content-Security-Policy frame-ancestors do not mitigate it. Baseline impact is self-targeted (the same user who supplied the payload sees the injection); escalation against other authenticated users requires an additional cross-site request-forgery primitive capable of submitting the malformed credential request with a valid X-pgA-CSRFToken in the victim's browser context. The same unsanitised-error-into-JSON pattern was present across multiple sibling endpoints — Azure's check_cluster_name_availability, every Google endpoint that surfaces SDK errors (verification_ack, projects, regions, instance_types, database_versions, the verify_credentials path-resolution branches), the central /deploy endpoint that bubbles str(e) from deploy_on_rds / deploy_on_azure / deploy_on_google, and update_cloud_server which surfaces the str(e) from a failing db.session.commit — all of which are now covered. Fix HTML-escapes every external/SDK exception string at the endpoint sink via a new shared sanitize_external_text helper (HTML escape with control-character strip), promoted out of the psycopg3 driver into web/pgadmin/utils/text_sanitize.py. The Cloud Wizard frontend additionally renders its FormFooterMessage in plain-text mode for backend-derived strings, so the value is never parsed as HTML even if a future sink forgets the escape. This issue affects pgAdmin 4: from 6.6 before 9.16.
2 reference(s) · View on NVD →
SEC.co analysis · AI-assisted, reviewed against source
Technical summary
The vulnerability exists across multiple cloud-integration endpoints (/rds/verify_credentials, /azure/check_cluster_name_availability, /google/verification_ack, /deploy, /update_cloud_server, and related routes) that propagate unescaped exception text from AWS, Azure, and Google SDKs into JSON response bodies (info and errormsg fields). The Cloud Wizard frontend uses html-react-parser to render these strings, enabling arbitrary HTML/iframe injection. The primary attack path involves crafting an access_key parameter containing structural HTML; when the cloud provider's STS service rejects the credential with an IncompleteSignature exception that quotes the access_key, pgAdmin forwards the exception text verbatim to the frontend. The injected iframe executes cross-origin JavaScript capable of modifying parent.location. The fix introduces a sanitize_external_text helper in web/pgadmin/utils/text_sanitize.py that HTML-escapes and strips control characters from all external/SDK exception strings before they enter JSON responses, and updates the FormFooterMessage frontend component to render backend-derived strings in plain-text mode to prevent HTML parsing even if a future code path forgets to escape.
Business impact
The immediate risk is low-severity: an authenticated internal user supplies a malicious credential, sees their own session redirected to an attacker-controlled site, and may be phished for credentials or infected with malware. However, the vulnerability's presence across multiple endpoints and the availability of a CSRF amplification path means an attacker with network access (e.g., a compromised internal system, malicious advertisement, or supply-chain compromise) could target pgAdmin deployments with crafted requests that redirect legitimate administrators during cloud deployment workflows. Organizations using pgAdmin to manage production cloud infrastructure may be disrupted or deceived into granting attacker-controlled infrastructure permissions.
Affected systems
pgAdmin 4 versions 6.6 through 9.15 are affected. The vulnerability is present in any deployment that exposes the cloud wizard module (AWS RDS, Azure, or Google Cloud integration). pgAdmin installations running only local/non-cloud database management are unaffected unless they have upgraded to include the vulnerable cloud blueprint code.
Exploitability
Exploitability requires authentication (a valid pgAdmin login) and user interaction (the victim must attempt to add or verify cloud credentials). The attacker can self-target by submitting a malicious credential request, immediately seeing the injection in their own session. Attacking other authenticated users requires an additional CSRF primitive to submit the malformed credential request with a valid X-pgA-CSRFToken, which raises the bar but remains feasible in scenarios where pgAdmin is accessed from untrusted networks or malicious ads reach administrator browsers. No known public exploit exists (CVE-2026-12047 is not tracked in the CISA Known Exploited Vulnerabilities catalog). The attack surface is narrow: only users interacting with cloud deployment workflows during credential verification are at risk in-session.
Remediation
Update pgAdmin 4 to version 9.16 or later. The patch applies HTML-escaping and control-character stripping to all cloud provider exception text via the new sanitize_external_text utility, and ensures the frontend FormFooterMessage component renders backend-derived strings as plain text. Verify against the vendor advisory that your specific patch version contains the updated code in web/pgadmin/utils/text_sanitize.py and the FormFooterMessage changes.
Patch guidance
Apply pgAdmin 4 version 9.16 or later as soon as practical. The fix is contained in a single merged utility module and frontend component update, making it low-risk to deploy. Test the patched version in a staging environment to confirm cloud credential workflows (AWS, Azure, Google) function normally. If you cannot immediately patch, disable cloud deployment features in pgAdmin's configuration until an update is available; this removes the attack surface entirely.
Detection guidance
Monitor pgAdmin access logs and proxy logs for suspicious /rds/, /azure/, /google/, and /cloud/ API requests containing HTML/iframe patterns in the access_key, database_name, or other credential parameters (e.g., strings like '<iframe', 'src=', angle brackets). Check pgAdmin's application logs for exception messages that appear unusual or contain HTML fragments. If pgAdmin is exposed to untrusted networks, monitor for abnormal redirect or page-load behaviors in user sessions during cloud credential submission. Look for repeated 400/403 responses from cloud provider backends (which often accompany the injection attack pattern), followed by unusual JSON error messages containing HTML.
Why prioritize this
Although the CVSS score is low (3.5), this vulnerability warrants prompt attention because it affects authenticated users during critical infrastructure-deployment workflows. An administrator attempting to provision cloud databases for production could be redirected to a phishing site or malware distribution point, potentially compromising their credentials or the entire cloud account. The fix is mature, low-risk, and available in a released version. Organizations using pgAdmin's cloud integration should prioritize patching; those not using cloud features can defer, but should still track the update as a future security baseline upgrade.
Risk score, explained
CVSS 3.5 reflects low immediate severity: the attack requires authentication (L in PR:L), user interaction (R in UI:R), and targets only the integrity of the current user's session (I:L for Integrity impact, no Confidentiality or Availability loss). The scope is Unchanged (S:U), meaning the injection is confined to pgAdmin's own DOM and does not cross trust boundaries in the strict CVSS sense. However, the practical risk is higher than the score suggests because successful exploitation during cloud infrastructure provisioning can lead to account takeover or deployment of attacker-controlled infrastructure. Defenders should weight this as a medium-priority patch due to context (cloud-admin workflows), not the raw CVSS number.
Frequently asked questions
Can an unauthenticated attacker exploit this?
No. The vulnerability requires a valid pgAdmin login. An attacker must be an authenticated user or must trick an authenticated user into submitting a malicious request (via CSRF).
Does Content-Security-Policy or X-Frame-Options prevent the attack?
Neither fully mitigates it. The injected iframe renders inside pgAdmin's own trusted interface, so CSP frame-ancestors and X-Frame-Options (which protect against framing by external sites) do not block the iframe insertion itself. The fix addresses the root cause: preventing HTML injection at the backend, so the frontend never receives an iframe to render.
Is my pgAdmin instance vulnerable if I don't use the cloud wizard?
Probably not. The vulnerability is specific to the cloud deployment module. If your pgAdmin instance is configured to manage only local PostgreSQL/MySQL databases and cloud integration is not enabled, you are not directly exposed. However, verify your installation has not pulled in the vulnerable cloud blueprint code.
If I patch, do I need to revoke any credentials or restart pgAdmin?
Patching does not require credential rotation or special cleanup. Once you upgrade to version 9.16 or later, the vulnerability is closed. A standard service restart or redeployment is sufficient.
This analysis is provided for informational purposes. Verify all patch versions, affected product versions, and remediation steps against the official pgAdmin vendor advisory and release notes before deploying updates. CVSS scores and severity ratings reflect the Common Vulnerability Scoring System standard as of publication; organizational risk may differ based on deployment context and exposure. Do not use this page as a substitute for vendor guidance or your organization's vulnerability management policy. Source: NVD (public-domain), retrieved 2026-07-27. Analysis generated by SEC.co (claude-haiku-4-5).
Related vulnerabilities
- CVE-2026-42558HIGHXibo Stored XSS and Iframe Sandbox Escape in Data Connector
- CVE-2026-45011HIGHApostropheCMS 4.29.0 Stored XSS in Image Widget – Security Analysis
- CVE-2026-48209HIGHReflected XSS in OTRS Ticket Handling – HIGH Severity Vulnerability
- CVE-2026-12044HIGHSQL Injection in pgAdmin 4 Description Fields
- CVE-2026-10112LOWXSS in STUDENT-MANAGEMENT-SYSTEM 1.0 Dashboard
- CVE-2026-10228LOWXSS Vulnerability in raisulislamg4 Student Management System
- CVE-2026-10234LOWMettle Sendportal XSS Vulnerability – Campaign Handler Remote Exploit
- CVE-2026-10244LOWSourceCodester Pharmacy Sales and Inventory System XSS Vulnerability