postgresql/src/backend
Masahiko Sawada 79c7a7e296 Restrict accesses to non-system views and foreign tables during pg_dump.
When pg_dump retrieves the list of database objects and performs the
data dump, there was possibility that objects are replaced with others
of the same name, such as views, and access them. This vulnerability
could result in code execution with superuser privileges during the
pg_dump process.

This issue can arise when dumping data of sequences, foreign
tables (only 13 or later), or tables registered with a WHERE clause in
the extension configuration table.

To address this, pg_dump now utilizes the newly introduced
restrict_nonsystem_relation_kind GUC parameter to restrict the
accesses to non-system views and foreign tables during the dump
process. This new GUC parameter is added to back branches too, but
these changes do not require cluster recreation.

Back-patch to all supported branches.

Reviewed-by: Noah Misch
Security: CVE-2024-7348
Backpatch-through: 12
2024-08-05 06:05:17 -07:00
..
access Revert "Allow parallel workers to cope with a newly-created session user ID." 2024-07-31 20:56:30 -04:00
bootstrap Revert "Skip WAL for new relfilenodes, under wal_level=minimal." 2020-03-22 09:24:13 -07:00
catalog Reset relhassubclass upon attaching table as a partition 2024-07-24 12:38:18 +02:00
commands Revert "Allow parallel workers to cope with a newly-created session user ID." 2024-07-31 20:56:30 -04:00
executor Expand comments and add an assertion in nodeModifyTable.c. 2024-06-27 19:21:13 -07:00
foreign Restrict accesses to non-system views and foreign tables during pg_dump. 2024-08-05 06:05:17 -07:00
jit Fix illegal attribute propagation in LLVM JIT. 2024-04-10 12:15:59 +12:00
lib Fix lock assertions in dshash.c. 2022-07-11 15:51:47 +12:00
libpq libpq: Use strerror_r instead of strerror 2024-07-28 09:26:48 +02:00
main Fix outdated --help message for postgres -f 2022-08-15 13:37:42 +09:00
nodes Further fixes for MULTIEXPR_SUBLINK fix. 2022-09-06 16:38:18 -04:00
optimizer Restrict accesses to non-system views and foreign tables during pg_dump. 2024-08-05 06:05:17 -07:00
parser Avoid unhelpful internal error for incorrect recursive-WITH queries. 2024-07-14 13:49:46 -04:00
partitioning Fix incorrect pruning of NULL partition for boolean IS NOT clauses 2024-02-20 12:51:38 +13:00
po Translation updates 2024-08-05 12:25:03 +02:00
port Close socket in case of errors in setting non-blocking 2024-01-17 11:24:11 +01:00
postmaster Avoid deadlock during orphan temp table removal. 2024-04-02 14:59:04 -04:00
regex Avoid character classification in regex escape parsing. 2023-04-21 08:21:04 -07:00
replication Fix possibility of logical decoding partial transaction changes. 2024-07-11 22:48:08 +09:00
rewrite Restrict accesses to non-system views and foreign tables during pg_dump. 2024-08-05 06:05:17 -07:00
snowball In the Snowball dictionary, don't try to stem excessively-long words. 2022-08-31 10:42:05 -04:00
statistics Fix incorrectly reported stats kind in "can't happen" ERROR 2024-03-05 16:19:26 +13:00
storage Fix lost Windows socket EOF events. 2024-07-13 15:45:28 +12:00
tcop Restrict accesses to non-system views and foreign tables during pg_dump. 2024-08-05 06:05:17 -07:00
tsearch Limit to_tsvector_byid's initial array allocation to something sane. 2023-09-25 11:50:28 -04:00
utils Restrict accesses to non-system views and foreign tables during pg_dump. 2024-08-05 06:05:17 -07:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
common.mk Remove PARTIAL_LINKING build mode. 2018-03-30 17:33:04 -07:00
Makefile Get rid of jsonpath_gram.h and jsonpath_scanner.h 2019-03-20 11:13:34 +03:00
nls.mk Translation updates 2020-08-10 15:21:18 +02:00