You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Bug]: wolfSSL server (TLS1.3) improperly handles the situation when a Change Cipher Spec record is received before the first ClientHello message
#8765
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
RFC 8446 (Section 5) says: "An implementation may receive an unencrypted record of type change_cipher_spec consisting of the single byte value 0x01 ... An implementation which receives any other change_cipher_spec value ... MUST abort the handshake with an "unexpected_message" alert. If an implementation detects a change_cipher_spec record received before the first ClientHello message or after the peer's Finished message, it MUST be treated as an unexpected record type ... If a TLS implementation receives an unexpected record type, it MUST terminate the connection with an "unexpected_message" alert."
This implies that the server should send an "unexpected_message" alert when:
the change_cipher_spec record is malformed, or
the change_cipher_spec record is received before the first ClientHello message
Our fuzzer finds that under scenario 1), wolfSSL sends an "illegal_parameter" alert, which violates the RFC:
Contact Details
No response
Version
5.8.0 (b077c81)
Description
RFC 8446 (Section 5) says: "An implementation may receive an unencrypted record of type change_cipher_spec consisting of the single byte value 0x01 ... An implementation which receives any other change_cipher_spec value ... MUST abort the handshake with an "unexpected_message" alert. If an implementation detects a change_cipher_spec record received before the first ClientHello message or after the peer's Finished message, it MUST be treated as an unexpected record type ... If a TLS implementation receives an unexpected record type, it MUST terminate the connection with an "unexpected_message" alert."
This implies that the server should send an "unexpected_message" alert when:
Our fuzzer finds that under scenario 1), wolfSSL sends an "illegal_parameter" alert, which violates the RFC:
https://github.com/wolfSSL/wolfssl/blob/ed6f853b9ca716a544018ae45926bdcec376e114/src/internal.c#L22679-L22684
Additionally, it seems that the code does not properly handle scenario 2) as well:
https://github.com/wolfSSL/wolfssl/blob/ed6f853b9ca716a544018ae45926bdcec376e114/src/internal.c#L22672-L22694
The (compressed)
.pcap
file:traffic.pcap.gz
Reproduction steps
No response
Relevant log output
The text was updated successfully, but these errors were encountered: