add additional input sanitation to handlers#240
Merged
billphipps merged 3 commits intowolfSSL:mainfrom Nov 11, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds input sanitization to various cryptographic request handlers to prevent buffer overflows and other security issues. The changes validate that request sizes are sufficient before processing and ensure that variable-length fields fit within the provided input buffers.
Key changes:
- Added minimum size validation checks before processing requests across multiple handler functions
- Added validation for variable-length fields to ensure they fit within input buffers
- Added validation for lastBlockLen in SHA224, SHA384, and SHA512 handlers
- Removed unused
(void)inSize;statements that are no longer needed
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| src/wh_server_crypto.c | Added input size validation to RSA, ECC, AES, CMAC, SHA, and HKDF/CMAC-KDF handlers to prevent buffer overflows |
| src/wh_server_cert.c | Added input size validation to certificate addition handler to ensure certificate data fits within request buffer |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds missing input sanitization for various request handlers