Backport 3.6: Fix off-by-one over-read in TLS 1.2 ClientHello and CertificateRequest - #10928
Open
nvxbug wants to merge 3 commits into
Open
Backport 3.6: Fix off-by-one over-read in TLS 1.2 ClientHello and CertificateRequest#10928nvxbug wants to merge 3 commits into
nvxbug wants to merge 3 commits into
Conversation
Signed-off-by: Naveed <naveed@bugqore.com>
ClientHello: narrow the session-id check to the session id itself, check the cookie length byte before reading it, and let the ciphersuite-list length check cover both transports. CertificateRequest: make the signature-algorithms check also reserve the two certificate-authorities length bytes instead of adding a separate check, use the available < needed pattern throughout, and reject an odd-length signature-algorithms list. Add injected truncated-ClientHello test cases (TLS 1.2-only builds). Signed-off-by: Naveed <naveed@bugqore.com>
Signed-off-by: Naveed <naveed@bugqore.com>
This was referenced Aug 24, 2026
bjwtaylor
approved these changes
Aug 25, 2026
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
Backport of #10833 to mbedtls-3.6.
The TLS 1.2 ClientHello and CertificateRequest parsers read a two-byte length field (ciphersuite list on the server side, certificate authorities on the client side) that the preceding length checks did not fully reserve, so a message truncated inside that field was read one byte past its end. The checks now use the
available < neededpattern, each field is checked before it is read, and an odd-length signature-algorithms list is rejected.Both commits cherry-picked from development; only the new test entries'
depends_onlines needed converting to the 3.6 macro names. The injected truncated-ClientHello tests pass in a TLS 1.2-only build (test_suite_ssl.tls-defrag 30/30).PR checklist