Skip to content
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.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle TLS handshake timeouts in SSLSocketConnection #712

Merged
merged 2 commits into from
Apr 5, 2024

Conversation

constcast
Copy link
Contributor

SSLSocketConnection prior to this commit would hang identifitly if a timeout during the TLS handshake occurs. This can happen if a target accepts a TCP connection but does not send any TLS handshake messages, e.g. because of a bug triggered by the fuzzing.

This commit makes boofuzz observe timeouts during the TLS handshake. TLS handshake timeouts are handled in the same way as timeouts during TCP connection setup.

SSLSocketConnection prior to this commit would hang identifitly if a
timeout during the TLS handshake occurs. This can happen if a target
accepts a TCP connection but does not send any TLS handshake messages,
e.g. because of a bug triggered by the fuzzing.

This commit makes boofuzz observe timeouts during the TLS handshake. TLS
handshake timeouts are handled in the same way as timeouts during TCP
connection setup.
@constcast
Copy link
Contributor Author

In order to reproduce the problem that this pull request is trying to fix, use the following setup:

Run netcat in one shell:

 sudo nc -lnvp 443

Run example/fuzz_ssl_client.py

python3 example/fuzz_ssl_client.py

Observation: The connection to the netcat instance is created, but netcat does not respond to the TLS handshake. The fuzzer will hang forever. After this commit, this hanging will result in a proper error.

@SR4ven
Copy link
Collaborator

SR4ven commented Apr 5, 2024

Thank you for the PR @constcast, nice catch!

I just reformatted the code according to black.

@SR4ven SR4ven merged commit 9604015 into jtpereyda:master Apr 5, 2024
13 checks passed
@constcast constcast deleted the tls-timeout branch April 8, 2024 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants