Commit ca73753
committed
Handle RLS dependencies in inlined set-returning functions properly.
If an SRF in the FROM clause references a table having row-level
security policies, and we inline that SRF into the calling query,
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.
Our thanks to Wolfgang Walther for reporting this problem.
Stephen Frost and Tom Lane
Security: CVE-2023-24551 parent 681d9e4 commit ca73753
File tree
3 files changed
+54
-0
lines changed- src
- backend/optimizer/util
- test/regress
- expected
- sql
3 files changed
+54
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5205 | 5205 | | |
5206 | 5206 | | |
5207 | 5207 | | |
| 5208 | + | |
| 5209 | + | |
| 5210 | + | |
| 5211 | + | |
| 5212 | + | |
| 5213 | + | |
| 5214 | + | |
5208 | 5215 | | |
5209 | 5216 | | |
5210 | 5217 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4427 | 4427 | | |
4428 | 4428 | | |
4429 | 4429 | | |
| 4430 | + | |
| 4431 | + | |
| 4432 | + | |
| 4433 | + | |
| 4434 | + | |
| 4435 | + | |
| 4436 | + | |
| 4437 | + | |
| 4438 | + | |
| 4439 | + | |
| 4440 | + | |
| 4441 | + | |
| 4442 | + | |
| 4443 | + | |
| 4444 | + | |
| 4445 | + | |
| 4446 | + | |
| 4447 | + | |
| 4448 | + | |
| 4449 | + | |
| 4450 | + | |
| 4451 | + | |
| 4452 | + | |
| 4453 | + | |
| 4454 | + | |
| 4455 | + | |
| 4456 | + | |
4430 | 4457 | | |
4431 | 4458 | | |
4432 | 4459 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2127 | 2127 | | |
2128 | 2128 | | |
2129 | 2129 | | |
| 2130 | + | |
| 2131 | + | |
| 2132 | + | |
| 2133 | + | |
| 2134 | + | |
| 2135 | + | |
| 2136 | + | |
| 2137 | + | |
| 2138 | + | |
| 2139 | + | |
| 2140 | + | |
| 2141 | + | |
| 2142 | + | |
| 2143 | + | |
| 2144 | + | |
| 2145 | + | |
| 2146 | + | |
| 2147 | + | |
| 2148 | + | |
| 2149 | + | |
2130 | 2150 | | |
2131 | 2151 | | |
2132 | 2152 | | |
| |||
0 commit comments