From: Noah Misch <noah@leadboat.com>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: vacuumdb: Fully qualify the catalog query's operators.
Date: Mon, 09 Nov 2026 14:21:58 +0000
Message-ID: <E1xQQFy-000000003dU-3mXl@gemulon.postgresql.org> (raw)
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(-)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: noah@leadboat.com
Subject: Re: pgsql: vacuumdb: Fully qualify the catalog query's operators.
In-Reply-To: <E1xQQFy-000000003dU-3mXl@gemulon.postgresql.org>
References: <E1xQQFy-000000003dU-3mXl@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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