Skip to content

Guard against negative length in BIO, I/O callbacks and PKCS12 PBKDF#10208

Draft
ColtonWilley wants to merge 1 commit intowolfSSL:masterfrom
ColtonWilley:bio-io-negative-length-checks
Draft

Guard against negative length in BIO, I/O callbacks and PKCS12 PBKDF#10208
ColtonWilley wants to merge 1 commit intowolfSSL:masterfrom
ColtonWilley:bio-io-negative-length-checks

Conversation

@ColtonWilley
Copy link
Copy Markdown
Contributor

@ColtonWilley ColtonWilley commented Apr 13, 2026

Summary

  • src/bio.c: Guard against BIO self-referential chain (UAF) and negative nread/nwrite lengths in wolfSSL_BIO_nread/wolfSSL_BIO_nwrite
  • src/wolfio.c: Guard against negative sz in EmbedSend and EmbedReceive
  • wolfcrypt/src/pwdbased.c: Add pLen/sLen/totalLen overflow checks in wc_PKCS12_PBKDF_ex

Note

The PKCS12 parse fix for stale ci->dataSz bounds (zd21568) is covered by #10172 — this PR is complementary to that fix.

@ColtonWilley ColtonWilley marked this pull request as draft April 13, 2026 21:58
- src/bio.c: Add BIO self-cycle UAF guard and negative nread/nwrite checks
- src/wolfio.c: Add negative sz guards to EmbedSend/EmbedReceive
- wolfcrypt/src/pwdbased.c: Add pLen/sLen/totalLen overflow checks in
  wc_PKCS12_PBKDF_ex
@ColtonWilley ColtonWilley force-pushed the bio-io-negative-length-checks branch from ac1909e to e868939 Compare April 14, 2026 00:46
@ColtonWilley ColtonWilley changed the title Guard against negative length in BIO and I/O callbacks Guard against negative length in BIO, I/O callbacks and PKCS12 PBKDF Apr 14, 2026
@mattia-moffa mattia-moffa self-assigned this Apr 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.

2 participants