Skip to content

Fix UAF in callback wrapper and add input validation guards#10215

Draft
ColtonWilley wants to merge 1 commit intowolfSSL:masterfrom
ColtonWilley:fix-overflow-uaf-and-input-guards
Draft

Fix UAF in callback wrapper and add input validation guards#10215
ColtonWilley wants to merge 1 commit intowolfSSL:masterfrom
ColtonWilley:fix-overflow-uaf-and-input-guards

Conversation

@ColtonWilley
Copy link
Copy Markdown
Contributor

Summary

  • Fix use-after-free in wolfSSL_ex_wrapper() where HandShakeCallBack could free the ssl session via info->ssl, then the wrapper would write to freed memory (ssl->hsInfoOn = 0)
  • Reject INVALID_DEVID in wc_CryptoCb_RegisterDevice() — sentinel value should not consume a callback slot
  • Reject listSz == 0 in wolfSSL_SetStaticMemory() — zero buckets causes incorrect size calculations downstream
  • Fix ECDSA signature parsing in PKCS#11: reject len == 0 INTEGER components (prevents len-- underflow into massive memcpy) and validate ECC OID length (prevents overread on short/oversized token responses)

Status

Early PR — fixes only, regression tests still need to be written. Each fix is traceable to a public-API PoC confirmed under ASan.

Test plan

  • Existing test suite passes
  • Add testing

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.

1 participant