]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Ensure cached plans are correctly marked as dependent on role.
authorNathan Bossart <nathan@postgresql.org>
Mon, 11 Nov 2024 15:00:00 +0000 (09:00 -0600)
committerNathan Bossart <nathan@postgresql.org>
Mon, 11 Nov 2024 15:00:00 +0000 (09:00 -0600)
commit4e51030af9e0a12d7fa06b73acd0c85024f81062
tree5f810bff4f93cd7279eef885b6ff302379e9801b
parentd15ec27c977100037ae513ab7fe1a214bfc2507b
Ensure cached plans are correctly marked as dependent on role.

If a CTE, subquery, sublink, security invoker view, or coercion
projection references a table with row-level security policies, we
neglected to mark the plan as potentially dependent on which role
is executing it.  This could lead to later executions in the same
session returning or hiding rows that should have been hidden or
returned instead.

Reported-by: Wolfgang Walther
Reviewed-by: Noah Misch
Security: CVE-2024-10976
Backpatch-through: 12
src/backend/executor/functions.c
src/backend/rewrite/rewriteHandler.c
src/test/regress/expected/rowsecurity.out
src/test/regress/sql/rowsecurity.sql
src/tools/pgindent/typedefs.list