AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Low 43 Bitcoin

Merge bitcoin/bitcoin#35492: wallet: fail dump on incomplete writes

Public commit record

What the developer wrote

Authored by merge-script

81/100 · Strong
Merge bitcoin/bitcoin#35492: wallet: fail dump on incomplete writes

385a001f66ad23b3963d5c0acf960b94359c4e21 wallet: commit dump output before success (Velarde)
bb2a207d08782b93f77c003287d9b6bf4ea17fa1 wallet: fail dump on incomplete writes (Velarde)

Pull request description:

This makes `bitcoin-wallet dump` fail if writing the dump file does not complete successfully.

Previously, `DumpWallet()` only checked whether the dump file could be opened. If later writes or close failed, the tool could still return success and print the private-key warning, leaving a truncated dump file behind.

The change adds write/close checks while dumping wallet records. If writing fails, the partial dump file is removed and `bitcoin-wallet` returns an error.

ACKs for top commit:
maflcko:
review with --function-context --ignore-all-space ACK 385a001f66ad23b3963d5c0acf960b94359c4e21 🍵
pablomartin4btc:
ACK 385a001f66ad23b3963d5c0acf960b94359c4e21

Tree-SHA512: 89c8901ac8f22057ed970427418b339c59313511c40860e2d48f88d49758dc6d300d5861d4d9a54e0b30b2f2070f4adce5544d2e847870ae23a68a738251e654
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference
The short version

What changed, and why it matters

This change fixes a bug in the `bitcoin-wallet dump` command. Previously, if writing the dump file failed partway through (for example, because the disk was full), the tool could still report success and leave behind an incomplete, misleading file. Now the tool checks every write and close operation, reports failure, and deletes the partial file. This is a reliability and data-integrity improvement rather than a remote attack vector.

Recommended action

Treat as a low-severity reliability/data-integrity fix. Backport to maintained branches if wallet dump integrity is considered important. No urgent deployment required for security reasons, but users relying on `bitcoin-wallet dump` for backups benefit from the corrected failure handling.

Security signals we found

01

Incomplete/truncated wallet dump could be mistaken for a complete backup, leading to data loss or incorrect wallet recovery

02

Tool previously returned success despite write failures, violating fail-safe expectations for sensitive key material

03

Patch removes the partial dump file on failure, preventing misleading artifacts

04

New functional test uses RLIMIT_FSIZE to verify failure path and cleanup

Risk score

Why this scored 43/100

Our methodology →
Potential impact 12/30
Exploitability 5/25
Stealth signal 8/15
Affected reach 6/15
Confidence 8/10
Evidence quality 4/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.