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

Merge bitcoin/bitcoin#36337: fuzz: Cover block filter P2P messages

Public commit record

What the developer wrote

Authored by merge-script

96/100 · Strong
Merge bitcoin/bitcoin#36337: fuzz: Cover block filter P2P messages

fab64c032c1a0c997c6ec398cc5578df36b33b7d test: DestroyAllBlockFilterIndexes in ~ChainTestingSetup() (MarcoFalke)
fadc2c93d3dd46344f660c83005cdfe505d21efc fuzz: Cover block filter P2P messages (MarcoFalke)

Pull request description:

The BIP157 P2P messages are not covered by any fuzz targets at all.

Fix this to cover them via the P2P targets.

Should be possible to test by verifying the integer sanitizer is triggered (https://github.com/bitcoin/bitcoin/pull/36321#issuecomment-5810977529):

```
$ echo 'FwAAAAEAAABcX2dldGNmY2hlY2twdAAftOvdD0sFqXEx6US5VIknlsOJqZ5goMwtmwZBPdCxQVxf
AfkGKP39/f0v/Q/9E1AP/f2ybAT1Af39A/399wEAuXEAAAAAAAAAAAB1z3QAbgAAQAHm/f39/f39
/f39/S8/D/0B/f3IAAcBBWNmaf8DAAAA' | base64 --decode > /tmp/msg.bin

$ UBSAN_OPTIONS="suppressions=$(pwd)/test/sanitizer_suppressions/ubsan:print_stacktrace=0:halt_on_error=0:report_error_type=1" FUZZ=process_messages ./bld-cmake/bin/fuzz /tmp/msg.bin

./bld-cmake/bin/fuzz: Running 1 inputs 1 time(s) each.
/src/net_processing.cpp:3662:33: runtime error: unsigned integer overflow: 0 - 1 cannot be represented in type 'size_type' (aka 'unsigned long')
/src/net_processing.cpp:3662:18: runtime error: implicit conversion from type 'size_type' (aka 'unsigned long') of value 18446744073709551615 (64-bit, unsigned) to type 'int' changed the value to -1 (32-bit, signed)

ACKs for top commit:
marcofleon:
re-ACK fab64c032c1a0c997c6ec398cc5578df36b33b7d
Crypt-iQ:
re-ACK fab64c032c1a0c997c6ec398cc5578df36b33b7d

Tree-SHA512: 23275c73a53f53b12ddf4466f9cb28fbab109fadcf1280d17c8fb293091958e957922f1abe979948407395e9e8ee2d4b3bd100571dadc049734bf2b0e3f5c155
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification✓ Links an issue, advisory, or supporting reference✓ Names security-relevant behavior explicitly
The short version

What changed, and why it matters

This commit adds fuzz-test coverage for BIP157 block-filter P2P messages and fixes a test-only cleanup issue. The fuzz target found an unsigned-integer overflow in net_processing.cpp when handling these messages, but the overflow appears to be in a debug/test code path and is not described as a remotely exploitable network vulnerability. The main code change is test infrastructure: initializing a basic block-filter index during fuzz setup and destroying it on teardown to avoid deadlocks.

Recommended action

Treat the UBSan finding as a code-quality/sanitizer issue to be triaged separately; verify whether net_processing.cpp:3662 can be reached in production or only under fuzz-specific state. The current commit is safe to merge as a test-coverage improvement with cleanup, but it does not remediate the reported overflow.

Security signals we found

01

Fuzzer-reported unsigned integer overflow in net_processing.cpp:3662 triggered by BIP157 P2P message handling

02

Test-only change: adds block-filter index initialization and destruction in fuzz/chain testing setup

03

No patch to production P2P parsing logic in this commit

04

Pull request description frames the change as increasing fuzz coverage, not fixing a security bug

Risk score

Why this scored 23/100

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