Skip to content

SQL Injection in Pgadmin

CVE-2026-17346 First seen on SecPulse

AI summary

Produced by SecPulse using an external AI model; it may contain mistakes. Check the original description and references below before acting on it.

pgAdmin 4の一部の統計・依存関係表示で、オブジェクト名に含まれる引用符が正しくエスケープされず、任意のSQL文を実行される脆弱性です。低い権限のユーザーが作成したオブジェクトを、上位の権限を持つユーザーが開くと影響を受けます。修正版が公開されていますので、最新の情報を確認してください。

What is the problem

pgAdmin 4のSQLテンプレートにおけるSQLインジェクション脆弱性。

Affected scope

pgAdmin 4のバージョン9.16以前。

Severity

高権限ユーザーのデータベースセッションで任意のSQL文が実行でき攻撃が可能。

How to fix

テンプレートのエスケープ処理を強化し、すべてをqtLiteral(conn)を使用して修正。

Workaround

情報なし

Detection

pgAdmin 4のバージョンを確認し、9.16以前の場合はアップデートを検討。

Original description The description as published by the source.

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 agai…

Source: NIST National Vulnerability Database NVD GitHub Advisory

References

We use cookies for analytics and ad measurement. This setting applies to all Game co., Ltd. sites. Details