Hardening in TLSX_KeyShare_ProcessPqcHybridClient#10327
Open
embhorn wants to merge 1 commit intowolfSSL:masterfrom
Open
Hardening in TLSX_KeyShare_ProcessPqcHybridClient#10327embhorn wants to merge 1 commit intowolfSSL:masterfrom
embhorn wants to merge 1 commit intowolfSSL:masterfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Hardens TLS 1.3 PQC-hybrid KeyShare client processing to avoid a double-free / UAF when the ECDH portion of a hybrid key share is malformed, and adds a regression test to cover the failure mode described in zd21704.
Changes:
- Clear
keyShareEntry->keyafter non-async/non-pending hybrid ECDH processing to prevent cleanup code from freeing an already-freed key pointer. - Add
test_tls13_pqc_hybrid_malformed_ecdhto exercise the malformed-ECDH-but-correctly-sized hybridkey_sharepath. - Register the new test in the TLS 1.3 API test list.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/tls.c |
Clears keyShareEntry->key on non-pending return from inner ECDH processing to prevent double-free/UAF during later cleanup. |
tests/api/test_tls13.c |
Adds a crafted ServerHello test case with a malformed X9.63 ECC point inside a correctly-sized PQC-hybrid key_share. |
tests/api/test_tls13.h |
Declares and registers the new TLS 1.3 PQC-hybrid malformed-ECDH test. |
💡 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 #10327
Scan targets checked: wolfssl-bugs, wolfssl-src
Findings: 1
1 finding(s) posted as inline comments (see file-level comments below)
This review was generated automatically by Fenrir. Findings are non-blocking.
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
Set pointer to NULL to prevent double free with a malformed ECDH key.
Fixes zd21704
Testing
Added
test_tls13_pqc_hybrid_malformed_ecdhChecklist