Fix a couple of issues in DTLS ClientHello parsing. - #11007
Conversation
There was a problem hiding this comment.
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
cookieLenhandling in DTLSDoTls13ClientHelloparsing.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
I tested PR #11007 locally with my ASAN repro. Before the patch it hit the heap-buffer-overflow in |
Thanks to the Fuzz0x team for the report.
|
Retest this please |
|
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. |
Thanks to the Fuzz0x team for the report.
Description
Fixes zd#22219
Testing
Provided reproducers + built in tests
Checklist