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

Merge bitcoin/bitcoin#36397: scripted-diff: [wallet] Remove trailing newlines from one-line log messages

Public commit record

What the developer wrote

Authored by merge-script

91/100 · Strong
Merge bitcoin/bitcoin#36397: scripted-diff: [wallet] Remove trailing newlines from one-line log messages

fa0c552cc5abdd0a7e7f2c9cfc1491240494f352 wallet: Reject trailing newline in format strings (MarcoFalke)
fada75ccb05575e01c18bd4b6b28d41a3c2cd87c util: Add option to reject trailing newline in format strings (MarcoFalke)
fa57d5244b3cdc151e01d7dd02a5e363bf801bcb scripted-diff: [wallet] Remove trailing newlines from one-line log messages (MarcoFalke)
fa6c7942ad8e159f240194d2d290e9d64812761a wallet: Remove inconsistent and redundant trailing error newlines (MarcoFalke)
fa89aeec855b774e8ef37b31ac2b6b83c1d263e8 test: [move-only] Move test_LogEscapeMessage to logging tests (MarcoFalke)

Pull request description:

This is a low-prio style cleanup for years, but:

* It is tedious and possibly distracting to do it manually when touching the line for other reasons.
* The topic recently came up again when discussing log injection (https://github.com/bitcoin/bitcoin/pull/35833#issuecomment-5113804332)

So I wonder if a simple scripted-diff can cover the bulk of the changes now, with hopefully little conflicts with reviewed pull requests.

(Removing the trailing newlines from the remaining log messages is trivial and can be done in a later pull)

ACKs for top commit:
l0rinc:
ACK fa0c552cc5abdd0a7e7f2c9cfc1491240494f352
sedited:
ACK fa0c552cc5abdd0a7e7f2c9cfc1491240494f352

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

What changed, and why it matters

This is a code-cleanup change for Bitcoin Core's wallet logging. It removes manual newline characters from the end of one-line log messages and adds a compile-time check that prevents wallet log format strings from ending in a newline. The change is defensive: it reduces the chance that a future log message could accidentally inject fake log lines or confuse log parsing, but it does not by itself fix an active security bug.

Recommended action

No urgent action required. Treat as a defensive hardening and style cleanup. Reviewers of future wallet logging changes should ensure format strings do not end with newlines, which is now enforced at compile time.

Security signals we found

01

Compile-time rejection of trailing newlines in wallet log format strings

02

Mass removal of trailing newlines from wallet log messages

03

Reference in PR description to log-injection discussion

04

Existing LogEscapeMessage already escapes control characters including newlines in log output

Risk score

Why this scored 19/100

Our methodology →
Potential impact 2/30
Exploitability 1/25
Stealth signal 1/15
Affected reach 2/15
Confidence 9/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.