pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
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:55 +0000
Message-ID: <E1xQQFv-000000003WW-2PBE@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
------
REL_19_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/fd4e840b69272fc7b96177de1a7fcaffca99452f
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(-)



view thread (2+ messages)

Message-ID: <E1xQQFv-000000003WW-2PBE@gemulon.postgresql.org>
Permalink:  ../E1xQQFv-000000003WW-2PBE@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1xQQFv-000000003WW-2PBE@gemulon.postgresql.org

 · 

reply

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: <E1xQQFv-000000003WW-2PBE@gemulon.postgresql.org>
  References: <E1xQQFv-000000003WW-2PBE@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