Skip to content

Add sz check to ChachaAEADDecrypt to prevent potential underflow.#10125

Merged
douzzer merged 1 commit intowolfSSL:masterfrom
kareem-wolfssl:zd21521
Apr 6, 2026
Merged

Add sz check to ChachaAEADDecrypt to prevent potential underflow.#10125
douzzer merged 1 commit intowolfSSL:masterfrom
kareem-wolfssl:zd21521

Conversation

@kareem-wolfssl
Copy link
Copy Markdown
Contributor

Description

Fixes zd#21521

Thanks to Zou Dikai for the report.

Testing

Built in tests

Checklist

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

@kareem-wolfssl kareem-wolfssl self-assigned this Apr 2, 2026
Copilot AI review requested due to automatic review settings April 2, 2026 23:44
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds an input-size guard in ChachaAEADDecrypt to prevent sz - aead_mac_size from underflowing when the ciphertext is shorter than the authentication tag, addressing zd#21521.

Changes:

  • Initialize msgLen defensively before computing it.
  • Add an early-return check for sz < ssl->specs.aead_mac_size to avoid underflow.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@kareem-wolfssl kareem-wolfssl added the For This Release Release version 5.9.1 label Apr 3, 2026
@douzzer douzzer added the Staged Staged for merge pending final test results and review label Apr 6, 2026
@douzzer douzzer merged commit 4924402 into wolfSSL:master Apr 6, 2026
654 of 655 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

For This Release Release version 5.9.1 Staged Staged for merge pending final test results and review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants