BUG #19867: pg_verifybackup accepts out-of-range Timeline in backup manifest

Started by PG Bug reporting form11 days ago3 messagesbugs
Jump to latest
#1PG Bug reporting form
noreply@postgresql.org

The following bug has been logged on the website:

Bug reference: 19867
Logged by: Faye
Email address: imchifan@mail.com
PostgreSQL version: 18.6
Operating system: Linux/amd64
Description:

pg_verifybackup accepts a backup-manifest Timeline value of 4294967297,
which is outside the range of PostgreSQL timeline identifiers, and proceeds
to manifest checksum validation. It should reject the value as out of range
while parsing the manifest because a PostgreSQL timeline identifier cannot
represent it. The reproducer requires a disposable local PostgreSQL instance
that permits pg_basebackup.

How to repeat:

d="backup-test"
pg_basebackup -h /tmp -D "$d" -X none --no-sync
--manifest-checksums=NONE
sed -i '0,/"Timeline": [0-9][0-9]*/s//"Timeline": 4294967297/'
"$d/backup_manifest"
grep -o '"Timeline": [0-9]*' "$d/backup_manifest" | head -1
pg_verifybackup --no-parse-wal "$d"

The recorded output is:

"Timeline": 4294967297
pg_verifybackup: error: manifest checksum mismatch

The checksum error shows that the out-of-range Timeline value passed
manifest parsing and verification continued to checksum validation. No crash
or data corruption was observed. The external numeric value appears to be
narrowed without first validating the destination type's range.

The issue was reproduced on PostgreSQL 20devel, PostgreSQL 18.6, and
PostgreSQL 17.11 on Linux/AMD64. This occurs when pg_verifybackup checks a
backup manifest whose Timeline value exceeds the range of PostgreSQL
timeline identifiers.

#2Daniel Gustafsson
daniel@yesql.se
In reply to: PG Bug reporting form (#1)
Re: BUG #19867: pg_verifybackup accepts out-of-range Timeline in backup manifest

On 11 Nov 2026, at 06:46, PG Bug reporting form <noreply@postgresql.org> wrote:

sed -i '0,/"Timeline": [0-9][0-9]*/s//"Timeline": 4294967297/'

"Timeline": 4294967297
pg_verifybackup: error: manifest checksum mismatch

This seems to have been working as intended no? You corrupted the manifest and
the checksum verification failed due to the corruption. Tightening the parsing
in the absence of issues doesn't strike me as high on the prioritization list
right now.

--
Daniel Gustafsson

#3Laurenz Albe
laurenz.albe@cybertec.at
In reply to: PG Bug reporting form (#1)
Re: BUG #19867: pg_verifybackup accepts out-of-range Timeline in backup manifest

On Wed, 2026-11-11 at 05:46 +0000, PG Bug reporting form wrote:

pg_verifybackup accepts a backup-manifest Timeline value of 4294967297,
which is outside the range of PostgreSQL timeline identifiers, and proceeds
to manifest checksum validation.

Why is that a problem?

Yours,
Laurenz Albe