fix: validate protocol version during connection deserialization#5523
Merged
fix: validate protocol version during connection deserialization#5523
Conversation
maddeleine
approved these changes
Sep 24, 2025
lrstewart
reviewed
Sep 25, 2025
lrstewart
reviewed
Sep 26, 2025
lrstewart
reviewed
Sep 27, 2025
lrstewart
approved these changes
Oct 1, 2025
lrstewart
approved these changes
Oct 2, 2025
maddeleine
reviewed
Oct 2, 2025
maddeleine
approved these changes
Oct 2, 2025
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.
Release Summary:
Fixed a validation issue in s2n_connection_deserialize() where malformed protocol version bytes could result in invalid connection state and inconsistent TLS behavior.
Resolved issues:
Fixes a validation issue in s2n_connection_deserialize() where malformed protocol version bytes could result in invalid connection state and inconsistent TLS behavior.
The issue is that a user controlling serialized connection data could provide malformed protocol version bytes that, when deserialized and used in the connection, would result in invalid protocol versions outside the valid TLS range (30-34). These invalid values can trigger unexpected code paths and cause inconsistent TLS behavior where the connection operates with protocol versions that don't correspond to any legitimate TLS version.
Description of changes:
Added protocol version validation in
s2n_connection_deserialize_parse()to ensure deserialized protocol versions are within the valid TLS range (S2N_SSLv3to s2n_highest_protocol_version(S2N_TLS13))Call-outs:
This is not considered a security issue. Users are responsible for protecting serialized connection data as documented in Connection Serialization Usage Guide. The serialized data contains sensitive cryptographic material and must be protected by the application.
We also have API documentation for proper usage: s2n_connection_serialize() and s2n_connection_deserialize()
Testing:
Added unit tests for protocol validation
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.