pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Prevent construction of invalid "name" values via element assign 3+ messages / 1 participants [nested] [flat]
* pgsql: Prevent construction of invalid "name" values via element assign @ 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 Prevent construction of invalid "name" values via element assignment. Although type "name" is of length NAMEDATALEN, we must not allow the last byte to become nonzero. Otherwise, operations that treat it as a C string will read off the end, resulting in crashes or disclosure of server memory. array_set_element() failed to enforce this. Another bad outcome of element assignment could be to construct an invalidly-encoded multibyte character. Check that too while we're at it. Ideally we'd extend array_set_element()'s API to pass the array type OID, but that's infeasible in released branches, and it seems not worth the trouble even in master given the tiny usage of fixed-length array types. Instead just test for elmlen == 1 && arraytyplen == NAMEDATALEN to decide whether it's a name. Reported-by: Anthropic OSS program Author: Tom Lane <tgl@sss.pgh.pa.us> Reviewed-by: Noah Misch <noah@leadboat.com> Backpatch-through: 14 Security: CVE-2026-116321 Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/f22d6aba940d93e49b1f296e616150e357a75d79 Author: Tom Lane <tgl@sss.pgh.pa.us> Modified Files -------------- src/backend/utils/adt/arrayfuncs.c | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) ^ permalink raw reply [nested|flat] 3+ messages in thread
* pgsql: Prevent construction of invalid "name" values via element assign @ 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 Prevent construction of invalid "name" values via element assignment. Although type "name" is of length NAMEDATALEN, we must not allow the last byte to become nonzero. Otherwise, operations that treat it as a C string will read off the end, resulting in crashes or disclosure of server memory. array_set_element() failed to enforce this. Another bad outcome of element assignment could be to construct an invalidly-encoded multibyte character. Check that too while we're at it. Ideally we'd extend array_set_element()'s API to pass the array type OID, but that's infeasible in released branches, and it seems not worth the trouble even in master given the tiny usage of fixed-length array types. Instead just test for elmlen == 1 && arraytyplen == NAMEDATALEN to decide whether it's a name. Reported-by: Anthropic OSS program Author: Tom Lane <tgl@sss.pgh.pa.us> Reviewed-by: Noah Misch <noah@leadboat.com> Backpatch-through: 14 Security: CVE-2026-116321 Branch ------ REL_19_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/82ffa9d00db962866df0a1ac4738de78db715ae6 Author: Tom Lane <tgl@sss.pgh.pa.us> Modified Files -------------- src/backend/utils/adt/arrayfuncs.c | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) ^ permalink raw reply [nested|flat] 3+ messages in thread
* pgsql: Prevent construction of invalid "name" values via element assign @ 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 Prevent construction of invalid "name" values via element assignment. Although type "name" is of length NAMEDATALEN, we must not allow the last byte to become nonzero. Otherwise, operations that treat it as a C string will read off the end, resulting in crashes or disclosure of server memory. array_set_element() failed to enforce this. Another bad outcome of element assignment could be to construct an invalidly-encoded multibyte character. Check that too while we're at it. Ideally we'd extend array_set_element()'s API to pass the array type OID, but that's infeasible in released branches, and it seems not worth the trouble even in master given the tiny usage of fixed-length array types. Instead just test for elmlen == 1 && arraytyplen == NAMEDATALEN to decide whether it's a name. Reported-by: Anthropic OSS program Author: Tom Lane <tgl@sss.pgh.pa.us> Reviewed-by: Noah Misch <noah@leadboat.com> Backpatch-through: 14 Security: CVE-2026-116321 Branch ------ REL_18_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/b3ef92518c57d8db63ac18b4adcf585da90e0673 Author: Tom Lane <tgl@sss.pgh.pa.us> Modified Files -------------- src/backend/utils/adt/arrayfuncs.c | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) ^ 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: Prevent construction of invalid "name" values via element assign Noah Misch <noah@leadboat.com> 2026-11-09 14:21 pgsql: Prevent construction of invalid "name" values via element assign Noah Misch <noah@leadboat.com> 2026-11-09 14:21 pgsql: Prevent construction of invalid "name" values via element assign 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