Skip to content

Fix a couple of issues in DTLS ClientHello parsing. - #11007

Merged
dgarske merged 2 commits into
wolfSSL:masterfrom
kareem-wolfssl:zd22219
Aug 5, 2026
Merged

Fix a couple of issues in DTLS ClientHello parsing.#11007
dgarske merged 2 commits into
wolfSSL:masterfrom
kareem-wolfssl:zd22219

Conversation

@kareem-wolfssl

Copy link
Copy Markdown
Contributor

Thanks to the Fuzz0x team for the report.

Description

Fixes zd#22219

Testing

Provided reproducers + built in tests

Checklist

  • added tests
  • updated/added doxygen
  • updated appropriate READMEs
  • Updated manual and documentation

@kareem-wolfssl kareem-wolfssl self-assigned this Jul 29, 2026
Copilot AI review requested due to automatic review settings July 29, 2026 22:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Tightens DTLS/TLS 1.3 ClientHello parsing to prevent out-of-bounds reads when consuming length-prefixed legacy fields (session_id and legacy_cookie), aligning error handling with fuzz-discovered edge cases.

Changes:

  • Added explicit bounds checks before reading opaque-8 length fields in DoTls13SupportedVersions.
  • Added bounds check and refactored cookieLen handling in DTLS DoTls13ClientHello parsing.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/tls13.c Outdated
Comment thread src/tls13.c Outdated
Comment thread src/tls13.c
@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown

@Fuzz0X

Fuzz0X commented Jul 31, 2026

Copy link
Copy Markdown

I tested PR #11007 locally with my ASAN repro. Before the patch it hit the heap-buffer-overflow in
DoTls13SupportedVersions, and after applying the PR it just returns malformed buffer input error (-328) with no ASAN
crash.

@kareem-wolfssl

Copy link
Copy Markdown
Contributor Author

Retest this please

@Fuzz0X

Fuzz0X commented Aug 4, 2026

Copy link
Copy Markdown

I ran the original UDP repro a few times, and the heap-buffer-overflow no longer reproduces. The server now rejects it with -328 (malformed buffer input error) and exits without an ASAN abort.

I also ran make check and got no failures.

So the original OOB read still looks fixed to me.

@dgarske
dgarske merged commit 36c35c9 into wolfSSL:master Aug 5, 2026
354 of 355 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants