CVE-2026-12044
pgAdmin 4: SQL injection in COMMENT ON ... IS '<description>' rendering across dialog templates
Description
SQL injection in pgAdmin 4 across every dialog template that renders ``COMMENT ON ... IS '<description>'`` 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 -- ``'{{ data.description }}'`` -- instead of passing it through the ``qtLiteral`` 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 ``COPY ... TO/FROM PROGRAM`` (typically PostgreSQL superuser), this chains to OS command execution on the PostgreSQL host. The defect does not cross a privilege boundary -- the user already has direct SQL access to that role through pgAdmin's Query Tool -- 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. The defect was originally reported against the Domain Dialog ``description`` 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 -- ``pgstattuple('{{schema}}.{{table}}')`` and the matching pgstatindex shape -- where ``qtIdent`` 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 ``foo'bar`` and a later stats viewer would render an unbalanced literal. Fix is layered: 1. Sites: replace every ``'{{ x.description }}'`` with ``{{ x.description|qtLiteral(conn) }}`` (no surrounding quotes -- the filter wraps the value in escaped quotes itself). Plumb ``conn=self.conn`` through every ``render_template`` call that loads one of these templates. Also corrects a ``{ % elif`` Jinja typo in the foreign-table schema diff (dead branch). Rewrite the ten pgstattuple/pgstatindex stats sites to address the relation via OID + ``::oid::regclass`` cast (e.g. ``pgstattuple({{ tid }}::oid::regclass)``), eliminating the embedded literal-call form entirely so that bug-class can no longer recur there. 2. Driver hardening: ``qtLiteral`` (in ``utils/driver/psycopg3/__init__.py``) used to silently return the raw unescaped value when its ``conn`` argument was falsy. It now raises ``ValueError`` -- surfacing the entire bug class going forward. The change immediately uncovered eight latent plumbing bugs (in ``schemas/__init__.py``, ``schemas/functions/__init__.py``, ``schemas/tables/utils.py``, ``foreign_servers/__init__.py``, and seven sites in ``roles/__init__.py``) -- all fixed as part of this patch. The inner ``except`` block that swallowed adapter-level failures and returned the raw value is also removed, so unadaptable inputs raise instead of leaking unescaped values. 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 ``*.sql`` template flagging any ``'{{ ... }}'`` single-quote-wrapped interpolation against an explicit allowlist; unit tests cover the new qtLiteral fail-fast and inner-except raise paths. This issue affects pgAdmin 4: from 1.0 before 9.16.
INFO
Published Date :
June 19, 2026, 12:16 a.m.
Last Modified :
Oct. 26, 2026, 11:10 a.m.
Remotely Exploit :
Yes !
Source :
f86ef6dc-4d3a-42ad-8f28-e6d5547a5007
CVSS Scores
| Score | Version | Severity | Vector | Exploitability Score | Impact Score | Source |
|---|---|---|---|---|---|---|
| CVSS | 134c704f-9b21-4f2e-91b3-4a467353bcc0 | |||||
| CVSS 3.1 | HIGH | f86ef6dc-4d3a-42ad-8f28-e6d5547a5007 | ||||
| CVSS 4.0 | HIGH | f86ef6dc-4d3a-42ad-8f28-e6d5547a5007 | ||||
| CVSS 4.0 | HIGH | f86ef6dc-4d3a-42ad-8f28-e6d5547a5007 |
Solution
- Escape descriptions using qtLiteral filter in templates.
- Use OID and regclass cast for relation lookups.
- Update qtLiteral to raise ValueError on falsy conn.
- Add regression and unit tests for validation.
References to Advisories, Solutions, and Tools
Here, you will find a curated list of external links that provide in-depth
information, practical solutions, and valuable tools related to
CVE-2026-12044.
| URL | Resource |
|---|---|
| https://github.com/pgadmin-org/pgadmin4/commit/2ae0d3610 | Patch |
| https://github.com/pgadmin-org/pgadmin4/commit/658bb585d | Patch |
| https://github.com/pgadmin-org/pgadmin4/issues/10078 | Issue Tracking Patch Third Party Advisory |
CWE - Common Weakness Enumeration
While CVE identifies
specific instances of vulnerabilities, CWE categorizes the common flaws or
weaknesses that can lead to vulnerabilities. CVE-2026-12044 is
associated with the following CWEs:
Common Attack Pattern Enumeration and Classification (CAPEC)
Common Attack Pattern Enumeration and Classification
(CAPEC)
stores attack patterns, which are descriptions of the common attributes and
approaches employed by adversaries to exploit the CVE-2026-12044
weaknesses.
We scan GitHub repositories to detect new proof-of-concept exploits. Following list is a collection of public exploits and proof-of-concepts, which have been published on GitHub (sorted by the most recently updated).
Results are limited to the first 15 repositories due to potential performance issues.
The following list is the news that have been mention
CVE-2026-12044 vulnerability anywhere in the article.
The following table lists the changes that have been made to the
CVE-2026-12044 vulnerability over time.
Vulnerability history details can be useful for understanding the evolution of a vulnerability, and for identifying the most recent changes that may impact the vulnerability's severity, exploitability, or other characteristics.
-
CVE Translated by [email protected]
Oct. 26, 2026
Action Type Old Value New Value Added Translation Title: pgAdmin 4 de pgadmin.org, Description: Inyección SQL en pgAdmin 4 en cada plantilla de diálogo que renderiza “COMMENT ON ... IS ’[description]’” para un campo de descripción proporcionado por el usuario. Las plantillas Jinja para Dominios (y sus restricciones), Tablas Foráneas, Lenguajes y Disparadores de Eventos, además de la consulta de búsqueda de OID de Vistas, interpolaron la descripción directamente dentro de un literal SQL entre comillas simples - “’{{ data.description }}’” - en lugar de pasarla a través del filtro de escape “qtLiteral”. Un usuario autenticado de pgAdmin con permiso para crear o alterar los tipos de objetos afectados podría enviar una descripción que contenga un apóstrofe, salir del literal y encadenar SQL arbitrario. El SQL inyectado se ejecuta bajo el rol de PostgreSQL con el que el usuario ya está autenticado; para un rol conectado con “COPY ... TO/FROM PROGRAM” (típicamente superusuario de PostgreSQL), esto se encadena a la ejecución de comandos del sistema operativo en el host de PostgreSQL. El defecto no cruza un límite de privilegios - el usuario ya tiene acceso SQL directo a ese rol a través de la Herramienta de Consulta de pgAdmin - por lo que el atacante no obtiene ninguna capacidad más allá de lo que su rol de base de datos ya le otorga. El impacto marginal captura la omisión de cualquier control de la Herramienta de Consulta a nivel de aplicación que un operador pueda haber configurado. El defecto fue reportado originalmente contra el campo “description” del Diálogo de Dominio; una auditoría de código a nivel general identificó dieciséis sitios del mismo patrón en las plantillas mencionadas anteriormente. La misma revisión también reveló diez sumideros relacionados en las plantillas de estadísticas pgstattuple/pgstatindex - “pgstattuple(’{{schema}}.{{table}}’)” y la forma coincidente de pgstatindex - donde “qtIdent” escapa las comillas dobles incrustadas dentro del identificador pero no los apóstrofes, por lo que un usuario con privilegio CREATE en un esquema podría “plantar” una tabla o índice llamado “foo’bar” y un visor de estadísticas posterior renderizaría un literal desequilibrado. La solución está en capas: 1. Sitios: reemplazar cada “’{{ x.description }}’” con “{{ x.description|qtLiteral(conn) }}” (sin comillas circundantes - el filtro envuelve el valor en comillas escapadas por sí mismo). Conectar “conn=self.conn” a través de cada llamada a “render_template” que carga una de estas plantillas. También corrige un error tipográfico de Jinja “{ % elif” en la diferencia de esquema de tabla foránea (rama muerta). Reescribir los diez sitios de estadísticas pgstattuple/pgstatindex para abordar la relación a través de OID + conversión “::oid::regclass” (p. ej., “pgstattuple({{ tid }}::oid::regclass)”), eliminando por completo la forma de llamada literal incrustada para que esa clase de error ya no pueda repetirse allí. 2. Reforzamiento del controlador: “qtLiteral” (en “utils/driver/psycopg3/__init__.py”) solía devolver silenciosamente el valor sin escapar en bruto cuando su argumento “conn” era falso. Ahora lanza “ValueError” - sacando a la luz toda la clase de errores en el futuro. El cambio descubrió inmediatamente ocho errores de conexión latentes (en “schemas/__init__.py”, “schemas/functions/__init__.py”, “schemas/tables/utils.py”, “foreign_servers/__init__.py”, y siete sitios en “roles/__init__.py”) - todos corregidos como parte de este parche. También se elimina el bloque “except” interno que “tragaba” los fallos a nivel de adaptador y devolvía el valor en bruto, por lo que las entradas no adaptables lanzan una excepción en lugar de filtrar valores sin escapar. 3. Pruebas de regresión: una prueba de comportamiento por plantilla renderiza cada plantilla previamente vulnerable con una carga útil de inyección de apóstrofe y afirma que el fragmento escapado está presente y el fragmento vulnerable ausente; una prueba de lint recorre cada plantilla “*.sql” marcando cualquier interpolación “’{{ ... }}’” envuelta en comillas simples contra una lista de permitidos explícita; las pruebas --TRUNCADO-- -
Initial Analysis by [email protected]
Jul. 01, 2026
Action Type Old Value New Value Added CPE Configuration OR *cpe:2.3:a:pgadmin:pgadmin_4:*:*:*:*:*:postgresql:*:* versions from (including) 1.0 up to (excluding) 9.16 Added Reference Type PostgreSQL: https://github.com/pgadmin-org/pgadmin4/commit/2ae0d3610 Types: Patch Added Reference Type PostgreSQL: https://github.com/pgadmin-org/pgadmin4/commit/658bb585d Types: Patch Added Reference Type PostgreSQL: https://github.com/pgadmin-org/pgadmin4/issues/10078 Types: Issue Tracking, Patch, Third Party Advisory -
CVE Modified by 134c704f-9b21-4f2e-91b3-4a467353bcc0
Jun. 22, 2026
Action Type Old Value New Value Added SSVC {'id': 'CVE-2026-12044', 'role': 'CISA Coordinator', 'options': [{'exploitation': 'none'}, {'automatable': 'no'}, {'technicalImpact': 'total'}], 'version': '2.0.3', 'timestamp': '2026-06-22T18:36:59.059744Z'} -
New CVE Received by f86ef6dc-4d3a-42ad-8f28-e6d5547a5007
Jun. 19, 2026
Action Type Old Value New Value Added Affected [{'repo': 'https://github.com/pgadmin-org/pgadmin4', 'vendor': 'pgadmin.org', 'modules': ['Domains', 'Domain Constraints', 'Foreign Tables', 'Languages', 'Event Triggers', 'Views', 'Tables', 'Indexes', 'Index Constraints', 'Exclusion Constraints', 'Materialized Views', 'Driver (qtLiteral)'], 'product': 'pgAdmin 4', 'versions': [{'status': 'affected', 'version': '1.0', 'lessThan': '9.16', 'versionType': 'custom'}], 'programFiles': ['https://github.com/pgadmin-org/pgadmin4/blob/master/web/pgadmin/utils/driver/psycopg3/__init__.py', 'https://github.com/pgadmin-org/pgadmin4/blob/master/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/templates/domains/sql/default/create.sql', 'https://github.com/pgadmin-org/pgadmin4/blob/master/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/tables/sql/16_plus/stats.sql'], 'defaultStatus': 'unaffected'}] Added Description SQL injection in pgAdmin 4 across every dialog template that renders ``COMMENT ON ... IS '<description>'`` 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 -- ``'{{ data.description }}'`` -- instead of passing it through the ``qtLiteral`` 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 ``COPY ... TO/FROM PROGRAM`` (typically PostgreSQL superuser), this chains to OS command execution on the PostgreSQL host. The defect does not cross a privilege boundary -- the user already has direct SQL access to that role through pgAdmin's Query Tool -- 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. The defect was originally reported against the Domain Dialog ``description`` 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 -- ``pgstattuple('{{schema}}.{{table}}')`` and the matching pgstatindex shape -- where ``qtIdent`` 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 ``foo'bar`` and a later stats viewer would render an unbalanced literal. Fix is layered: 1. Sites: replace every ``'{{ x.description }}'`` with ``{{ x.description|qtLiteral(conn) }}`` (no surrounding quotes -- the filter wraps the value in escaped quotes itself). Plumb ``conn=self.conn`` through every ``render_template`` call that loads one of these templates. Also corrects a ``{ % elif`` Jinja typo in the foreign-table schema diff (dead branch). Rewrite the ten pgstattuple/pgstatindex stats sites to address the relation via OID + ``::oid::regclass`` cast (e.g. ``pgstattuple({{ tid }}::oid::regclass)``), eliminating the embedded literal-call form entirely so that bug-class can no longer recur there. 2. Driver hardening: ``qtLiteral`` (in ``utils/driver/psycopg3/__init__.py``) used to silently return the raw unescaped value when its ``conn`` argument was falsy. It now raises ``ValueError`` -- surfacing the entire bug class going forward. The change immediately uncovered eight latent plumbing bugs (in ``schemas/__init__.py``, ``schemas/functions/__init__.py``, ``schemas/tables/utils.py``, ``foreign_servers/__init__.py``, and seven sites in ``roles/__init__.py``) -- all fixed as part of this patch. The inner ``except`` block that swallowed adapter-level failures and returned the raw value is also removed, so unadaptable inputs raise instead of leaking unescaped values. 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 ``*.sql`` template flagging any ``'{{ ... }}'`` single-quote-wrapped interpolation against an explicit allowlist; unit tests cover the new qtLiteral fail-fast and inner-except raise paths. This issue affects pgAdmin 4: from 1.0 before 9.16. Added CVSS V4.0 AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X Added CVSS V3.1 AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H Added CWE CWE-89 Added CWE CWE-116 Added Reference https://github.com/pgadmin-org/pgadmin4/commit/2ae0d3610 Added Reference https://github.com/pgadmin-org/pgadmin4/commit/658bb585d Added Reference https://github.com/pgadmin-org/pgadmin4/issues/10078