Исправление CVE-2026-12044 в pgAdmin 4 9.16 усилило qtLiteral и переключило на него шестнадцать шаблонов COMMENT ON / pgstattuple / pgstatindex, но пропустило несколько приемников, которые были помещены в ALLOWLIST test_sql_string_literal_lint.py из-за неправильного предположения, что имена схем, таблиц, публикаций и подписок, полученные из pg_catalog через дерево браузера, могут никогда не содержат апостроф. PostgreSQL допускает произвольные символы в идентификаторах в кавычках, поэтому пользователь с низким уровнем привилегий, способный CREATE TABLE, CREATE PUBLICATION или CREATE SUBSCRIPTION, может создать имя объекта с апострофом, которое выходит за пределы неэкранированной интерполяции шаблона '{{ name }}' в тот момент, когда любой пользователь (включая пользователя с более высокими привилегиями) открывает вкладку Статистика или Зависимости этого объекта, позволяя вводить произвольные операторы SQL при просмотре. сеанс базы данных пользователя. Затронутые приемники: запрос статистики индекса для списка всех индексов (coll_stats.sql, как варианты шаблона версии 16_plus, так и версии PostgreSQL по умолчанию — в отличие от пути stats.sql с одним индексом, уже исправленного в CVE-2026-12044), а также шаблоны публикации и подписки dependency.sql/get_position.sql (варианты диалекта pg и ppas/EPAS для публикаций). Fix переключает все эти шаблоны на qtLiteral(conn) для интерполяции имен и обновляет публикации/__init__.py и подписки/__init__.py, чтобы передать conn=self.conn в вызов dependency.sql render_template, чтобы у фильтра qtLiteral было соединение для цитирования.
Соответствующие записи ALLOWLIST в test_sql_string_literal_lint.py теперь удалены, поскольку эти приемники правильно экранируются, а не просто считаются безопасными. Тест поведенческой регрессии отображает каждый фиксированный шаблон с полезной нагрузкой апострофа в виде составных операторов и утверждает, что имя объекта отображается точно так же, как экранированное qtLiteral, и что визуализированный SQL анализируется ровно как один оператор, проверяя, что утверждение действительно не соответствует форме необработанной интерполяции до исправления. Эта проблема затрагивает pgAdmin 4: статистика индекса снижается с версии 1.0, а публикации/подписки снижается с версии 5.0, оба до версии 9.17.
Показать оригинальное описание (EN)
The fix for CVE-2026-12044 in pgAdmin 4 9.16 hardened qtLiteral and switched sixteen COMMENT ON / pgstattuple / pgstatindex templates to it, but missed several sinks that had been placed in test_sql_string_literal_lint.py's ALLOWLIST on the incorrect assumption that schema, table, publication, and subscription names sourced from pg_catalog via the browser tree could never contain an apostrophe. PostgreSQL permits arbitrary characters in quoted identifiers, so a low-privileged user able to CREATE TABLE, CREATE PUBLICATION, or CREATE SUBSCRIPTION can plant an apostrophe'd object name that breaks out of the unescaped '{{ name }}' template interpolation the moment any user (including a higher-privileged one) opens that object's Statistics or Dependencies tab, allowing arbitrary SQL statement injection in the viewing user's database session. Affected sinks: the Index Statistics query for all-indexes listing (coll_stats.sql, both the 16_plus and default PostgreSQL-version template variants -- distinct from the single-index stats.sql path already fixed in CVE-2026-12044), and the publication and subscription dependencies.sql / get_position.sql templates (both the pg and ppas/EPAS dialect variants for publications). Fix switches all of these templates to qtLiteral(conn) for name interpolation, and updates publications/__init__.py and subscriptions/__init__.py to pass conn=self.conn into the dependencies.sql render_template call so the qtLiteral filter has a connection to quote against. The corresponding ALLOWLIST entries in test_sql_string_literal_lint.py are removed now that these sinks are properly escaped rather than merely assumed safe. A behavioral regression test renders each fixed template with a stacked-statement apostrophe payload and asserts both that the object name appears exactly as qtLiteral-escaped and that the rendered SQL parses as exactly one statement, verifying the assertion genuinely fails against the pre-patch raw-interpolation form. This issue affects pgAdmin 4: the Index Statistics sink from 1.0, and the Publications/Subscriptions sinks from 5.0, both before 9.17.
Характеристики атаки
Последствия
Строка CVSS v4.0