pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Noah Misch <noah@leadboat.com>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: pg_basebackup: Fix use of externally-controlled format string
Date: Mon, 09 Nov 2026 14:22:01 +0000
Message-ID: <E1xQQG1-000000003jq-3iUI@gemulon.postgresql.org> (raw)

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.  This is only reachable against a pre-PG15
  server, because of the next item.

- The hunk in ReceiveArchiveStreamChunk() is from commit cc333f32336,
  2022, PG15.

Security: CVE-2026-16240
Backpatch-through: 14

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/04986ad59d6167d3ed884a2045b99fca8a9733a8
Author: Peter Eisentraut <peter@eisentraut.org>

Modified Files
--------------
src/bin/pg_basebackup/pg_basebackup.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)



view thread (4+ messages)

Message-ID: <E1xQQG1-000000003jq-3iUI@gemulon.postgresql.org>
Permalink:  ../E1xQQG1-000000003jq-3iUI@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1xQQG1-000000003jq-3iUI@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: noah@leadboat.com
  Subject: Re: pgsql: pg_basebackup: Fix use of externally-controlled format string
  In-Reply-To: <E1xQQG1-000000003jq-3iUI@gemulon.postgresql.org>
  References: <E1xQQG1-000000003jq-3iUI@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox