cloudflare / cloudflare/boringtun

Missing check for message limits

Open
#64 0 comments 0 reactions 0 assignees View on GitHub
code quality security review
Dominant language
Rust
Stars
7.2k
Forks
532
PR merge metrics
No merged PRs in 30d

Description

A performance issue with message counters in #54 was closed via #59. However an explicit check for large message counters is still missing. To reiterate from #54:

> The protocol defines the following message limits:
> * Rekey-After-Messages 2^64 * 2^16 - 1
> * Reject-After-Messages 2^64 − 2^4 − 1
>
> Although unlikely in practice, the implementation must check that these message limits are not reached and avoid a counter wraparound. The implementation of ReceivingKeyCounterValidator in src/noise/session.rs must be updated to check this.

Note that it is practically very, very unlikely to reach these limits. However, it is possible for a malicious implementation to send packets with arbitrary high counter values. It would simplify code analysis if integer overflows can be ruled out by an explicit check.

Contributor guide

Open the contributing guide

Research direction

Start in src/noise/session.rs by reading ReceivingKeyCounterValidator and tracing how incoming message counter values are validated. Check the protocol boundary values from the issue, then confirm that counters at or beyond the limits are rejected and cannot wrap around.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
networking, security
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.