-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fix potential NULL pointer dereference before calling EVP_SignInit #13870
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
Conversation
Same problem here? Line 7381 in 7db7c42
Maybe in more places...? |
Yes, this is a potential NULL dereference. |
Thanks for this patch. Line 1593 in 1e4bb03
|
got it, but I'm not sure about the content of error, should be "openssl signature could not be verified"? |
Works for me |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems right, thanks! I'll merge this into PHP-8.2 and above.
Note that for next time you create a PR for a bugfix, please target not the master branch, but the lowest supported branch for bugfixes.
I adapted the patch a bit in the merge to also free key like the error block below did too, while at it I just copied the error message too, such that the error block is identical except for freeing sigbuf. |
Hi! Thanks for merging my pull requests! |
I've looked in the OpenSSL code, and the only way the function can fail is if the memory allocation fails. On modern systems the allocator normally doesn't fail, but even if it does, this doesn't seem attacker controllable. If the context is NULL, then the request will crash, but it would've aborted anyway because we're out of memory at this point, it's just that the abort of the request happens more gracefully now. |
No description provided.