Skip to content

Fix EVP AES-CFB1 length overflow - #12276

Merged
SparkiDev merged 2 commits into
wolfSSL:masterfrom
ageprocpp:fix/fenrir-18642
Nov 26, 2026
Merged

SparkiDev merged 2 commits into
wolfSSL:masterfrom
ageprocpp:fix/fenrir-18642

Conversation

@ageprocpp

@ageprocpp ageprocpp commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Description

Fixes Fenrir#18642

Reject EVP AES-CFB1 updates of 512 MiB or more before converting the byte length to a 32-bit bit count. Previously, the multiplication could wrap, causing the update to report success and the full output length even though some or all input was not processed. For in-place encryption, the unprocessed portion remained plaintext.

Testing

  • git diff --check passed.
  • Built unit_test with CMake using WOLFSSL_AESCFB=yes and WOLFSSL_OPENSSLEXTRA=yes.
  • unit.test --api -test_evp_cipher_cfb1_length_overflow passed. It checks rejection at 512 MiB and 512 MiB + 1 byte for both encryption and decryption, unchanged output, and unchanged feedback state after rejection.

Checklist

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

Copilot AI balanced review requested due to automatic review settings November 26, 2026 00:02
@ageprocpp ageprocpp self-assigned this Nov 26, 2026

This comment was marked as resolved.

@ageprocpp
ageprocpp marked this pull request as ready for review November 26, 2026 00:08
@github-actions

Copy link
Copy Markdown

retest this please

@github-actions

github-actions Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

MemBrowse Memory Report · Explore what changed →

gcc-arm-cortex-m4-openssl-compat

  • FLASH: .text +64 B (+0.0%, 804,232 B / 1,048,576 B, total: 77% used)

zephyr-frdm_rw612

  • FLASH: datas +16 B, log_const_area -8 B, rodata +108 B, text +13,832 B (+4.9%, 296,412 B / 67,108,864 B, total: 0% used)
  • RAM: bss +49 B, datas +16 B (+0.1%, 58,423 B / 983,040 B, total: 6% used)

No memory changes detected for:


Catch memory regressions in CI with MemBrowse. Free for open source.

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Fenrir Automated Review — PR #12276

Scan targets checked: wolfcrypt-src, wolfcrypt-bugs, wolfssl-bugs
Not reviewed (no scan target covers them): tests/api/test_evp_cipher.h
Coverage: 2 of 2 in-scope changed file(s) opened by the reviewer

Fenrir result: Approved ✅

No new issues found in the changed files.

Advisory only — this automated result does not count as a GitHub approval.

Review tier: Max

@SparkiDev
SparkiDev merged commit 3218e84 into wolfSSL:master Nov 26, 2026
457 of 460 checks passed
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.

5 participants