Skip to content

Fenrir Fixes#10675

Open
kareem-wolfssl wants to merge 6 commits into
wolfSSL:masterfrom
kareem-wolfssl:f5393
Open

Fenrir Fixes#10675
kareem-wolfssl wants to merge 6 commits into
wolfSSL:masterfrom
kareem-wolfssl:f5393

Conversation

@kareem-wolfssl

Copy link
Copy Markdown
Contributor

Description

Fixes F-5393, F-4023, F-4228, F-5730, F-4285

Testing

Built in tests

Checklist

  • added tests
  • updated/added doxygen
  • updated appropriate READMEs
  • Updated manual and documentation

@kareem-wolfssl kareem-wolfssl self-assigned this Jun 12, 2026
Copilot AI review requested due to automatic review settings June 12, 2026 20:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 thread wolfcrypt/src/chacha20_poly1305.c Outdated
Comment on lines 78 to 79
ForceZero(aead, sizeof(ChaChaPoly_Aead));
WC_FREE_VAR_EX(aead, NULL, DYNAMIC_TYPE_TMP_BUFFER);
@github-actions

github-actions Bot commented Jun 12, 2026

Copy link
Copy Markdown

MemBrowse Memory Report

gcc-arm-cortex-m3

  • FLASH: .text +24 B (+0.0%, 121,417 B / 262,144 B, total: 46% used)

gcc-arm-cortex-m4-baremetal

  • FLASH: .text +64 B (+0.1%, 66,123 B / 262,144 B, total: 25% used)

gcc-arm-cortex-m4-crypto-only

  • FLASH: .text +64 B (+0.0%, 173,742 B / 262,144 B, total: 66% used)

gcc-arm-cortex-m4-pq

  • FLASH: .text +64 B (+0.0%, 277,944 B / 1,048,576 B, total: 27% used)

gcc-arm-cortex-m4-tls12

  • FLASH: .text +64 B (+0.1%, 122,189 B / 262,144 B, total: 47% used)

gcc-arm-cortex-m4-tls13

  • FLASH: .text +64 B (+0.0%, 234,754 B / 262,144 B, total: 90% used)

gcc-arm-cortex-m7-pq

Comment thread src/wolfio.c
/* 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)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't use a magic number here. If a macro is not already available then please add one.

Comment thread src/ssl.c
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) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use wolfSSL's macro WOLFSSL_MAX_32BIT for INT_MAX. I've seen port issues when using INT_MAX.

@JacobBarthelmeh JacobBarthelmeh removed the For This Release Release version 5.9.2 label Jun 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants