Repository navigation
Fix/f8866 - #11891
Draft
ohki-saito wants to merge 1 commit into
Draft
Fix/f8866#11891ohki-saito wants to merge 1 commit into
ohki-saito wants to merge 1 commit into
Conversation
|
Can one of the admins verify this patch? |
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The targeted guard prevents invalid-length processing, regression tests cover both reported cases, and no blocking issues remain.
No open issues 🎉
What changed in this PR
This PR prevents an out-of-bounds read in wolfSSL_DES_cbc_cksum() by rejecting non-positive input lengths. It also corrects compression API documentation.
Changes:
- Reject zero and negative checksum lengths before processing.
- Add regression tests for lengths
0and-1with valid pointers. - Correct compression error codes, example error checks, and window-format guidance.
| File | Description |
|---|---|
tests/api/test_ossl_cipher.c |
Tests rejection of zero and negative checksum lengths. |
src/ssl_crypto.c |
Adds non-positive length validation to the DES checksum function. |
doc/dox_comments/header_files/compress.h |
Corrects compression API documentation and examples. |
Review effort: Balanced
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.
Description
Fenrir #8866
wolfSSL_DES_cbc_cksum()acceptedlength == 0when all pointer arguments were non-NULL. In that casedataSzstays 0, and copying the last block reads fromtmp + (dataSz - DES_BLOCK_SIZE), which is 8 bytes before the temporary buffer. On allocators that return a non-NULL pointer for a zero-byte allocation, this is an out-of-bounds read that can crash or return an arbitrary checksum. Negative lengths were also not rejected.Changes:
length <= 0as a bad argument and return 0.DES_cbc_cksumwith valid pointers and a length of 0 and -1.Fixes zd#
Testing
Added tests calling
DES_cbc_cksumwith valid pointers and a length of 0 and -1, which must return 0.Checklist