-
Notifications
You must be signed in to change notification settings - Fork 835
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
[Bug]: Asan reports SEGV on unknown address in ProcessReplyEx, potential heap over flow #7089
Comments
Hello @hey3e Can you reproduce this problem without modifying wolfssl? Can you let us know why you modified the code? |
Sorry, I didn't explain clearly. We need to compile two wolfssl, one as server without modification, one as malicious client with modification. Reproduction stepsServer
Malicious client
In this case, technically we reproduced the problem without modifying wolfssl because the client is malicious in our attack model. Also the bug can be triggered without modifying client but it would be consuming because of encryption. I chose to leverage the client itself who originally can generate valid cryptographic packets. What I modify is just removing the cert data and record type of Certificate packet before its encryption. |
Here are the relevant changes from the zip:
|
I was able to reproduce. I will request feedback from our engineers. |
Hey @hey3e, It seems we failed to do a bounds check during the mac verify step and the bad sizes that came in as input were causing our index variable to be 0, which then wrapped around to 0xffff in the next step after it was decremented. Anyways I've added a bounds check to return an error when this happens, here is the PR #7099. We'll close this issue once the PR has been merged, thank you for bringing this to our attention. Best Wishes, |
Contact Details
heyme0920@gmail.com
Version
5.6.3 928dd70
Description
TLS1.3 client sends the Certificate packet whose record only contains authentication data, without cert and record type.
Build with asan.
Reproduction steps
export CFLAGS=-fsanitize=address
./configure --enable-tls13
tls13.zip
make
./examples/server/server -v 4 -i -x
./examples/client/client -v 4
Relevant log output
The text was updated successfully, but these errors were encountered: