-
Notifications
You must be signed in to change notification settings - Fork 23
add additional input sanitation to handlers #240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
billphipps
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
Adds missing input sanitization for various request handlers