postgres.git / summary / log / commit / refs
commit 50f650b91b83a7cf0ee764b6e3ac8faed129e541
Author: Peter Eisentraut <peter@eisentraut.org>
Commit: Noah Misch <noah@leadboat.com>
Date: Mon Nov 09 14:20:59 2026 +0000
First released in: 14.25, 15.20, 16.16, 17.12, 18.7, 19.0
pg_basebackup: Fix use of externally-controlled format string
appendPQExpBuffer() was accidentally used instead of
appendBinaryPQExpBuffer() in pg_basebackup. The former would
interpret the string to be appended as a format string, which could
lead to misbehavior. (The string contents are related to backup
manifest contents. Those do not normally contain any data that could
look like a format placeholders. In order for this to misbehave,
files with unusual names would have to exist in the data directory.)
- The hunk in ReceiveBackupManifestInMemoryChunk() is from commit
0d8c9c1210c, 2020, PG13.
Security: CVE-2026-16240
Backpatch-through: 14
src/bin/pg_basebackup/pg_basebackup.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/bin/pg_basebackup/pg_basebackup.c b/src/bin/pg_basebackup/pg_basebackup.c
index a0734098269..debdf92caf7 100644
--- a/src/bin/pg_basebackup/pg_basebackup.c
+++ b/src/bin/pg_basebackup/pg_basebackup.c
@@ -1802,7 +1802,7 @@ ReceiveBackupManifestInMemoryChunk(size_t r, char *copybuf,
{
PQExpBuffer buf = callback_data;
- appendPQExpBuffer(buf, copybuf, r);
+ appendBinaryPQExpBuffer(buf, copybuf, r);
}
static void
[parent: fe8c2faefb4a]