Commit 4b98742
committed
Fix column-privilege leak in error-message paths
While building error messages to return to the user,
BuildIndexValueDescription, ExecBuildSlotValueDescription and
ri_ReportViolation would happily include the entire key or entire row in
the result returned to the user, even if the user didn't have access to
view all of the columns being included.
Instead, include only those columns which the user is providing or which
the user has select rights on. If the user does not have any rights
to view the table or any of the columns involved then no detail is
provided and a NULL value is returned from BuildIndexValueDescription
and ExecBuildSlotValueDescription. Note that, for key cases, the user
must have access to all of the columns for the key to be shown; a
partial key will not be returned.
Back-patch all the way, as column-level privileges are now in all
supported versions.
This has been assigned CVE-2014-8161, but since the issue and the patch
have already been publicized on pgsql-hackers, there's no point in trying
to hide this commit.1 parent 78f79b6 commit 4b98742
File tree
10 files changed
+338
-66
lines changed- src
- backend
- access
- index
- nbtree
- commands
- executor
- utils
- adt
- sort
- test/regress
- expected
- sql
10 files changed
+338
-66
lines changed| 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 | | |
33 | 35 | | |
| |||
153 | 155 | | |
154 | 156 | | |
155 | 157 | | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
156 | 163 | | |
157 | 164 | | |
158 | 165 | | |
| |||
162 | 169 | | |
163 | 170 | | |
164 | 171 | | |
| 172 | + | |
| 173 | + | |
165 | 174 | | |
166 | 175 | | |
| 176 | + | |
| 177 | + | |
| 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 | + | |
167 | 224 | | |
168 | 225 | | |
169 | 226 | | |
170 | | - | |
171 | | - | |
| 227 | + | |
172 | 228 | | |
173 | 229 | | |
174 | 230 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
384 | 384 | | |
385 | 385 | | |
386 | 386 | | |
| 387 | + | |
387 | 388 | | |
388 | 389 | | |
389 | 390 | | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
390 | 395 | | |
391 | 396 | | |
392 | 397 | | |
393 | 398 | | |
394 | | - | |
395 | | - | |
396 | | - | |
| 399 | + | |
| 400 | + | |
397 | 401 | | |
398 | 402 | | |
399 | 403 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
| 161 | + | |
161 | 162 | | |
162 | 163 | | |
163 | 164 | | |
| |||
782 | 783 | | |
783 | 784 | | |
784 | 785 | | |
| 786 | + | |
785 | 787 | | |
786 | 788 | | |
787 | 789 | | |
| |||
804 | 806 | | |
805 | 807 | | |
806 | 808 | | |
807 | | - | |
808 | 809 | | |
809 | 810 | | |
810 | 811 | | |
| |||
854 | 855 | | |
855 | 856 | | |
856 | 857 | | |
| 858 | + | |
857 | 859 | | |
858 | 860 | | |
859 | 861 | | |
| |||
862 | 864 | | |
863 | 865 | | |
864 | 866 | | |
| 867 | + | |
865 | 868 | | |
866 | 869 | | |
867 | 870 | | |
| |||
2135 | 2138 | | |
2136 | 2139 | | |
2137 | 2140 | | |
| 2141 | + | |
2138 | 2142 | | |
2139 | 2143 | | |
2140 | 2144 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
67 | 73 | | |
68 | 74 | | |
69 | 75 | | |
| |||
0 commit comments