{"id":64304,"date":"2026-06-19T10:37:13","date_gmt":"2026-06-19T10:37:13","guid":{"rendered":"https:\/\/zero.redgem.net\/?p=64304"},"modified":"2026-06-19T10:37:13","modified_gmt":"2026-06-19T10:37:13","slug":"pgadmin-4-sql-injection-in-comment-on-is-description-rendering-across-dialog-templates","status":"publish","type":"post","link":"https:\/\/zero.redgem.net\/?p=64304","title":{"rendered":"pgAdmin 4: SQL injection in COMMENT ON &#8230; IS &#8216;<description>&#8216; rendering across dialog templates_CVE-2026-12044"},"content":{"rendered":"<p>{&#8220;lastseen&#8221;:&#8221;&#8221;,&#8221;description&#8221;:&#8221;SQL injection in pgAdmin 4 across every dialog template that renders &#8220;COMMENT ON &#8230; IS &#8216;\\u003cdescription\\u003e&#8217;&#8220; for a user-supplied description field. The Jinja templates for Domains (and their constraints), Foreign Tables, Languages, and Event Triggers, plus the Views OID-lookup query, interpolated the description directly inside a single-quoted SQL literal &#8212; &#8220;'{{ data.description }}&#8217;&#8220; &#8212; instead of passing it through the &#8220;qtLiteral&#8220; escape filter. An authenticated pgAdmin user with permission to create or alter the affected object types could submit a description containing an apostrophe, break out of the literal and chain arbitrary SQL. The injected SQL runs under the PostgreSQL role the user is already authenticated as; for a connected role with &#8220;COPY &#8230; TO\/FROM PROGRAM&#8220; (typically PostgreSQL superuser), this chains to OS command execution on the PostgreSQL host. The defect does not cross a privilege boundary &#8212; the user already has direct SQL access to that role through pgAdmin&#8217;s Query Tool &#8212; so the attacker gains no capability beyond what their database role already grants. The marginal impact captures bypass of any application-layer Query Tool gating an operator may have configured.\\n\\nThe defect was originally reported against the Domain Dialog &#8220;description&#8220; field; a code-wide audit identified sixteen sites of the same pattern across the templates listed above. The same review also surfaced ten related sinks in the pgstattuple\/pgstatindex stats templates &#8212; &#8220;pgstattuple(&#8216;{{schema}}.{{table}}&#8217;)&#8220; and the matching pgstatindex shape &#8212; where &#8220;qtIdent&#8220; escapes embedded double quotes inside the identifier but not apostrophes, so a user with CREATE privilege on a schema could plant a table or index named &#8220;foo&#8217;bar&#8220; and a later stats viewer would render an unbalanced literal.\\n\\nFix is layered:\\n\\n  1. Sites: replace every &#8220;'{{ x.description }}&#8217;&#8220; with &#8220;{{ x.description|qtLiteral(conn) }}&#8220; (no surrounding quotes &#8212; the filter wraps the value in escaped quotes itself). Plumb &#8220;conn=self.conn&#8220; through every &#8220;render_template&#8220; call that loads one of these templates. Also corrects a &#8220;{ % elif&#8220; Jinja typo in the foreign-table schema diff (dead branch). Rewrite the ten pgstattuple\/pgstatindex stats sites to address the relation via OID + &#8220;::oid::regclass&#8220; cast (e.g. &#8220;pgstattuple({{ tid }}::oid::regclass)&#8220;), eliminating the embedded literal-call form entirely so that bug-class can no longer recur there.\\n\\n  2. Driver hardening: &#8220;qtLiteral&#8220; (in &#8220;utils\/driver\/psycopg3\/__init__.py&#8220;) used to silently return the raw unescaped value when its &#8220;conn&#8220; argument was falsy. It now raises &#8220;ValueError&#8220; &#8212; surfacing the entire bug class going forward. The change immediately uncovered eight latent plumbing bugs (in &#8220;schemas\/__init__.py&#8220;, &#8220;schemas\/functions\/__init__.py&#8220;, &#8220;schemas\/tables\/utils.py&#8220;, &#8220;foreign_servers\/__init__.py&#8220;, and seven sites in &#8220;roles\/__init__.py&#8220;) &#8212; all fixed as part of this patch. The inner &#8220;except&#8220; block that swallowed adapter-level failures and returned the raw value is also removed, so unadaptable inputs raise instead of leaking unescaped values.\\n\\n  3. Regression tests: a per-template behavioural test renders each previously-vulnerable template with an apostrophe-injection payload and asserts the escaped fragment is present and the vulnerable fragment absent; a lint test walks every &#8220;*.sql&#8220; template flagging any &#8220;'{{ &#8230; }}&#8217;&#8220; single-quote-wrapped interpolation against an explicit allowlist; unit tests cover the new qtLiteral fail-fast and inner-except raise paths.\\n\\nThis issue affects pgAdmin 4: from 1.0 before 9.16.&#8221;,&#8221;published&#8221;:&#8221;2026-06-18T23:37:16.202Z&#8221;,&#8221;modified&#8221;:&#8221;2026-06-18T23:37:16.202Z&#8221;,&#8221;type&#8221;:&#8221;cve&#8221;,&#8221;title&#8221;:&#8221;pgAdmin 4: SQL injection in COMMENT ON &#8230; IS &#8216;\\u003cdescription\\u003e&#8217; rendering across dialog templates&#8221;,&#8221;source&#8221;:&#8221;PostgreSQL&#8221;,&#8221;references&#8221;:&#8221;https:\/\/github.com\/pgadmin-org\/pgadmin4\/issues\/10078\\nhttps:\/\/github.com\/pgadmin-org\/pgadmin4\/commit\/658bb585d\\nhttps:\/\/github.com\/pgadmin-org\/pgadmin4\/commit\/2ae0d3610&#8243;,&#8221;id&#8221;:&#8221;CVE-2026-12044&#8243;,&#8221;bulletinFamily&#8221;:&#8221;&#8221;,&#8221;cwe&#8221;:[&#8220;CWE-89&#8243;,&#8221;CWE-116&#8243;],&#8221;cvelist&#8221;:null,&#8221;sourceData&#8221;:&#8221;pgadmin.org pgAdmin 4 1.0&#8243;,&#8221;sourceHref&#8221;:&#8221;&#8221;,&#8221;cvss&#8221;:{&#8220;score&#8221;:8.8,&#8221;severity&#8221;:&#8221;HIGH&#8221;,&#8221;vector&#8221;:&#8221;CVSS:3.1\/AV:N\/AC:L\/PR:L\/UI:N\/S:U\/C:H\/I:H\/A:H&#8221;,&#8221;version&#8221;:&#8221;3.1&#8243;},&#8221;cvss2&#8243;:{},&#8221;cvss3&#8243;:{&#8220;version&#8221;:&#8221;&#8221;,&#8221;vectorString&#8221;:&#8221;&#8221;,&#8221;baseScore&#8221;:0,&#8221;baseSeverity&#8221;:&#8221;&#8221;,&#8221;attackVector&#8221;:&#8221;&#8221;,&#8221;attackComplexity&#8221;:&#8221;&#8221;,&#8221;privilegesRequired&#8221;:&#8221;&#8221;,&#8221;userInteraction&#8221;:&#8221;&#8221;,&#8221;scope&#8221;:&#8221;&#8221;,&#8221;confidentialityImpact&#8221;:&#8221;&#8221;,&#8221;integrityImpact&#8221;:&#8221;&#8221;,&#8221;availabilityImpact&#8221;:&#8221;&#8221;,&#8221;cvssV3&#8243;:{&#8220;version&#8221;:&#8221;&#8221;,&#8221;vectorString&#8221;:&#8221;&#8221;,&#8221;baseScore&#8221;:0,&#8221;baseSeverity&#8221;:&#8221;&#8221;,&#8221;attackVector&#8221;:&#8221;&#8221;,&#8221;attackComplexity&#8221;:&#8221;&#8221;,&#8221;privilegesRequired&#8221;:&#8221;&#8221;,&#8221;userInteraction&#8221;:&#8221;&#8221;,&#8221;scope&#8221;:&#8221;&#8221;,&#8221;confidentialityImpact&#8221;:&#8221;&#8221;,&#8221;integrityImpact&#8221;:&#8221;&#8221;,&#8221;availabilityImpact&#8221;:&#8221;&#8221;}},&#8221;href&#8221;:&#8221;&#8221;,&#8221;category_name&#8221;:&#8221;CVE&#8221;,&#8221;post_link&#8221;:&#8221;&#8221;,&#8221;product&#8221;:&#8221;pgAdmin 4&#8243;,&#8221;version&#8221;:&#8221;1.0&#8243;,&#8221;vendor&#8221;:&#8221;pgadmin.org&#8221;,&#8221;ai_description&#8221;:&#8221;&#8221;,&#8221;ai_severity&#8221;:&#8221;&#8221;,&#8221;ai_vendor&#8221;:&#8221;&#8221;,&#8221;ai_product&#8221;:&#8221;&#8221;,&#8221;ai_version&#8221;:&#8221;&#8221;,&#8221;ai_score&#8221;:0}<\/p>\n","protected":false},"excerpt":{"rendered":"<p>{&#8220;lastseen&#8221;:&#8221;&#8221;,&#8221;description&#8221;:&#8221;SQL injection in pgAdmin 4 across every dialog template that renders &#8220;COMMENT ON &#8230; IS &#8216;\\u003cdescription\\u003e&#8217;&#8220; for a user-supplied description field. The Jinja templates for&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[6,8,41,12,15,13,7,11,5],"class_list":["post-64304","post","type-post","status-publish","format-standard","hentry","category-category_cve","tag-cve","tag-cvss","tag-cvss-88","tag-exploit","tag-high","tag-news","tag-security","tag-tapic","tag-vulnerability"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>pgAdmin 4: SQL injection in COMMENT ON ... IS &#039;&#039; rendering across dialog templates_CVE-2026-12044 - zero redgem<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/zero.redgem.net\/?p=64304\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"pgAdmin 4: SQL injection in COMMENT ON ... IS &#039;&#039; rendering across dialog templates_CVE-2026-12044 - zero redgem\" \/>\n<meta property=\"og:description\" content=\"{&#8220;lastseen&#8221;:&#8221;&#8221;,&#8221;description&#8221;:&#8221;SQL injection in pgAdmin 4 across every dialog template that renders &#8220;COMMENT ON &#8230; IS &#8216;u003cdescriptionu003e&#8217;&#8220; for a user-supplied description field. The Jinja templates for...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/zero.redgem.net\/?p=64304\" \/>\n<meta property=\"og:site_name\" content=\"zero redgem\" \/>\n<meta property=\"article:published_time\" content=\"2026-06-19T10:37:13+00:00\" \/>\n<meta name=\"author\" content=\"invoker\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"invoker\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/?p=64304#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/?p=64304\"},\"author\":{\"name\":\"invoker\",\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/#\\\/schema\\\/person\\\/fbfeae8dfad117ac08a7621bee1a1dca\"},\"headline\":\"pgAdmin 4: SQL injection in COMMENT ON &#8230; IS &#8216;&#8216; rendering across dialog templates_CVE-2026-12044\",\"datePublished\":\"2026-06-19T10:37:13+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/?p=64304\"},\"wordCount\":685,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/#organization\"},\"keywords\":[\"CVE\",\"CVSS\",\"CVSS-8.8\",\"exploit\",\"HIGH\",\"news\",\"Security\",\"tapic\",\"Vulnerability\"],\"articleSection\":[\"category_cve\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/zero.redgem.net\\\/?p=64304#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/?p=64304\",\"url\":\"https:\\\/\\\/zero.redgem.net\\\/?p=64304\",\"name\":\"pgAdmin 4: SQL injection in COMMENT ON ... IS '' rendering across dialog templates_CVE-2026-12044 - zero redgem\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/#website\"},\"datePublished\":\"2026-06-19T10:37:13+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/?p=64304#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/zero.redgem.net\\\/?p=64304\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/?p=64304#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/zero.redgem.net\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"pgAdmin 4: SQL injection in COMMENT ON &#8230; IS &#8216;&#8216; rendering across dialog templates_CVE-2026-12044\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/#website\",\"url\":\"https:\\\/\\\/zero.redgem.net\\\/\",\"name\":\"zero redgem\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/zero.redgem.net\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/#organization\",\"name\":\"zero redgem\",\"url\":\"https:\\\/\\\/zero.redgem.net\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"\",\"contentUrl\":\"\",\"width\":191,\"height\":188,\"caption\":\"zero redgem\"},\"image\":{\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/#\\\/schema\\\/person\\\/fbfeae8dfad117ac08a7621bee1a1dca\",\"name\":\"invoker\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f17c01d7338e6932bcde121cf83569393df3374625d25afd62677cfb528f2e3e?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f17c01d7338e6932bcde121cf83569393df3374625d25afd62677cfb528f2e3e?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f17c01d7338e6932bcde121cf83569393df3374625d25afd62677cfb528f2e3e?s=96&d=mm&r=g\",\"caption\":\"invoker\"},\"sameAs\":[\"https:\\\/\\\/zero.redgem.net\"],\"url\":\"https:\\\/\\\/zero.redgem.net\\\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"pgAdmin 4: SQL injection in COMMENT ON ... IS '' rendering across dialog templates_CVE-2026-12044 - zero redgem","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/zero.redgem.net\/?p=64304","og_locale":"en_US","og_type":"article","og_title":"pgAdmin 4: SQL injection in COMMENT ON ... IS '' rendering across dialog templates_CVE-2026-12044 - zero redgem","og_description":"{&#8220;lastseen&#8221;:&#8221;&#8221;,&#8221;description&#8221;:&#8221;SQL injection in pgAdmin 4 across every dialog template that renders &#8220;COMMENT ON &#8230; IS &#8216;u003cdescriptionu003e&#8217;&#8220; for a user-supplied description field. The Jinja templates for...","og_url":"https:\/\/zero.redgem.net\/?p=64304","og_site_name":"zero redgem","article_published_time":"2026-06-19T10:37:13+00:00","author":"invoker","twitter_card":"summary_large_image","twitter_misc":{"Written by":"invoker","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/zero.redgem.net\/?p=64304#article","isPartOf":{"@id":"https:\/\/zero.redgem.net\/?p=64304"},"author":{"name":"invoker","@id":"https:\/\/zero.redgem.net\/#\/schema\/person\/fbfeae8dfad117ac08a7621bee1a1dca"},"headline":"pgAdmin 4: SQL injection in COMMENT ON &#8230; IS &#8216;&#8216; rendering across dialog templates_CVE-2026-12044","datePublished":"2026-06-19T10:37:13+00:00","mainEntityOfPage":{"@id":"https:\/\/zero.redgem.net\/?p=64304"},"wordCount":685,"commentCount":0,"publisher":{"@id":"https:\/\/zero.redgem.net\/#organization"},"keywords":["CVE","CVSS","CVSS-8.8","exploit","HIGH","news","Security","tapic","Vulnerability"],"articleSection":["category_cve"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/zero.redgem.net\/?p=64304#respond"]}]},{"@type":"WebPage","@id":"https:\/\/zero.redgem.net\/?p=64304","url":"https:\/\/zero.redgem.net\/?p=64304","name":"pgAdmin 4: SQL injection in COMMENT ON ... IS '' rendering across dialog templates_CVE-2026-12044 - zero redgem","isPartOf":{"@id":"https:\/\/zero.redgem.net\/#website"},"datePublished":"2026-06-19T10:37:13+00:00","breadcrumb":{"@id":"https:\/\/zero.redgem.net\/?p=64304#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/zero.redgem.net\/?p=64304"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/zero.redgem.net\/?p=64304#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/zero.redgem.net\/"},{"@type":"ListItem","position":2,"name":"pgAdmin 4: SQL injection in COMMENT ON &#8230; IS &#8216;&#8216; rendering across dialog templates_CVE-2026-12044"}]},{"@type":"WebSite","@id":"https:\/\/zero.redgem.net\/#website","url":"https:\/\/zero.redgem.net\/","name":"zero redgem","description":"","publisher":{"@id":"https:\/\/zero.redgem.net\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/zero.redgem.net\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/zero.redgem.net\/#organization","name":"zero redgem","url":"https:\/\/zero.redgem.net\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/zero.redgem.net\/#\/schema\/logo\/image\/","url":"","contentUrl":"","width":191,"height":188,"caption":"zero redgem"},"image":{"@id":"https:\/\/zero.redgem.net\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/zero.redgem.net\/#\/schema\/person\/fbfeae8dfad117ac08a7621bee1a1dca","name":"invoker","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/f17c01d7338e6932bcde121cf83569393df3374625d25afd62677cfb528f2e3e?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/f17c01d7338e6932bcde121cf83569393df3374625d25afd62677cfb528f2e3e?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/f17c01d7338e6932bcde121cf83569393df3374625d25afd62677cfb528f2e3e?s=96&d=mm&r=g","caption":"invoker"},"sameAs":["https:\/\/zero.redgem.net"],"url":"https:\/\/zero.redgem.net\/?author=1"}]}},"_links":{"self":[{"href":"https:\/\/zero.redgem.net\/index.php?rest_route=\/wp\/v2\/posts\/64304","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/zero.redgem.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/zero.redgem.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/zero.redgem.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/zero.redgem.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=64304"}],"version-history":[{"count":0,"href":"https:\/\/zero.redgem.net\/index.php?rest_route=\/wp\/v2\/posts\/64304\/revisions"}],"wp:attachment":[{"href":"https:\/\/zero.redgem.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=64304"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zero.redgem.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=64304"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zero.redgem.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=64304"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}