pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: vacuumdb: Fully qualify the catalog query's operators.
3+ messages / 1 participants
[nested] [flat]

* pgsql: vacuumdb: Fully qualify the catalog query's operators.
@ 2026-11-09 14:21  Noah Misch <noah@leadboat.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Noah Misch @ 2026-11-09 14:21 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

vacuumdb: Fully qualify the catalog query's operators.

vacuumdb runs its catalog query with the session's default
search_path so that --table arguments resolve as they would in
psql, but commit edba754f05 added two constructs whose = is not
schema-qualified: the relkind IN list in the LATERAL and the IS
DISTINCT FROM tests on attstattarget and stxstattarget.  This
allows a database owner to shadow the operator with their own and
execute arbitrary code as the user running vacuumdb.  To fix,
rewrite the former as OPERATOR(pg_catalog.=) ANY (array[...]) like
the relkind filter in the WHERE clause, and the latter as an IS
NULL test with OPERATOR(pg_catalog.<>).

Reported-by: Noah Misch <noah@leadboat.com>
Reported-by: Anthropic OSS program
Author: Nathan Bossart <nathandbossart@gmail.com>
Co-authored-by: Anthropic OSS program
Reviewed-by: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Security: CVE-2026-116313
Backpatch-through: 18

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/1ce3bce608dc504ca8849d42abcccc7820b88e48
Author: Nathan Bossart <nathan@postgresql.org>

Modified Files
--------------
src/bin/scripts/vacuuming.c | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* pgsql: vacuumdb: Fully qualify the catalog query's operators.
@ 2026-11-09 14:21  Noah Misch <noah@leadboat.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Noah Misch @ 2026-11-09 14:21 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

vacuumdb: Fully qualify the catalog query's operators.

vacuumdb runs its catalog query with the session's default
search_path so that --table arguments resolve as they would in
psql, but commit edba754f05 added two constructs whose = is not
schema-qualified: the relkind IN list in the LATERAL and the IS
DISTINCT FROM tests on attstattarget and stxstattarget.  This
allows a database owner to shadow the operator with their own and
execute arbitrary code as the user running vacuumdb.  To fix,
rewrite the former as OPERATOR(pg_catalog.=) ANY (array[...]) like
the relkind filter in the WHERE clause, and the latter as an IS
NULL test with OPERATOR(pg_catalog.<>).

Reported-by: Noah Misch <noah@leadboat.com>
Reported-by: Anthropic OSS program
Author: Nathan Bossart <nathandbossart@gmail.com>
Co-authored-by: Anthropic OSS program
Reviewed-by: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Security: CVE-2026-116313
Backpatch-through: 18

Branch
------
REL_19_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/623cda5ef837c8fd3b6da14bd7c8e20fdd15d4f0
Author: Nathan Bossart <nathan@postgresql.org>

Modified Files
--------------
src/bin/scripts/vacuuming.c | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* pgsql: vacuumdb: Fully qualify the catalog query's operators.
@ 2026-11-09 14:21  Noah Misch <noah@leadboat.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Noah Misch @ 2026-11-09 14:21 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

vacuumdb: Fully qualify the catalog query's operators.

vacuumdb runs its catalog query with the session's default
search_path so that --table arguments resolve as they would in
psql, but commit edba754f05 added two constructs whose = is not
schema-qualified: the relkind IN list in the LATERAL and the IS
DISTINCT FROM tests on attstattarget and stxstattarget.  This
allows a database owner to shadow the operator with their own and
execute arbitrary code as the user running vacuumdb.  To fix,
rewrite the former as OPERATOR(pg_catalog.=) ANY (array[...]) like
the relkind filter in the WHERE clause, and the latter as an IS
NULL test with OPERATOR(pg_catalog.<>).

Reported-by: Noah Misch <noah@leadboat.com>
Reported-by: Anthropic OSS program
Author: Nathan Bossart <nathandbossart@gmail.com>
Co-authored-by: Anthropic OSS program
Reviewed-by: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Security: CVE-2026-116313
Backpatch-through: 18

Branch
------
REL_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/e10d38d4715ecb75b274546f0c5917de2fe14829
Author: Nathan Bossart <nathan@postgresql.org>

Modified Files
--------------
src/bin/scripts/vacuumdb.c | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2026-11-09 14:21 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-11-09 14:21 pgsql: vacuumdb: Fully qualify the catalog query's operators. Noah Misch <noah@leadboat.com>
2026-11-09 14:21 pgsql: vacuumdb: Fully qualify the catalog query's operators. Noah Misch <noah@leadboat.com>
2026-11-09 14:21 pgsql: vacuumdb: Fully qualify the catalog query's operators. Noah Misch <noah@leadboat.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox