pgsql: Reject calls from SQL to functions that take or return type inte - Mailing list pgsql-committers

From Noah Misch
Subject pgsql: Reject calls from SQL to functions that take or return type inte
Date
Msg-id E1wtQFj-00000000y0v-3rq7@gemulon.postgresql.org
Whole thread
List pgsql-committers
Reject calls from SQL to functions that take or return type internal.

Allowing that is a security hole, since there are many different
functions with different ideas of what their "internal" argument or
result is.  We already had a defense against the easy case of
"'foo'::internal", but that turns out to be insufficient.  Lock down
both function and operator syntax.  Also disallow attempts to cast to
or from type internal; those would mostly fail anyway, but we have
created some holes with features such as CoerceViaIO.

Reported-by: Amy Burnett (OpenAI Codex Security)
Author: Tom Lane <tgl@sss.pgh.pa.us>
Reviewed-by: Robert Haas <robertmhaas@gmail.com>
Backpatch-through: 14
Security: CVE-2026-14680

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/8f7e35b08ad5b5a400d0333188c17bb354174f60
Author: Tom Lane <tgl@sss.pgh.pa.us>

Modified Files
--------------
src/backend/parser/parse_coerce.c |  8 ++++++++
src/backend/parser/parse_func.c   | 26 ++++++++++++++++++++++++++
src/backend/parser/parse_oper.c   | 22 ++++++++++++++++++++++
src/pl/plpgsql/src/pl_exec.c      | 12 ++++++++++--
4 files changed, 66 insertions(+), 2 deletions(-)


Attachment

pgsql-committers by date:

Previous
From: John Naylor
Date:
Subject: Re: pgsql: Rename sort support integer comparators for clarity
Next
From: Noah Misch
Date:
Subject: pgsql: Cross-check the type of a portal running EXECUTE or FETCH.