Skip to content

Fix UAF in Delete wrappers, harden KDF and LMS signing#10238

Open
JeremiahM37 wants to merge 3 commits intowolfSSL:masterfrom
JeremiahM37:fenrir-issues-4
Open

Fix UAF in Delete wrappers, harden KDF and LMS signing#10238
JeremiahM37 wants to merge 3 commits intowolfSSL:masterfrom
JeremiahM37:fenrir-issues-4

Conversation

@JeremiahM37
Copy link
Copy Markdown
Contributor

Addresses F-2605, F-2606, F-2607, F-2608, F-2609, F-2611, F-2615, F-2616

  • Save heap before calling *_Free in wc_AesDelete, wc_HashDelete, wc_MlKemKey_Delete — prevents UAF if future Free zeroes the struct.
  • Add NULL validation to wc_HKDF_Extract_ex (out, inKey/inKeySz) and to all four SRTP/SRTCP KDF public APIs (idx when kdrIdx >= 0).
  • ForceZero the signature buffer on write_private_key failure in wc_LmsKey_Sign (native and external hash-sigs wrapper) to prevent OTS key reuse after NV rollback; matches existing XMSS pattern.

Added a few unit tests

@JeremiahM37 JeremiahM37 self-assigned this Apr 16, 2026
@github-actions
Copy link
Copy Markdown

MemBrowse Memory Report

No memory changes detected for:

Copy link
Copy Markdown

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

Choose a reason for hiding this comment

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

Fenrir Automated Review — PR #10238

Scan targets checked: wolfcrypt-api_misuse, wolfcrypt-bugs, wolfcrypt-compliance, wolfcrypt-concurrency, wolfcrypt-consttime, wolfcrypt-defaults, wolfcrypt-mutation, wolfcrypt-portability, wolfcrypt-proptest, wolfcrypt-src, wolfcrypt-zeroize

No new issues found in the changed files. ✅

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.

3 participants