Obstruct EXTRACT() field name deparse injection.

The parser accepts any string as an EXTRACT() field name, but
deparsing does not quote and escape it accordingly.  To fix, quote
and escape the field name during deparsing as needed.  It might be
a good idea to validate the field name during parsing and
deparsing, too, but that is left as a future exercise.

Reported-by: Ben Morris in collaboration with Claude and Anthropic Research
Author: Nathan Bossart <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Reviewed-by: Etsuro Fujita <[email protected]>
Security: CVE-2026-15741
Backpatch-through: 14

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/f9729b5078dca08f5c873ca063f0449e8bb3f256
Author: Nathan Bossart <[email protected]>

Modified Files
--------------
src/backend/utils/adt/ruleutils.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

Reply via email to