Fix Missing ECH (0xfe0d) and ALPS (0x44cd) extensions - #42
Merged
Conversation
Collaborator
|
Hi @12189108, Thanks for the fix! Two quick questions on buffer safety:
|
Collaborator
|
Also, please update |
Author
|
@vlvkobal , Thanks for raising these security issues! Fixed: QUIC overflow: added bounds check before memcpy to prevent frames from exceeding header's declared length. Truncates and logs alert on overflow. ALPN overflow: This was introduced by a previous commit, not by me. Fixed by validating inlen > 0 before accessing in[0] and ensuring buffer has sufficient data (inlen >= alpn_len + 1). Both fixes handle malformed input gracefully while maintaining compatibility. Note: Patches have been regenerated against the latest nginx code. |
1. TLS/QUIC Extension Parsing: - Replaced SSL_client_hello_get1_extensions_present() with raw ClientHello parsing to capture all TLS extensions, specifically ECH (0xfe0d) and ALPS (0x44cd). - Added detection for TLS_EMPTY_RENEGOTIATION_INFO_SCSV. - Implemented QUIC CRYPTO frame reassembly for fragmented ClientHello messages. - Ensured complete extension visibility for both TLS and QUIC connections. 2. Security Fixes: - QUIC Overflow: Added bounds check before memcpy to prevent frames from exceeding the header's declared length. The system now truncates and logs an alert on overflow. - ALPN Overflow: Fixed a regression from a previous commit by validating inlen > 0 before accessing in[0] and ensuring the buffer has sufficient data (inlen >= alpn_len + 1). Both fixes handle malformed input gracefully. 3. Dependencies: - Bumped Nginx version to 1.28.1 in Dockerfile. - Bumped OpenSSL version to 3.5.4 in Dockerfile.
Collaborator
|
Could you add tests for the ECH and ALPS extensions? |
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.
Fix missing ECH and ALPS extensions
Patch generated from nginx 1.28.1 source code