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

chore(crypto): add checks to noise

Public commit record

What the developer wrote

Authored by M1nd3r

72/100 · Adequate
chore(crypto): add checks to noise

- Check max message size.
- Respect aes-gcm block limits.

[no changelog]
✓ Descriptive subject✓ Names a concrete action or component✓ Uses a recognizable type or scope✓ Provides an explanatory body
The short version

What changed, and why it matters

This commit hardens the Noise protocol code used in Trezor firmware by adding size limits and nonce limits to prevent two cryptographic problems: encrypting or decrypting messages that are too large for the protocol, and reusing the same encryption nonce after the counter wraps around. Reusing a nonce with AES-GCM can destroy the confidentiality of messages and allow attackers to forge fake messages. The patch also wipes sensitive context data more thoroughly when errors occur, reducing the chance that leftover key material could leak.

Recommended action

Treat this as a security hardening fix and include it in the next firmware release. Review all call sites that pass buffers to the Noise functions to ensure they respect the new NOISE_*_MAX_MESSAGE_SIZE and NOISE_*_MAX_PLAINTEXT_SIZE constants. Run the new test_noise_kk1_limits and test_noise_xxpsk3_limits tests in CI.

Security signals we found

01

AES-GCM nonce counter wraparound protection added

02

Maximum Noise message size enforced at runtime

03

Sensitive context zeroization expanded on failure paths

04

Output buffer zeroization guarded against NULL pointers

05

Static assertions added for fixed-size handshake messages

Risk score

Why this scored 59/100

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