Treat application of a leaky function to CaseTestExpr/Param as leaky. A CaseTestExpr or internal Param represents the value of an expression somewhere else in the query. If that expression contains a Var then there is potential for information leakage. Therefore, teach contain_leaked_vars() to reject such cases.
In principle we could try to find the referenced expression and perform a more accurate analysis, but that seems not worth the substantial work required, because in most real-world cases there'd be a Var there anyway. Reported-by: Only see myself <[email protected]> Author: Tom Lane <[email protected]> Backpatch-through: 14 Security: CVE-2026-116327 Branch ------ REL_15_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/b33b48031652cd832bc6d842aa03e87480ba45a2 Author: Tom Lane <[email protected]> Modified Files -------------- src/backend/optimizer/util/clauses.c | 19 +++++++---- src/backend/optimizer/util/var.c | 64 ++++++++++++++++++++++++++++++++++++ src/include/optimizer/optimizer.h | 1 + 3 files changed, 77 insertions(+), 7 deletions(-)
