ecpg: Fix out-of-bound writes due to processing of invalid bytea data ECPG assumes that any bytea data it receives from a backend starts with '\x' as its first two bytes, but a check was missed to enforce that. A rogue server sending some garbage bytea data would be able to crash a client, resulting in a client-side DoS, in the most common cases.
Reported-by: ylwangtju <[email protected]> Backpatch-through: 14 Security: CVE-2026-16241 Branch ------ REL_17_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/c3c830272a97b9b429eb015c2df206264649c6fc Author: Michael Paquier <[email protected]> Modified Files -------------- src/interfaces/ecpg/ecpglib/data.c | 7 ++++++ src/interfaces/ecpg/ecpglib/error.c | 7 ++++++ src/interfaces/ecpg/include/ecpgerrno.h | 1 + src/interfaces/ecpg/test/expected/sql-bytea.c | 27 ++++++++++++++++++---- src/interfaces/ecpg/test/expected/sql-bytea.stderr | 24 ++++++++++++++++++- src/interfaces/ecpg/test/sql/bytea.pgc | 5 ++++ 6 files changed, 66 insertions(+), 5 deletions(-)
