cloudflare / cloudflare/boringtun
Missing check for message limits
- 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
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