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

p2p: Error on invalid FeeRate in FeeFilter decode

Public commit record

What the developer wrote

Authored by Mitchell Bagot

68/100 · Adequate
p2p: Error on invalid FeeRate in FeeFilter decode

The FeeFilterDecoder currently saturates invalid fee rate values (those
outside 0..=u32::MAX) to FeeRate::MAX. This prevents the type from
round-tripping and causes problems with checksum calculations in the
V1NetworkMessage. Instead, invalid fee rates should fail to decode and
the range of valid fee rates should be changed to 0..Amount::MAX_MONEY,
as it is in Core.
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This commit fixes how the rust-bitcoin library handles malformed 'fee filter' messages from the Bitcoin peer-to-peer network. Previously, out-of-range fee values were silently clamped to the maximum allowed rate, which could make messages fail to 'round-trip' (encode back to the same bytes) and could subtly corrupt checksum calculations. Now those invalid values cause a clear decoding error instead, matching the behavior of Bitcoin Core.

Recommended action

Review downstream handling of FeeFilterDecoderError::InvalidFeeRate to ensure V1NetworkMessage consumers ignore the message as documented, and verify no other decoders silently saturate invalid numeric inputs.

Security signals we found

01

silent saturation of invalid input replaced with explicit decode error

02

range validation aligned with upstream Bitcoin Core reference

03

round-trip / checksum integrity issue in network message serialization addressed

04

new error variant is non_exhaustive and documented as ignorable at V1NetworkMessage level

Risk score

Why this scored 44/100

Our methodology →
Potential impact 12/30
Exploitability 8/25
Stealth signal 6/15
Affected reach 7/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.