forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitcd5f2a3
committed
Reject substituting extension schemas or owners matching ["$'\].
Substituting such values in extension scripts facilitated SQL injectionwhen @extowner@, @extschema@, or @extschema:...@ appeared inside aquoting construct (dollar quoting, '', or ""). No bundled extension wasvulnerable. Vulnerable uses do appear in a documentation example and innon-bundled extensions. Hence, the attack prerequisite was anadministrator having installed files of a vulnerable, trusted,non-bundled extension. Subject to that prerequisite, this enabled anattacker having database-level CREATE privilege to execute arbitrarycode as the bootstrap superuser. By blocking this attack in the coreserver, there's no need to modify individual extensions. Back-patch tov11 (all supported versions).Reported by Micah Gate, Valerie Woolard, Tim Carey-Smith, and ChristophBerg.Security:CVE-2023-394171 parent2bdd7b2 commitcd5f2a3
File tree
7 files changed
+79
-15
lines changed- src
- backend/commands
- test/modules/test_extensions
- expected
- sql
7 files changed
+79
-15
lines changedLines changed: 27 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
996 | 996 |
| |
997 | 997 |
| |
998 | 998 |
| |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
999 | 1009 |
| |
1000 | 1010 |
| |
1001 | 1011 |
| |
| |||
1025 | 1035 |
| |
1026 | 1036 |
| |
1027 | 1037 |
| |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
1028 | 1043 |
| |
1029 | 1044 |
| |
1030 | 1045 |
| |
| |||
1036 | 1051 |
| |
1037 | 1052 |
| |
1038 | 1053 |
| |
| 1054 | + | |
1039 | 1055 |
| |
1040 | 1056 |
| |
1041 | 1057 |
| |
1042 | 1058 |
| |
1043 | 1059 |
| |
1044 | 1060 |
| |
1045 | 1061 |
| |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
1046 | 1067 |
| |
1047 | 1068 |
| |
1048 | 1069 |
| |
| |||
1052 | 1073 |
| |
1053 | 1074 |
| |
1054 | 1075 |
| |
| 1076 | + | |
1055 | 1077 |
| |
1056 | 1078 |
| |
1057 | 1079 |
| |
| |||
1064 | 1086 |
| |
1065 | 1087 |
| |
1066 | 1088 |
| |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
1067 | 1094 |
| |
1068 | 1095 |
| |
1069 | 1096 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
6 | 6 |
| |
7 | 7 |
| |
8 | 8 |
| |
| 9 | + | |
9 | 10 |
| |
10 | 11 |
| |
11 | 12 |
| |
| |||
15 | 16 |
| |
16 | 17 |
| |
17 | 18 |
| |
| 19 | + | |
18 | 20 |
| |
19 | 21 |
| |
20 | 22 |
| |
|
Lines changed: 24 additions & 11 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
| 1 | + | |
1 | 2 |
| |
2 | 3 |
| |
3 | 4 |
| |
| |||
6 | 7 |
| |
7 | 8 |
| |
8 | 9 |
| |
9 |
| - | |
10 |
| - | |
| 10 | + | |
11 | 11 |
| |
12 | 12 |
| |
13 |
| - | |
| 13 | + | |
14 | 14 |
| |
15 | 15 |
| |
16 | 16 |
| |
17 | 17 |
| |
18 | 18 |
| |
19 |
| - | |
20 |
| - | |
21 |
| - | |
22 |
| - | |
23 |
| - | |
24 |
| - | |
25 |
| - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
26 | 26 |
| |
27 | 27 |
| |
28 | 28 |
| |
29 | 29 |
| |
30 | 30 |
| |
31 |
| - | |
| 31 | + | |
32 | 32 |
| |
33 | 33 |
| |
34 | 34 |
| |
35 | 35 |
| |
36 | 36 |
| |
37 | 37 |
| |
| 38 | + | |
38 | 39 |
| |
39 | 40 |
| |
40 | 41 |
| |
| |||
312 | 313 |
| |
313 | 314 |
| |
314 | 315 |
| |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
315 | 323 |
| |
316 | 324 |
| |
317 | 325 |
| |
| |||
358 | 366 |
| |
359 | 367 |
| |
360 | 368 |
| |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
361 | 374 |
| |
362 | 375 |
| |
363 | 376 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
27 | 27 |
| |
28 | 28 |
| |
29 | 29 |
| |
| 30 | + | |
| 31 | + | |
30 | 32 |
| |
31 | 33 |
| |
32 | 34 |
| |
|
Lines changed: 16 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
1 | 3 |
| |
2 | 4 |
| |
3 | 5 |
| |
4 | 6 |
| |
5 |
| - | |
6 |
| - | |
| 7 | + | |
7 | 8 |
| |
8 | 9 |
| |
9 |
| - | |
| 10 | + | |
10 | 11 |
| |
11 | 12 |
| |
12 | 13 |
| |
13 | 14 |
| |
14 | 15 |
| |
15 |
| - | |
| 16 | + | |
| 17 | + | |
16 | 18 |
| |
17 | 19 |
| |
18 | 20 |
| |
| |||
210 | 212 |
| |
211 | 213 |
| |
212 | 214 |
| |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
213 | 222 |
| |
214 | 223 |
| |
215 | 224 |
| |
| |||
245 | 254 |
| |
246 | 255 |
| |
247 | 256 |
| |
| 257 | + | |
| 258 | + | |
| 259 | + | |
248 | 260 |
| |
249 | 261 |
| |
250 | 262 |
| |
|
Lines changed: 5 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + |
Lines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + |
0 commit comments
Comments
(0)