Bound CKS extension allocation in TLSX_CKS_Parse#10953
Open
embhorn wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR mitigates a potential denial-of-service issue in the TLS 1.3 CKS (Certificate Key Selection) extension parser by preventing attacker-controlled extension lengths from driving unbounded heap allocations.
Changes:
- Introduces
WOLFSSL_MAX_CKS_SIGSPEC_SZto define a semantic maximum size for the CKS signature specifier list. - Adds an explicit upper-bound check in
TLSX_CKS_Parse()to reject oversized lists before allocation. - Adds an API test to validate rejection/acceptance behavior at boundary conditions and exposes
TLSX_CKS_Parsefor test visibility.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
wolfssl/ssl.h |
Adds a max-size constant for CKS signature specifier lists. |
wolfssl/internal.h |
Makes TLSX_CKS_Parse test-visible for API tests. |
src/tls.c |
Enforces a maximum CKS list length to bound heap allocation. |
tests/api/test_ssl_ext.h |
Registers the new CKS parser test. |
tests/api/test_ssl_ext.c |
Adds coverage for CKS parsing length/value validation and regression behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #10953
Scan targets checked: wolfcrypt-rs-bugs, wolfssl-bugs, wolfssl-src
No new issues found in the changed files. ✅
Member
Author
|
retest this please |
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
The TLS 1.3 CKS (Certificate Key Selection) extension parser allocated a heap buffer sized directly from the attacker-controlled extension length, with no upper bound other than the word16 type limit.
Fixes zd22167
Testing
`test_wolfSSL_dual_alg_cks_parse_ext
Checklist