Repository navigation
Merge changes from forks (#17213) - #17218
Merged
Merged
Conversation
[CORS: Don't override vary header if it already exists](netty@1a896eb) Motivation: Netty's CorsHandler silently overwrites existing Vary headers, enabling cache poisoning and sensitive information disclosure. Modifications: - Only set vary header if it not already exists - Add unit test Result: No more cache poisoning possible --- [Encoding-side validation of MQTT fields](netty@9975553) Motivation: The MqttEncoder should not produce malformed messages if client id, topics, or usernames contain illegal characters. Modification: Add validation of client identifier, will topic, and username to the encoding path of CONNECT messages, and also to the topic name when encoding PUBLISH messages. Result: The encoder will now throw an exception if any of these fields contain a NUL byte. --- [Bound SCTP fragmented message buffering](netty@c07b97c) --- [Correctly handle ClientHello with a handshake header split across TLS…](netty@a8f53f2) … records Motivation: The handshake header (HandshakeType + 3-byte length = 4 bytes) may be delivered across multiple TLS records. SslClientHelloHandler assumed these 4 bytes were always contained in the first record and read them directly from it, which is incorrect when the header spans records. Modification: - Read the handshake header directly from the record only when the full 4 bytes are contained in it. - Otherwise aggregate the record payloads into handshakeBuffer and read the handshakeType and handshakeLength from the buffer once at least 4 bytes are available. - Aggregate the handshake header together with the body and slice past the 4-byte header once the full ClientHello has been buffered. - Add SniHandlerTest cases for fragment sizes 1-4. Result: ClientHello messages whose handshake header is fragmented across multiple TLS records are parsed correctly. --- [Harden the SOCKS4/5 input validation at encoding time](netty@4625406) Motivation: SOCKS4 is a delimiter-based protocol, and does not support NUL bytes in string or byte-sequence fields. SOCKS5 is a Tag-Length-Value protocol, and does not support lengths greater than 255. Modification: Add validations for NUL bytes and lengths for SOCKS4 and 5, respectively, and ensure both client- and server-side encoders behave correctly. Add tests to verify the correct handling of boundary conditions. Result: Correct delimiter and length handling in the SOCKS4/5 encoders, even when integrators use custom implementations of the message types. --- [Do not re-aggregate the ClientHello on every received TLS record](netty@bb74154) --- [Validate trust manager configuration](netty@5f1888e) Motivation: Certain trust manager configurations were not being validated against the configured endpoint identification algorithm. Modification: Add a check that fails fast when the configured trust manager does not support the required verification mode. Result: Misconfigured trust manager setups are now rejected explicitly instead of failing silently. --------- Co-authored-by: Norman Maurer <[email protected]> Co-authored-by: yawkat <[email protected]> Co-authored-by: multicode <[email protected]> Co-authored-by: Violeta Georgieva <[email protected]> (cherry picked from commit 1b5abc6)
✅ All tests passed ✅🏷️ Commit: 82b565f Learn more about TestLens at testlens.app. |
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.
CORS: Don't override vary header if it already
exists Motivation:
Netty's CorsHandler silently overwrites existing Vary headers, enabling cache poisoning and sensitive information disclosure.
Modifications:
Result:
No more cache poisoning possible
Encoding-side validation of MQTT
fields Motivation:
The MqttEncoder should not produce malformed messages if client id, topics, or usernames contain illegal characters.
Modification:
Add validation of client identifier, will topic, and username to the encoding path of CONNECT messages, and also to the topic name when encoding PUBLISH messages.
Result:
The encoder will now throw an exception if any of these fields contain a NUL byte.
Bound SCTP fragmented message
buffering
Correctly handle ClientHello with a handshake header split across TLS… … records
Motivation:
The handshake header (HandshakeType + 3-byte length = 4 bytes) may be delivered across multiple TLS records. SslClientHelloHandler assumed these
4 bytes were always contained in the first record and read them directly from it, which is incorrect when the header spans records.
Modification:
handshakeType and handshakeLength from the buffer once at least 4 bytes are available.
4-byte header once the full ClientHello has been buffered.
Result:
ClientHello messages whose handshake header is fragmented across multiple
TLS records are parsed correctly.
Harden the SOCKS4/5 input validation at encoding
time Motivation:
SOCKS4 is a delimiter-based protocol, and does not support NUL bytes in string or byte-sequence fields.
SOCKS5 is a Tag-Length-Value protocol, and does not support lengths greater than 255.
Modification:
Add validations for NUL bytes and lengths for SOCKS4 and 5, respectively, and ensure both client- and server-side encoders behave correctly.
Add tests to verify the correct handling of boundary conditions.
Result:
Correct delimiter and length handling in the SOCKS4/5 encoders, even when integrators use custom implementations of the message types.
Do not re-aggregate the ClientHello on every received TLS record
Validate trust manager
configuration Motivation:
Certain trust manager configurations were not being validated against the configured endpoint identification algorithm.
Modification:
Add a check that fails fast when the configured trust manager does not support the required verification mode.
Result:
Misconfigured trust manager setups are now rejected explicitly instead of failing silently.
Co-authored-by: Norman Maurer [email protected]
Co-authored-by: yawkat [email protected]
Co-authored-by: multicode [email protected]
Co-authored-by: Violeta Georgieva [email protected]
(cherry picked from commit 1b5abc6)
Motivation:
Explain here the context, and why you're making that change.
What is the problem you're trying to solve.
Modification:
Describe the modifications you've done.
Result:
Fixes #.
If there is no issue then describe the changes introduced by this PR.