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

wire: use MaxProtocolMessageLength as a max size for MsgReject

Public commit record

What the developer wrote

Authored by Calvin Kim

73/100 · Adequate
wire: use MaxProtocolMessageLength as a max size for MsgReject

As we introduced a new MaxProtocolMessageLength, MsgReject max size
should also be lowered to MaxProtocolMessageLength.

If this isn't lowered and if we ever have a MsgReject message that is
bigger than MaxProtocolMessageLength, then the MaxPayloadLength() check
on the message will pass but it won't serialize in functions
WriteMessageWithEncodingN() and WriteV2MessageN() as both of these
functions have a separate check that each message isn't greater than
MaxProtocolMessageLength.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This commit tightens the maximum allowed size of Bitcoin protocol 'reject' messages so it matches the general message-size limit already used elsewhere. Before the fix, a reject message could claim a legal size under one check but then fail to send under a stricter second check, which could cause inconsistent handling between reading and writing network messages.

Recommended action

Treat as a low-to-moderate hardening fix. Review whether any other message types still use MaxMessagePayload where MaxProtocolMessageLength is now expected, and add regression tests covering the boundary between the two limits.

Security signals we found

01

Inconsistent size limits between message validation and serialization

02

Potential denial-of-service vector via oversized reject messages

03

Protocol wire-format hardening

Risk score

Why this scored 47/100

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