Protect against miscalculation of tuple sizes via int32 overflow In-memory tuple sizes were being calculated in 64-bit-sized variables and later assigned to 32-bit variables, potentially leading to integer wraparound, which could then be used to overwrite server memory with attacker-controlled contents. Repair by using overflow-aware addition and, for additions done in loops, checking that the result complies with the 1GB palloc limit at each step.
Reported-by: Hillai Ben Sasson <[email protected]> Reported-by: Jayden Sarveshkumar <[email protected]> Reported-by: Mehmet Ince <[email protected]> Author: Álvaro Herrera <[email protected]> Reviewed-by: Tatsuo Ishii <[email protected]> Security: CVE-2026-120139 Backpatch-through: 14 Branch ------ REL_15_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/249fa011fb7b567a0820ec17001f817d9c82da7f Author: Álvaro Herrera <[email protected]> Modified Files -------------- src/backend/access/common/heaptuple.c | 59 +++++++++++++++++++++++++++++---- src/backend/access/heap/heaptoast.c | 20 ++++++----- src/backend/executor/execTuples.c | 5 +++ src/backend/utils/adt/multirangetypes.c | 7 ++++ src/include/access/htup_details.h | 4 +++ src/include/access/tupmacs.h | 30 +++++++++++++++++ src/include/c.h | 1 + 7 files changed, 111 insertions(+), 15 deletions(-)
