CVE-2026-12047
Beschrijving NL
HTML-injectie in de cloudimplementatiemodule van pgAdmin 4. De verify_credentials, deploy, regio's en update-server endpoints onder /rds/,/azure/,/google/, en de top-level/cloud/blueprint verspreide AWS/Azure / Google SDK-uitzonderingstekst — en de gerelateerde bestandsresolutie en database-commit-uitzonderingstekst — in de JSON-responsbody (de velden info en errormsg) zonder HTML-codering. De frontend van de Cloud Wizard heeft deze tekenreeksen weergegeven via html-react-parser, dus een door een aanvaller beïnvloed uitzonderingsbericht heeft structurele HTML rechtstreeks in de DOM van de wizard ingebed. Het gerapporteerde invoerpunt is /rds/verify_credentials/. Een geverifieerde pgAdmin-gebruiker dient een vervaardigde access_key in waarvan de waarde een payload bevat; AWS STS verwerpt de inloggegevens met een IncompleteSignature-uitzondering waarvan de tekst het woord access_key citeert; de pgAdmin-backend stuurt die tekst door naar het JSON-infoveld; de FormFooterMessage van de Cloud Wizard parseert het als HTML. De browser haalt de src van het iframe op van een door de aanvaller gecontroleerde host en JavaScript dat in het iframe van verschillende oorsprong wordt uitgevoerd, schrijft naar parent.location, waarbij het pgAdmin-tabblad van het slachtoffer wordt omgeleid. Omdat de injectie binnen de eigen interface van pgAdmin wordt weergegeven, beperken X-Frame-Options en Content-Security-Policy frame-ancestors dit niet. Baseline impact is self-targeted (dezelfde gebruiker die de payload heeft geleverd, ziet de injectie); escalatie tegen andere geverifieerde gebruikers vereist een extra cross-site request-forgery primitive die in staat is om het misvormde inlogverzoek in te dienen met een geldige X-pgA-CSRFToken in de browsercontext van het slachtoffer. Hetzelfde ongesanitiseerde-error-into-JSON-patroon was aanwezig op meerdere broer/zus-eindpunten — de check_cluster_name_availability van Azure, elk Google-eindpunt dat SDK-fouten aan het licht brengt (verificatie_ack, projecten, regio's, instance_types, database_versies, de path-resolution-takken van verify_credentials), het centrale /deploy-eindpunt dat str(e) bubbelt van deploy_on_rds / deploy_azure / deploy_on_google, en update_cloud_server die de str(e) aan het licht brengt van een falende db. session.commit — die nu allemaal worden gedekt. Fix HTML-escapes elke externe/SDK uitzondering string op het eindpunt sink via een nieuwe gedeelde sanitize_external_text helper (HTML escape met controle-karakter strip), gepromoveerd van de psycopg3 driver naar web/pgadmin/utils/text_sanitize.py. De frontend van de Cloud Wizard geeft bovendien zijn FormFooterMessage weer in platte tekstmodus voor backend-afgeleide tekenreeksen, zodat de waarde nooit wordt geparseerd als HTML, zelfs als een toekomstige sink de ontsnapping vergeet. Dit probleem heeft invloed op pgAdmin 4: van 6.6 tot 9.16.
Origineel (Engels) tonen
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 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.