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 ------ master Details ------- https://git.postgresql.org/pg/commitdiff/c7da85fec96666b038fdf83c81dbe1e1573a9e60 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(-)
