- Notifications
You must be signed in to change notification settings - Fork28
Commit804b6b6
committed
Fix column-privilege leak in error-message paths
While building error messages to return to the user,BuildIndexValueDescription, ExecBuildSlotValueDescription andri_ReportViolation would happily include the entire key or entire row inthe result returned to the user, even if the user didn't have access toview all of the columns being included.Instead, include only those columns which the user is providing or whichthe user has select rights on. If the user does not have any rightsto view the table or any of the columns involved then no detail isprovided and a NULL value is returned from BuildIndexValueDescriptionand ExecBuildSlotValueDescription. Note that, for key cases, the usermust have access to all of the columns for the key to be shown; apartial key will not be returned.Further, in master only, do not return any data for cases where rowsecurity is enabled on the relation and row security should be appliedfor the user. This required a bit of refactoring and moving of thingsaround related to RLS- note the addition of utils/misc/rls.c.Back-patch all the way, as column-level privileges are now in allsupported versions.This has been assignedCVE-2014-8161, but since the issue and the patchhave already been publicized on pgsql-hackers, there's no point in tryingto hide this commit.1 parentacc2b1e commit804b6b6
File tree
20 files changed
+569
-194
lines changed- src
- backend
- access
- index
- nbtree
- commands
- executor
- rewrite
- utils
- adt
- cache
- misc
- sort
- include
- rewrite
- utils
- test/regress
- expected
- sql
20 files changed
+569
-194
lines changedLines changed: 69 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
25 | 25 |
| |
26 | 26 |
| |
27 | 27 |
| |
| 28 | + | |
28 | 29 |
| |
29 | 30 |
| |
30 | 31 |
| |
| 32 | + | |
31 | 33 |
| |
32 | 34 |
| |
| 35 | + | |
33 | 36 |
| |
34 | 37 |
| |
35 | 38 |
| |
| |||
155 | 158 |
| |
156 | 159 |
| |
157 | 160 |
| |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
158 | 166 |
| |
159 | 167 |
| |
160 | 168 |
| |
| |||
164 | 172 |
| |
165 | 173 |
| |
166 | 174 |
| |
| 175 | + | |
| 176 | + | |
167 | 177 |
| |
168 | 178 |
| |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
169 | 237 |
| |
170 | 238 |
| |
171 | 239 |
| |
172 |
| - | |
173 |
| - | |
| 240 | + | |
174 | 241 |
| |
175 | 242 |
| |
176 | 243 |
| |
|
Lines changed: 7 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
389 | 389 |
| |
390 | 390 |
| |
391 | 391 |
| |
| 392 | + | |
392 | 393 |
| |
393 | 394 |
| |
394 | 395 |
| |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
395 | 400 |
| |
396 | 401 |
| |
397 | 402 |
| |
398 | 403 |
| |
399 |
| - | |
400 |
| - | |
401 |
| - | |
| 404 | + | |
| 405 | + | |
402 | 406 |
| |
403 | 407 |
| |
404 | 408 |
| |
|
Lines changed: 7 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
40 | 40 |
| |
41 | 41 |
| |
42 | 42 |
| |
43 |
| - | |
44 | 43 |
| |
45 | 44 |
| |
46 | 45 |
| |
| |||
49 | 48 |
| |
50 | 49 |
| |
51 | 50 |
| |
| 51 | + | |
52 | 52 |
| |
53 | 53 |
| |
54 | 54 |
| |
| |||
163 | 163 |
| |
164 | 164 |
| |
165 | 165 |
| |
| 166 | + | |
166 | 167 |
| |
167 | 168 |
| |
168 | 169 |
| |
| |||
789 | 790 |
| |
790 | 791 |
| |
791 | 792 |
| |
| 793 | + | |
792 | 794 |
| |
793 | 795 |
| |
794 | 796 |
| |
| |||
811 | 813 |
| |
812 | 814 |
| |
813 | 815 |
| |
814 |
| - | |
815 | 816 |
| |
816 | 817 |
| |
817 | 818 |
| |
| |||
857 | 858 |
| |
858 | 859 |
| |
859 | 860 |
| |
860 |
| - | |
| 861 | + | |
861 | 862 |
| |
862 | 863 |
| |
863 | 864 |
| |
| |||
920 | 921 |
| |
921 | 922 |
| |
922 | 923 |
| |
| 924 | + | |
923 | 925 |
| |
924 | 926 |
| |
925 | 927 |
| |
| |||
928 | 930 |
| |
929 | 931 |
| |
930 | 932 |
| |
| 933 | + | |
931 | 934 |
| |
932 | 935 |
| |
933 | 936 |
| |
| |||
2277 | 2280 |
| |
2278 | 2281 |
| |
2279 | 2282 |
| |
| 2283 | + | |
2280 | 2284 |
| |
2281 | 2285 |
| |
2282 | 2286 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
38 | 38 |
| |
39 | 39 |
| |
40 | 40 |
| |
41 |
| - | |
42 | 41 |
| |
43 | 42 |
| |
44 | 43 |
| |
45 | 44 |
| |
46 | 45 |
| |
| 46 | + | |
47 | 47 |
| |
48 | 48 |
| |
49 | 49 |
| |
| |||
446 | 446 |
| |
447 | 447 |
| |
448 | 448 |
| |
449 |
| - | |
| 449 | + | |
450 | 450 |
| |
451 | 451 |
| |
452 | 452 |
| |
|
Lines changed: 7 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
596 | 596 |
| |
597 | 597 |
| |
598 | 598 |
| |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
599 | 606 |
| |
600 | 607 |
| |
601 | 608 |
| |
|
Lines changed: 6 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
65 | 65 |
| |
66 | 66 |
| |
67 | 67 |
| |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
68 | 74 |
| |
69 | 75 |
| |
70 | 76 |
| |
|
0 commit comments
Comments
(0)