postgresql/src/bin/pg_dump
Masahiko Sawada 66e94448ab 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:33 -07:00
..
po Translation updates 2024-06-24 13:11:27 +02:00
t Reduce number of commands dumpTableSchema emits for binary upgrade. 2024-07-29 11:53:49 -04:00
.gitignore Clean up after pg_dump test runs. 2016-05-06 22:28:01 -04:00
common.c pg_dump: Remove some unused return values. 2024-07-02 11:22:06 -05:00
compress_gzip.c Remove useless unconstify() call 2024-07-25 11:38:05 +02:00
compress_gzip.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
compress_io.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
compress_io.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
compress_lz4.c Make the order of the header file includes consistent 2024-03-13 15:07:00 +01:00
compress_lz4.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
compress_none.c Use printf's %m format instead of strerror(errno) in more places 2024-03-12 10:02:54 +09:00
compress_none.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
compress_zstd.c Make the order of the header file includes consistent 2024-03-13 15:07:00 +01:00
compress_zstd.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
dumputils.c Reintroduce MAINTAIN privilege and pg_maintain predefined role. 2024-03-13 14:49:26 -05:00
dumputils.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
filter.c pg_dump: Fix weird error message composition 2024-06-20 11:36:38 +02:00
filter.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
Makefile Update copyright for 2024 2024-01-03 20:49:05 -05:00
meson.build Update copyright for 2024 2024-01-03 20:49:05 -05:00
nls.mk Add missing source files to nls.mk 2024-06-13 10:17:36 +02:00
parallel.c Rename static function to avoid conflicting names 2024-02-07 22:16:21 +01:00
parallel.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
pg_backup.h Invent --transaction-size option for pg_restore. 2024-04-01 16:46:24 -04:00
pg_backup_archiver.c Count individual SQL commands in pg_restore's --transaction-size mode. 2024-07-29 12:17:24 -04:00
pg_backup_archiver.h Fix dumps of partitioned tables with table AMs 2024-04-22 15:15:36 +09:00
pg_backup_custom.c Rearrange pg_dump's handling of large objects for better efficiency. 2024-04-01 16:25:56 -04:00
pg_backup_db.c Invent --transaction-size option for pg_restore. 2024-04-01 16:46:24 -04:00
pg_backup_db.h Revert "pg_dump: Lock all relations, not just plain tables". 2020-11-06 15:48:04 -05:00
pg_backup_directory.c Rearrange pg_dump's handling of large objects for better efficiency. 2024-04-01 16:25:56 -04:00
pg_backup_null.c Rearrange pg_dump's handling of large objects for better efficiency. 2024-04-01 16:25:56 -04:00
pg_backup_tar.c Rearrange pg_dump's handling of large objects for better efficiency. 2024-04-01 16:25:56 -04:00
pg_backup_tar.h Fix tar files emitted by pg_dump and pg_basebackup to be POSIX conformant. 2012-09-28 15:19:15 -04:00
pg_backup_utils.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
pg_backup_utils.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
pg_dump.c Restrict accesses to non-system views and foreign tables during pg_dump. 2024-08-05 06:05:33 -07:00
pg_dump.h pg_dump: Remove some unused return values. 2024-07-02 11:22:06 -05:00
pg_dump_sort.c Revert indexed and enlargable binary heap implementation. 2024-04-11 17:18:05 +09:00
pg_dumpall.c Harmonize function parameter names for Postgres 17. 2024-06-12 17:01:51 -04:00
pg_restore.c Harmonize function parameter names for Postgres 17. 2024-06-12 17:01:51 -04:00