Avoid using a dangling pointer in expanded-record domain checks. build_dummy_expanded_header() sets up the expanded record's dummy child to have eoh_context equal to the parent's er_short_term_cxt. If some operation on the dummy record causes creation of a short-term context belonging to the dummy record itself, that will be a child of the parent's er_short_term_cxt, which means it will get deleted when we reset the parent's er_short_term_cxt at the end of the callers of build_dummy_expanded_header(). So the next time through, we'll try to use a dangling context pointer, which often will now be pointing at some other unrelated context. That at least risks a crash, and it's reported to be exploitable for arbitrary code execution. To fix, just clear the potentially-dangling pointer in the next usage cycle.
Reported-by: Claude and Ada Logics Author: Tom Lane <[email protected]> Backpatch-through: 14 Security: CVE-2026-120150 Branch ------ REL_15_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/7c822f3430abec4a41bc59b452bc8b8eb9c8c579 Author: Tom Lane <[email protected]> Modified Files -------------- src/backend/utils/adt/expandedrecord.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
