BUG #19867: pg_verifybackup accepts out-of-range Timeline in backup manifest
BUG #19867: pg_verifybackup accepts out-of-range Timeline in backup manifest
От:
PG 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.
Re: BUG #19867: pg_verifybackup accepts out-of-range Timeline in backup manifest
От:
Daniel Gustafsson <daniel@yesql.se>
Дата:
> On 11 Nov 2026, at 06:46, PG Bug reporting form 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
Re: BUG #19867: pg_verifybackup accepts out-of-range Timeline in backup manifest
От:
Laurenz Albe <laurenz.albe@cybertec.at>
Дата:
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