Commit 04158e7
committed
Avoid repeated table name lookups in createPartitionTable()
Currently, createPartitionTable() opens newly created table using its name.
This approach is prone to privilege escalation attack, because we might end
up opening another table than we just created.
This commit address the issue above by opening newly created table by its
OID. It appears to be tricky to get a relation OID out of ProcessUtility().
We have to extend TableLikeClause with new newRelationOid field, which is
filled within ProcessUtility() to be further accessed by caller.
Security: CVE-2014-0062
Reported-by: Noah Misch
Discussion: https://postgr.es/m/20240808171351.a9.nmisch%40google.com
Reviewed-by: Pavel Borisov, Dmitry Koval1 parent 9bb842f commit 04158e7
File tree
4 files changed
+10
-1
lines changed- src
- backend
- commands
- parser
- tcop
- include/nodes
4 files changed
+10
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20383 | 20383 | | |
20384 | 20384 | | |
20385 | 20385 | | |
| 20386 | + | |
20386 | 20387 | | |
20387 | 20388 | | |
20388 | 20389 | | |
| |||
20406 | 20407 | | |
20407 | 20408 | | |
20408 | 20409 | | |
20409 | | - | |
| 20410 | + | |
20410 | 20411 | | |
20411 | 20412 | | |
20412 | 20413 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4138 | 4138 | | |
4139 | 4139 | | |
4140 | 4140 | | |
| 4141 | + | |
4141 | 4142 | | |
4142 | 4143 | | |
4143 | 4144 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1225 | 1225 | | |
1226 | 1226 | | |
1227 | 1227 | | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
1228 | 1234 | | |
1229 | 1235 | | |
1230 | 1236 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
754 | 754 | | |
755 | 755 | | |
756 | 756 | | |
| 757 | + | |
757 | 758 | | |
758 | 759 | | |
759 | 760 | | |
| |||
0 commit comments