]> git.ipfire.org Git - thirdparty/postgresql.git/commit
refint: Fix SQL injection and buffer overruns.
authorNathan Bossart <nathan@postgresql.org>
Mon, 11 May 2026 12:13:48 +0000 (05:13 -0700)
committerNoah Misch <noah@leadboat.com>
Mon, 11 May 2026 12:13:48 +0000 (05:13 -0700)
commit1ebda7da9a43d3ae3564d08612de9cb27fbaf482
treeea73a6aa0fe713cbb16b86aff9a14bcee3c09109
parentbe013644043e5bae7260c09ab49cc6d64b7992be
refint: Fix SQL injection and buffer overruns.

Maliciously crafted key value updates could achieve SQL injection
within check_foreign_key().  To fix, ensure new key values are
properly quoted and escaped in the internally generated SQL
statements.  While at it, avoid potential buffer overruns by
replacing the stack buffers for internally generated SQL statements
with StringInfo.

Reported-by: Nikolay Samokhvalov <nik@postgres.ai>
Author: Nathan Bossart <nathandbossart@gmail.com>
Reviewed-by: Noah Misch <noah@leadboat.com>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Reviewed-by: Fujii Masao <masao.fujii@gmail.com>
Security: CVE-2026-6637
Backpatch-through: 14
contrib/spi/refint.c