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

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: imchifan(at)mail(dot)com
Subject: BUG #19867: pg_verifybackup accepts out-of-range Timeline in backup manifest
Date: 2026-11-11 05:46:08
Message-ID: 19867-e274a8f5cd6d63f8@postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 19867
Logged by: Faye
Email address: imchifan(at)mail(dot)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.

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2026-11-11 05:48:24 BUG #19868: pg_resetwal prints uint32 WAL segment size as -1 bytes
Previous Message PG Bug reporting form 2026-11-11 05:39:16 BUG #19866: acldefault() emits invalid UTF-8 for a high-bit "char" value