forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit1aebfbe
committed
Fix security checks for selectivity estimation functions with RLS.
In commite2d4ef8, security checks were added to preventuser-supplied operators from running over data from pg_statisticunless the user has table or column privileges on the table, or theoperator is leakproof. For a table with RLS, however, checking fortable or column privileges is insufficient, since that does notguarantee that the user has permission to view all of the column'sdata.Fix this by also checking for securityQuals on the RTE, and insistingthat the operator be leakproof if there are any. Thus theleakproofness check will only be skipped if there are no securityQualsand the user has table or column privileges on the table -- i.e., onlyif we know that the user has access to all the data in the column.Back-patch to 9.5 where RLS was added.Dean Rasheed, reviewed by Jonathan Katz and Stephen Frost.Security:CVE-2019-101301 parentbd5e8b6 commit1aebfbe
File tree
3 files changed
+56
-6
lines changed- src
- backend/utils/adt
- test/regress
- expected
- sql
3 files changed
+56
-6
lines changedLines changed: 15 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4597 | 4597 |
| |
4598 | 4598 |
| |
4599 | 4599 |
| |
4600 |
| - | |
| 4600 | + | |
| 4601 | + | |
| 4602 | + | |
| 4603 | + | |
4601 | 4604 |
| |
4602 | 4605 |
| |
| 4606 | + | |
4603 | 4607 |
| |
4604 | 4608 |
| |
4605 | 4609 |
| |
| |||
4663 | 4667 |
| |
4664 | 4668 |
| |
4665 | 4669 |
| |
4666 |
| - | |
| 4670 | + | |
| 4671 | + | |
| 4672 | + | |
| 4673 | + | |
| 4674 | + | |
4667 | 4675 |
| |
4668 |
| - | |
4669 |
| - | |
4670 |
| - | |
4671 |
| - | |
| 4676 | + | |
| 4677 | + | |
| 4678 | + | |
| 4679 | + | |
| 4680 | + | |
4672 | 4681 |
| |
4673 | 4682 |
| |
4674 | 4683 |
| |
|
Lines changed: 21 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3937 | 3937 |
| |
3938 | 3938 |
| |
3939 | 3939 |
| |
| 3940 | + | |
| 3941 | + | |
| 3942 | + | |
| 3943 | + | |
| 3944 | + | |
| 3945 | + | |
| 3946 | + | |
| 3947 | + | |
| 3948 | + | |
| 3949 | + | |
| 3950 | + | |
| 3951 | + | |
| 3952 | + | |
| 3953 | + | |
| 3954 | + | |
| 3955 | + | |
| 3956 | + | |
| 3957 | + | |
| 3958 | + | |
| 3959 | + | |
| 3960 | + | |
3940 | 3961 |
| |
3941 | 3962 |
| |
3942 | 3963 |
| |
|
Lines changed: 20 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1790 | 1790 |
| |
1791 | 1791 |
| |
1792 | 1792 |
| |
| 1793 | + | |
| 1794 | + | |
| 1795 | + | |
| 1796 | + | |
| 1797 | + | |
| 1798 | + | |
| 1799 | + | |
| 1800 | + | |
| 1801 | + | |
| 1802 | + | |
| 1803 | + | |
| 1804 | + | |
| 1805 | + | |
| 1806 | + | |
| 1807 | + | |
| 1808 | + | |
| 1809 | + | |
| 1810 | + | |
| 1811 | + | |
| 1812 | + | |
1793 | 1813 |
| |
1794 | 1814 |
| |
1795 | 1815 |
| |
|
0 commit comments
Comments
(0)