Fenrir Fixes#10675
Open
kareem-wolfssl wants to merge 6 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR applies a set of security/correctness fixes across cryptographic routines and URL/buffer handling to address multiple Fenrir issues (F-5393, F-4023, F-4228, F-5730, F-4285).
Changes:
- Zeroizes sensitive temporary crypto state / output buffers on error paths (ChaCha20-Poly1305 AEAD context, AES-GCM plaintext on failure).
- Tightens URL parsing validation (IPv6 literal termination, port length/range checks).
- Fixes size/copy handling in
WOLFSSL_BUF_MEM_*growth/resize to avoid truncation and over-reads.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| wolfcrypt/src/chacha20_poly1305.c | Zeroize AEAD working state before freeing temporary buffer. |
| wolfcrypt/src/aes.c | Zero plaintext output on AES-GCM decrypt failure. |
| src/wolfio.c | Reject malformed bracketed IPv6 literals and malformed/out-of-range ports. |
| src/ssl.c | Prevent size_t→int truncation and fix potential over-read in buffer growth under WOLFSSL_NO_REALLOC. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
78
to
79
| ForceZero(aead, sizeof(ChaChaPoly_Aead)); | ||
| WC_FREE_VAR_EX(aead, NULL, DYNAMIC_TYPE_TMP_BUFFER); |
|
Fixes F-5393.
…ng it. Fixes F-4023.
Fixes F-4228.
…M_resize. Also fix a potential overread in wolfSSL_BUF_MEM_grow_ex for the non-realloc case. Fixes F-5730
Fixes F-4285.
JacobBarthelmeh
requested changes
Jun 15, 2026
| /* Reject out-of-range ports rather than silently truncating to | ||
| * word16, which would otherwise wrap (e.g. 65536 -> 0) and | ||
| * connect to an unintended port. */ | ||
| if (bigPort > 65535) |
Contributor
There was a problem hiding this comment.
Don't use a magic number here. If a macro is not already available then please add one.
| if (buf == NULL || len == 0 || (int)len <= 0) { | ||
| /* verify provided arguments. The return value is an int, so reject any | ||
| * len that cannot be represented as a positive int. */ | ||
| if (buf == NULL || len == 0 || len > (size_t)INT_MAX) { |
Contributor
There was a problem hiding this comment.
Use wolfSSL's macro WOLFSSL_MAX_32BIT for INT_MAX. I've seen port issues when using INT_MAX.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes F-5393, F-4023, F-4228, F-5730, F-4285
Testing
Built in tests
Checklist