forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit66e9444
committed
Restrict accesses to non-system views and foreign tables during pg_dump.
When pg_dump retrieves the list of database objects and performs thedata dump, there was possibility that objects are replaced with othersof the same name, such as views, and access them. This vulnerabilitycould result in code execution with superuser privileges during thepg_dump process.This issue can arise when dumping data of sequences, foreigntables (only 13 or later), or tables registered with a WHERE clause inthe extension configuration table.To address this, pg_dump now utilizes the newly introducedrestrict_nonsystem_relation_kind GUC parameter to restrict theaccesses to non-system views and foreign tables during the dumpprocess. This new GUC parameter is added to back branches too, butthese changes do not require cluster recreation.Back-patch to all supported branches.Reviewed-by: Noah MischSecurity:CVE-2024-7348Backpatch-through: 121 parentca6fde9 commit66e9444
File tree
15 files changed
+255
-1
lines changed- contrib/postgres_fdw
- expected
- sql
- doc/src/sgml
- ref
- src
- backend
- foreign
- optimizer
- plan
- util
- rewrite
- tcop
- utils/misc
- bin/pg_dump
- include
- tcop
- utils
- test/regress
- expected
- sql
15 files changed
+255
-1
lines changedLines changed: 11 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
637 | 637 |
| |
638 | 638 |
| |
639 | 639 |
| |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
640 | 651 |
| |
641 | 652 |
| |
642 | 653 |
| |
|
Lines changed: 8 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
327 | 327 |
| |
328 | 328 |
| |
329 | 329 |
| |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
330 | 338 |
| |
331 | 339 |
| |
332 | 340 |
| |
|
Lines changed: 17 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
9813 | 9813 |
| |
9814 | 9814 |
| |
9815 | 9815 |
| |
| 9816 | + | |
| 9817 | + | |
| 9818 | + | |
| 9819 | + | |
| 9820 | + | |
| 9821 | + | |
| 9822 | + | |
| 9823 | + | |
| 9824 | + | |
| 9825 | + | |
| 9826 | + | |
| 9827 | + | |
| 9828 | + | |
| 9829 | + | |
| 9830 | + | |
| 9831 | + | |
| 9832 | + | |
9816 | 9833 |
| |
9817 | 9834 |
| |
9818 | 9835 |
| |
|
Lines changed: 8 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1001 | 1001 |
| |
1002 | 1002 |
| |
1003 | 1003 |
| |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
1004 | 1012 |
| |
1005 | 1013 |
| |
1006 | 1014 |
| |
|
Lines changed: 10 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
22 | 22 |
| |
23 | 23 |
| |
24 | 24 |
| |
| 25 | + | |
25 | 26 |
| |
26 | 27 |
| |
27 | 28 |
| |
| |||
326 | 327 |
| |
327 | 328 |
| |
328 | 329 |
| |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
329 | 339 |
| |
330 | 340 |
| |
331 | 341 |
| |
|
Lines changed: 13 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
41 | 41 |
| |
42 | 42 |
| |
43 | 43 |
| |
| 44 | + | |
44 | 45 |
| |
45 | 46 |
| |
46 | 47 |
| |
| |||
7136 | 7137 |
| |
7137 | 7138 |
| |
7138 | 7139 |
| |
| 7140 | + | |
| 7141 | + | |
| 7142 | + | |
| 7143 | + | |
| 7144 | + | |
| 7145 | + | |
| 7146 | + | |
| 7147 | + | |
| 7148 | + | |
| 7149 | + | |
| 7150 | + | |
7139 | 7151 |
| |
| 7152 | + | |
7140 | 7153 |
| |
7141 | 7154 |
| |
7142 | 7155 |
| |
|
Lines changed: 12 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
45 | 45 |
| |
46 | 46 |
| |
47 | 47 |
| |
| 48 | + | |
48 | 49 |
| |
49 | 50 |
| |
50 | 51 |
| |
| |||
528 | 529 |
| |
529 | 530 |
| |
530 | 531 |
| |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
531 | 543 |
| |
532 | 544 |
| |
533 | 545 |
| |
|
Lines changed: 17 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
40 | 40 |
| |
41 | 41 |
| |
42 | 42 |
| |
| 43 | + | |
43 | 44 |
| |
44 | 45 |
| |
45 | 46 |
| |
| |||
1729 | 1730 |
| |
1730 | 1731 |
| |
1731 | 1732 |
| |
| 1733 | + | |
| 1734 | + | |
| 1735 | + | |
| 1736 | + | |
| 1737 | + | |
| 1738 | + | |
| 1739 | + | |
| 1740 | + | |
1732 | 1741 |
| |
1733 | 1742 |
| |
1734 | 1743 |
| |
| |||
3212 | 3221 |
| |
3213 | 3222 |
| |
3214 | 3223 |
| |
| 3224 | + | |
| 3225 | + | |
| 3226 | + | |
| 3227 | + | |
| 3228 | + | |
| 3229 | + | |
| 3230 | + | |
| 3231 | + | |
3215 | 3232 |
| |
3216 | 3233 |
| |
3217 | 3234 |
| |
|
Lines changed: 64 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
79 | 79 |
| |
80 | 80 |
| |
81 | 81 |
| |
| 82 | + | |
82 | 83 |
| |
83 | 84 |
| |
84 | 85 |
| |
| |||
103 | 104 |
| |
104 | 105 |
| |
105 | 106 |
| |
| 107 | + | |
| 108 | + | |
| 109 | + | |
106 | 110 |
| |
107 | 111 |
| |
108 | 112 |
| |
| |||
3673 | 3677 |
| |
3674 | 3678 |
| |
3675 | 3679 |
| |
| 3680 | + | |
| 3681 | + | |
| 3682 | + | |
| 3683 | + | |
| 3684 | + | |
| 3685 | + | |
| 3686 | + | |
| 3687 | + | |
| 3688 | + | |
| 3689 | + | |
| 3690 | + | |
| 3691 | + | |
| 3692 | + | |
| 3693 | + | |
| 3694 | + | |
| 3695 | + | |
| 3696 | + | |
| 3697 | + | |
| 3698 | + | |
| 3699 | + | |
| 3700 | + | |
| 3701 | + | |
| 3702 | + | |
| 3703 | + | |
| 3704 | + | |
| 3705 | + | |
| 3706 | + | |
| 3707 | + | |
| 3708 | + | |
| 3709 | + | |
| 3710 | + | |
| 3711 | + | |
| 3712 | + | |
| 3713 | + | |
| 3714 | + | |
| 3715 | + | |
| 3716 | + | |
| 3717 | + | |
| 3718 | + | |
| 3719 | + | |
| 3720 | + | |
| 3721 | + | |
| 3722 | + | |
| 3723 | + | |
| 3724 | + | |
| 3725 | + | |
| 3726 | + | |
| 3727 | + | |
| 3728 | + | |
| 3729 | + | |
| 3730 | + | |
| 3731 | + | |
| 3732 | + | |
| 3733 | + | |
| 3734 | + | |
| 3735 | + | |
| 3736 | + | |
| 3737 | + | |
| 3738 | + | |
| 3739 | + | |
3676 | 3740 |
| |
3677 | 3741 |
| |
3678 | 3742 |
| |
|
Lines changed: 12 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
576 | 576 |
| |
577 | 577 |
| |
578 | 578 |
| |
| 579 | + | |
579 | 580 |
| |
580 | 581 |
| |
581 | 582 |
| |
| |||
4768 | 4769 |
| |
4769 | 4770 |
| |
4770 | 4771 |
| |
| 4772 | + | |
| 4773 | + | |
| 4774 | + | |
| 4775 | + | |
| 4776 | + | |
| 4777 | + | |
| 4778 | + | |
| 4779 | + | |
| 4780 | + | |
| 4781 | + | |
| 4782 | + | |
4771 | 4783 |
| |
4772 | 4784 |
| |
4773 | 4785 |
| |
|
Lines changed: 47 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
390 | 390 |
| |
391 | 391 |
| |
392 | 392 |
| |
| 393 | + | |
393 | 394 |
| |
394 | 395 |
| |
395 | 396 |
| |
| |||
1354 | 1355 |
| |
1355 | 1356 |
| |
1356 | 1357 |
| |
| 1358 | + | |
| 1359 | + | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
1357 | 1365 |
| |
1358 | 1366 |
| |
1359 | 1367 |
| |
| |||
2222 | 2230 |
| |
2223 | 2231 |
| |
2224 | 2232 |
| |
| 2233 | + | |
| 2234 | + | |
| 2235 | + | |
| 2236 | + | |
2225 | 2237 |
| |
2226 | 2238 |
| |
2227 | 2239 |
| |
| |||
2333 | 2345 |
| |
2334 | 2346 |
| |
2335 | 2347 |
| |
| 2348 | + | |
| 2349 | + | |
| 2350 | + | |
| 2351 | + | |
| 2352 | + | |
2336 | 2353 |
| |
2337 | 2354 |
| |
2338 | 2355 |
| |
| |||
2359 | 2376 |
| |
2360 | 2377 |
| |
2361 | 2378 |
| |
| 2379 | + | |
| 2380 | + | |
| 2381 | + | |
| 2382 | + | |
2362 | 2383 |
| |
2363 | 2384 |
| |
2364 | 2385 |
| |
| |||
2598 | 2619 |
| |
2599 | 2620 |
| |
2600 | 2621 |
| |
| 2622 | + | |
| 2623 | + | |
| 2624 | + | |
| 2625 | + | |
2601 | 2626 |
| |
2602 | 2627 |
| |
2603 | 2628 |
| |
| |||
4771 | 4796 |
| |
4772 | 4797 |
| |
4773 | 4798 |
| |
| 4799 | + | |
| 4800 | + | |
| 4801 | + | |
| 4802 | + | |
| 4803 | + | |
| 4804 | + | |
| 4805 | + | |
| 4806 | + | |
| 4807 | + | |
| 4808 | + | |
| 4809 | + | |
| 4810 | + | |
| 4811 | + | |
| 4812 | + | |
| 4813 | + | |
| 4814 | + | |
| 4815 | + | |
| 4816 | + | |
| 4817 | + | |
| 4818 | + | |
| 4819 | + | |
| 4820 | + | |
4774 | 4821 |
| |
4775 | 4822 |
| |
4776 | 4823 |
| |
|
0 commit comments
Comments
(0)