From: Noah Misch <noah@leadboat.com>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Check EXECUTE privilege on foreign key cast functions.
Date: Mon, 09 Nov 2026 14:21:53 +0000
Message-ID: <E1xQQFt-000000003SF-2v3F@gemulon.postgresql.org> (raw)
Check EXECUTE privilege on foreign key cast functions.
When a foreign key's referencing column must be cast to the type of
the referenced column, the comparison that decides whether an
UPDATE of the referencing table changed the key executes the cast
function without first checking for EXECUTE privileges. To fix,
check privileges and invoke the function execution hook before
calling the cast function. Note that this check is made as the
user issuing the UPDATE, since the comparison happens before any
switch to the referenced table's owner.
Reported-by: Noah Misch <noah@leadboat.com>
Author: Nathan Bossart <nathandbossart@gmail.com>
Security: CVE-2026-116303
Backpatch-through: 14
Branch
------
REL_19_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/d3c033944f887e30a6c947dcaef54971e97dab5f
Author: Nathan Bossart <nathan@postgresql.org>
Modified Files
--------------
src/backend/utils/adt/ri_triggers.c | 10 ++++++++++
src/test/regress/expected/foreign_key.out | 21 +++++++++++++++++++++
src/test/regress/sql/foreign_key.sql | 22 ++++++++++++++++++++++
3 files changed, 53 insertions(+)
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: Check EXECUTE privilege on foreign key cast functions.
In-Reply-To: <E1xQQFt-000000003SF-2v3F@gemulon.postgresql.org>
References: <E1xQQFt-000000003SF-2v3F@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