{"id":80767,"date":"2026-06-19T03:07:41","date_gmt":"2026-06-18T23:37:41","guid":{"rendered":"https:\/\/afaghhosting.net\/blog\/cve-2026-12048-pgadmin-4-stored-xss-via-untrusted-error-and-plan-node-text-rendered-through-html-react-parser\/"},"modified":"2026-06-19T03:07:41","modified_gmt":"2026-06-18T23:37:41","slug":"cve-2026-12048-pgadmin-4-stored-xss-via-untrusted-error-and-plan-node-text-rendered-through-html-react-parser","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/cve-2026-12048-pgadmin-4-stored-xss-via-untrusted-error-and-plan-node-text-rendered-through-html-react-parser\/","title":{"rendered":"CVE-2026-12048 &#8211; pgAdmin 4: Stored XSS via untrusted error and plan-node text rendered through html-react-parser"},"content":{"rendered":"<p>CVE ID :CVE-2026-12048<\/p>\n<p>  Published : June 18, 2026, 11:37 p.m. | 2\u00a0hours, 5\u00a0minutes ago<\/p>\n<p>  Description :Stored cross-site scripting in pgAdmin 4&#8217;s error-rendering and plan-node-rendering paths. Text returned by a PostgreSQL server (ErrorResponse messages, including object names quoted back inside relation-does-not-exist errors and inside EXPLAIN Recheck Cond \/ Exact Heap Blocks fields) was passed verbatim through html-react-parser at every user-facing sink \u2014 the notifier toasts, FormFooterMessage \/ FormInput help and error areas, FormNote, ModalProvider AlertContent and confirmDelete, ToolErrorView, the Explain visualiser&#8217;s NodeText panel, the SQL editor confirm dialogs, ConfirmSaveContent, PreferencesHelper modal alerts, and SelectThemes helper text. A PostgreSQL server an attacker controls \u2014 or any server returning attacker-influenced text such as a table or column name a low-privilege database user can create \u2014 could inject arbitrary HTML (including ) into the pgAdmin DOM the moment the victim&#8217;s pgAdmin connected to that server or viewed an Explain plan that referenced the crafted object.<\/p>\n<p>The injected iframe&#8217;s srcdoc could fetch attacker-served JavaScript and, by writing to parent.location, redirect the victim&#8217;s top-level pgAdmin browser tab to an attacker-controlled URL. Because the injection originates from inside pgAdmin&#8217;s own interface, standard anti-clickjacking controls (X-Frame-Options, Content-Security-Policy: frame-ancestors) do not mitigate it. A phishing page rendered inside the legitimate pgAdmin window is indistinguishable from a genuine pgAdmin dialog.<\/p>\n<p>Fix combines three complementary layers. (1) DOMPurify sanitisation is wrapped around every html-react-parser call site reachable from notifier, alert, form-error, Explain, and SQL-editor flows. (2) A new plain-text rendering contract \u2014 SafeMessage \/ SafeHtmlMessage components plus Notifier.errorText \/ alertText \/ warningText \/ infoText \/ successText helpers \u2014 is introduced; around fifty callers across browser, tools, dashboard, debugger, misc, llm, preferences, schema diff, and the SQL editor that previously interpolated backend-derived strings are migrated to the plain-text variants. (3) Backend HTML-escape is applied at the post-connection-SQL handler (execute_post_connection_sql) via a new sanitize_external_text helper, so third-party JSON consumers (audit logs, API clients) never receive raw markup either; the Explain plan-info renderer is also patched to _.escape Recheck Cond and Exact Heap Blocks at construction (matching every sibling field), giving defence in depth even before DOMPurify runs.<\/p>\n<p>This issue affects pgAdmin 4: from 6.0 before 9.16.<\/p>\n<p>  Severity: 9.3 | CRITICAL<\/p>\n<p>  Visit the link for more details, such as CVSS details, affected products, timeline, and more&#8230;\u00a0<\/p>\n","protected":false},"excerpt":{"rendered":"<p>CVE ID :CVE-2026-12048 Published : June 18, 2026, 11:37 p.m. | 2\u00a0hours, 5\u00a0minutes ago Description :Stored cross-site scripting in pgAdmin 4&#8217;s error-rendering and plan-node-rendering paths. Text returned by a PostgreSQL server (ErrorResponse messages, including object names quoted back inside relation-does-not-exist errors and inside EXPLAIN Recheck Cond \/ Exact Heap Blocks fields) was passed verbatim through &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26],"tags":[],"class_list":["post-80767","post","type-post","status-publish","format-standard","hentry","category-vulnerability"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/80767","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/comments?post=80767"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/80767\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=80767"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=80767"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=80767"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}