pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Check EXECUTE privilege on type-to-json cast functions.
3+ messages / 1 participants
[nested] [flat]

* pgsql: Check EXECUTE privilege on type-to-json cast functions.
@ 2026-11-09 14:21 Noah Misch <noah@leadboat.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Noah Misch @ 2026-11-09 14:21 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Check EXECUTE privilege on type-to-json cast functions.

When converting a value to json or jsonb, to_json() and its many
friends execute the cast function without first checking for
EXECUTE privileges.  To fix, check privileges and invoke the
object access hook before calling the cast function.  This
covers to_json(), to_jsonb(), row_to_json(), array_to_json(), the
json[b]_build_*() and *_agg() functions, the SQL/JSON constructors
(v16 and later), and COPY TO with FORMAT json (v19 and later).

Reported-by: Filip Janus <fjanus@redhat.com>
Reported-by: Anthropic OSS program
Author: Nathan Bossart <nathandbossart@gmail.com>
Co-authored-by: Anthropic OSS program
Reviewed-by: Andrew Dunstan <andrew@dunslane.net>
Security: CVE-2026-116303
Backpatch-through: 14

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/296d035f4dcce7fcc5ff02985c078402d71171a5
Author: Nathan Bossart <nathan@postgresql.org>

Modified Files
--------------
src/backend/utils/adt/json.c             |  9 +++++++++
src/backend/utils/adt/jsonb.c            |  9 +++++++++
src/test/regress/expected/privileges.out | 21 +++++++++++++++++++++
src/test/regress/sql/privileges.sql      | 15 +++++++++++++++
4 files changed, 54 insertions(+)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* pgsql: Check EXECUTE privilege on type-to-json cast functions.
@ 2026-11-09 14:21 Noah Misch <noah@leadboat.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Noah Misch @ 2026-11-09 14:21 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Check EXECUTE privilege on type-to-json cast functions.

When converting a value to json or jsonb, to_json() and its many
friends execute the cast function without first checking for
EXECUTE privileges.  To fix, check privileges and invoke the
object access hook before calling the cast function.  This
covers to_json(), to_jsonb(), row_to_json(), array_to_json(), the
json[b]_build_*() and *_agg() functions, the SQL/JSON constructors
(v16 and later), and COPY TO with FORMAT json (v19 and later).

Reported-by: Filip Janus <fjanus@redhat.com>
Reported-by: Anthropic OSS program
Author: Nathan Bossart <nathandbossart@gmail.com>
Co-authored-by: Anthropic OSS program
Reviewed-by: Andrew Dunstan <andrew@dunslane.net>
Security: CVE-2026-116303
Backpatch-through: 14

Branch
------
REL_19_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/af852c3a30a871930c1d029216b9dcbd6ad52ac8
Author: Nathan Bossart <nathan@postgresql.org>

Modified Files
--------------
src/backend/utils/adt/json.c             |  9 +++++++++
src/backend/utils/adt/jsonb.c            |  9 +++++++++
src/test/regress/expected/privileges.out | 21 +++++++++++++++++++++
src/test/regress/sql/privileges.sql      | 15 +++++++++++++++
4 files changed, 54 insertions(+)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* pgsql: Check EXECUTE privilege on type-to-json cast functions.
@ 2026-11-09 14:21 Noah Misch <noah@leadboat.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Noah Misch @ 2026-11-09 14:21 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Check EXECUTE privilege on type-to-json cast functions.

When converting a value to json or jsonb, to_json() and its many
friends execute the cast function without first checking for
EXECUTE privileges.  To fix, check privileges and invoke the
object access hook before calling the cast function.  This
covers to_json(), to_jsonb(), row_to_json(), array_to_json(), the
json[b]_build_*() and *_agg() functions, the SQL/JSON constructors
(v16 and later), and COPY TO with FORMAT json (v19 and later).

Reported-by: Filip Janus <fjanus@redhat.com>
Reported-by: Anthropic OSS program
Author: Nathan Bossart <nathandbossart@gmail.com>
Co-authored-by: Anthropic OSS program
Reviewed-by: Andrew Dunstan <andrew@dunslane.net>
Security: CVE-2026-116303
Backpatch-through: 14

Branch
------
REL_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/3531f4b343d7cad7c24b17d5e4ed74f1721d2a86
Author: Nathan Bossart <nathan@postgresql.org>

Modified Files
--------------
src/backend/utils/adt/json.c             |  9 +++++++++
src/backend/utils/adt/jsonb.c            | 11 +++++++++++
src/test/regress/expected/privileges.out | 21 +++++++++++++++++++++
src/test/regress/sql/privileges.sql      | 15 +++++++++++++++
4 files changed, 56 insertions(+)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2026-11-09 14:21 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-11-09 14:21 pgsql: Check EXECUTE privilege on type-to-json cast functions. Noah Misch <noah@leadboat.com>
2026-11-09 14:21 pgsql: Check EXECUTE privilege on type-to-json cast functions. Noah Misch <noah@leadboat.com>
2026-11-09 14:21 pgsql: Check EXECUTE privilege on type-to-json cast functions. Noah Misch <noah@leadboat.com>

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