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

Potential NULL dereference #10404

Closed
ManSoSec opened this issue Nov 10, 2019 · 0 comments
Closed

Potential NULL dereference #10404

ManSoSec opened this issue Nov 10, 2019 · 0 comments
Labels
triaged: bug The issue/pr is/fixes a bug

Comments

@ManSoSec
Copy link

ManSoSec commented Nov 10, 2019

Most of the functions that receive EVP_PKEY have a null check on pkey argument, like:

if (pkey == NULL)

if (pkey && pkey->ameth && pkey->ameth->pkey_size)

While a null check is missed in EVP_PKEY_missing_parameters:

openssl/crypto/evp/p_lib.c

Lines 106 to 108 in 1903a9b

int EVP_PKEY_missing_parameters(const EVP_PKEY *pkey)
{
if (pkey->ameth && pkey->ameth->param_missing)

We noticed it is possible the input of this function might be null. For example X509_get0_pubkey might return null:

openssl/apps/ca.c

Lines 1917 to 1918 in 5388f98

pktmp = X509_get0_pubkey(ret);
if (EVP_PKEY_missing_parameters(pktmp) &&

We believe there should be a null check on pkey in EVP_PKEY_missing_parameters function, otherwise, there will be a NULL dereference.

Thanks!

@ManSoSec ManSoSec added the issue: bug report The issue was opened to report a bug label Nov 10, 2019
@mattcaswell mattcaswell added triaged: bug The issue/pr is/fixes a bug and removed issue: bug report The issue was opened to report a bug labels Nov 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triaged: bug The issue/pr is/fixes a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants