agora inbox for pgsql-committers@postgresql.org
help / color / mirror / Atom feedFrom: Noah Misch <noah@leadboat.com>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Return nulls honestly in aggregate "combine" functions.
Date: Mon, 10 Aug 2026 13:41:22 +0000
Message-ID: <E1wtQFm-00000000y4N-12EU@gemulon.postgresql.org> (raw)
Return nulls honestly in aggregate "combine" functions.
numeric_combine() and several other state-combining functions for
aggregates cheated for the case of both inputs being NULL: they
returned a null pointer without bothering to mark it as a SQL NULL.
This was harmless in the expected usage where the result would be
passed to the same combine function or a related aggregate final
function. But it's bad news from a security standpoint, because
now that value can be passed to an internal-accepting function
even if said function is strict. While a previous patch prevented
such queries from being issued, it seems like good defense-in-depth
to expend the few additional lines of code needed to do this properly.
Comparable functions such as array_agg_combine() already do so.
Reported-by: Amy Burnett (OpenAI Codex Security)
Author: Tom Lane <tgl@sss.pgh.pa.us>
Backpatch-through: 14
Security: CVE-2026-14680
Branch
------
REL_19_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/21d8cfb18f465be344dd83852792b88818c33634
Author: Tom Lane <tgl@sss.pgh.pa.us>
Modified Files
--------------
src/backend/utils/adt/numeric.c | 32 ++++++++++++++++++++++++++++++++
src/backend/utils/adt/timestamp.c | 8 ++++++++
2 files changed, 40 insertions(+)
view thread (6+ messages) latest in thread
Message-ID: <E1wtQFm-00000000y4N-12EU@gemulon.postgresql.org>
Permalink: ../E1wtQFm-00000000y4N-12EU@gemulon.postgresql.org/
Also on: postgresql.org/message-id/E1wtQFm-00000000y4N-12EU@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 using the --to and --cc options:
reply via email
To: pgsql-committers@postgresql.org
Cc: noah@leadboat.com, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Return nulls honestly in aggregate "combine" functions.
In-Reply-To: <E1wtQFm-00000000y4N-12EU@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 agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox