From: Noah Misch <noah@leadboat.com>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: plpgsql: recheck record field's type after casting value.
Date: Mon, 09 Nov 2026 14:21:51 +0000
Message-ID: <E1xQQFr-000000003MQ-0DHR@gemulon.postgresql.org> (raw)
plpgsql: recheck record field's type after casting value.
exec_cast_value() can reach code that will change the rowtype of a
RECORD variable, but the RECFIELD case in exec_assign_value() doesn't
account for that and assumes the record field type and column number
that it previously looked up are still good. Recheck that data
if the tuple type ID changed; since that condition never holds in
normal usage, this is a cheap enough safety check.
Reported-by: Claude and Ada Logics
Author: Tom Lane <tgl@sss.pgh.pa.us>
Backpatch-through: 14
Security: CVE-2026-120151
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/ff2e66f4953378b05f58452042f99118ebc27f57
Author: Tom Lane <tgl@sss.pgh.pa.us>
Modified Files
--------------
src/pl/plpgsql/src/pl_exec.c | 43 +++++++++++++++++++++++++++++++++++--------
1 file changed, 35 insertions(+), 8 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: plpgsql: recheck record field's type after casting value.
In-Reply-To: <E1xQQFr-000000003MQ-0DHR@gemulon.postgresql.org>
References: <E1xQQFr-000000003MQ-0DHR@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