Repository navigation
Conversation
Related to openssl#20268 DSA_sign() assumes that the signature passed in is related to DSA_size(). If q is negative then DSA_size() actually fails and returns 0. A test that tries to allocate the signature buffer using DSA_size() and then pass it to DSA_sign() will then either. (1) Have a signature buffer of NULL. In this case it was leaking data returned via i2d_DSA_SIG. (2) Cause a seg fault because we created a buffer that was not large enough to hold the signature. As it already checked zero we also now check for negative values also.
paulidale
approved these changes
Mar 21, 2023
Contributor
|
I think this is a bug and able to be back ported. |
Contributor
|
Consider 1.1.1 is this has security relevance. It's a heap walk but I'm not sure if an attacker can control things. |
slontis
added a commit
to slontis/openssl
that referenced
this pull request
Mar 21, 2023
Similiar to the issue found in PR openssl#20553 for DSA_sign(). ECDSA_sign() leaked memory if the signature was NULL when i2d_ECDSA_SIG was called. Note that this does not affect the higher level EVP functions as they correctly handle NULL.
1 of 2 tasks
t8m
approved these changes
Mar 21, 2023
Member
|
I do not see this being a security issue. A security hardening perhaps. It also won't cherry-pick cleanly to 1.1.1. |
Collaborator
|
This pull request is ready to merge |
openssl-machine
pushed a commit
that referenced
this pull request
Mar 31, 2023
Similiar to the issue found in PR #20553 for DSA_sign(). ECDSA_sign() leaked memory if the signature was NULL when i2d_ECDSA_SIG was called. Note that this does not affect the higher level EVP functions as they correctly handle NULL. Reviewed-by: Tomas Mraz <[email protected]> Reviewed-by: Paul Dale <[email protected]> Reviewed-by: Todd Short <[email protected]> (Merged from #20554)
openssl-machine
pushed a commit
that referenced
this pull request
Mar 31, 2023
Similiar to the issue found in PR #20553 for DSA_sign(). ECDSA_sign() leaked memory if the signature was NULL when i2d_ECDSA_SIG was called. Note that this does not affect the higher level EVP functions as they correctly handle NULL. Reviewed-by: Tomas Mraz <[email protected]> Reviewed-by: Paul Dale <[email protected]> Reviewed-by: Todd Short <[email protected]> (Merged from #20554) (cherry picked from commit 4befe81)
openssl-machine
pushed a commit
that referenced
this pull request
Mar 31, 2023
Similiar to the issue found in PR #20553 for DSA_sign(). ECDSA_sign() leaked memory if the signature was NULL when i2d_ECDSA_SIG was called. Note that this does not affect the higher level EVP functions as they correctly handle NULL. Reviewed-by: Tomas Mraz <[email protected]> Reviewed-by: Paul Dale <[email protected]> Reviewed-by: Todd Short <[email protected]> (Merged from #20554) (cherry picked from commit 4befe81) (cherry picked from commit 680b4be)
openssl-machine
pushed a commit
that referenced
this pull request
Mar 31, 2023
Related to #20268 DSA_sign() assumes that the signature passed in is related to DSA_size(). If q is negative then DSA_size() actually fails and returns 0. A test that tries to allocate the signature buffer using DSA_size() and then pass it to DSA_sign() will then either. (1) Have a signature buffer of NULL. In this case it was leaking data returned via i2d_DSA_SIG. (2) Cause a seg fault because we created a buffer that was not large enough to hold the signature. As it already checked zero we also now check for negative values also. Reviewed-by: Tomas Mraz <[email protected]> Reviewed-by: Paul Dale <[email protected]> Reviewed-by: Todd Short <[email protected]> (Merged from #20553)
openssl-machine
pushed a commit
that referenced
this pull request
Mar 31, 2023
Related to #20268 DSA_sign() assumes that the signature passed in is related to DSA_size(). If q is negative then DSA_size() actually fails and returns 0. A test that tries to allocate the signature buffer using DSA_size() and then pass it to DSA_sign() will then either. (1) Have a signature buffer of NULL. In this case it was leaking data returned via i2d_DSA_SIG. (2) Cause a seg fault because we created a buffer that was not large enough to hold the signature. As it already checked zero we also now check for negative values also. Reviewed-by: Tomas Mraz <[email protected]> Reviewed-by: Paul Dale <[email protected]> Reviewed-by: Todd Short <[email protected]> (Merged from #20553) (cherry picked from commit 9559ad0)
Contributor
|
Merged to master, openssl-3.1 and openssl-3.0. Thank you for your contribution! |
openssl-machine
pushed a commit
that referenced
this pull request
Mar 31, 2023
Related to #20268 DSA_sign() assumes that the signature passed in is related to DSA_size(). If q is negative then DSA_size() actually fails and returns 0. A test that tries to allocate the signature buffer using DSA_size() and then pass it to DSA_sign() will then either. (1) Have a signature buffer of NULL. In this case it was leaking data returned via i2d_DSA_SIG. (2) Cause a seg fault because we created a buffer that was not large enough to hold the signature. As it already checked zero we also now check for negative values also. Reviewed-by: Tomas Mraz <[email protected]> Reviewed-by: Paul Dale <[email protected]> Reviewed-by: Todd Short <[email protected]> (Merged from #20553) (cherry picked from commit 9559ad0) (cherry picked from commit ce90b5e)
bernd-edlinger
pushed a commit
to bernd-edlinger/openssl
that referenced
this pull request
May 2, 2023
Similiar to the issue found in PR openssl#20553 for DSA_sign(). ECDSA_sign() leaked memory if the signature was NULL when i2d_ECDSA_SIG was called. Note that this does not affect the higher level EVP functions as they correctly handle NULL. Reviewed-by: Tomas Mraz <[email protected]> Reviewed-by: Paul Dale <[email protected]> Reviewed-by: Todd Short <[email protected]> (Merged from openssl#20554) (cherry picked from commit 4befe81) (cherry picked from commit 680b4be)
bernd-edlinger
pushed a commit
to bernd-edlinger/openssl
that referenced
this pull request
May 4, 2023
Related to openssl#20268 DSA_sign() assumes that the signature passed in is related to DSA_size(). If q is negative then DSA_size() actually fails and returns 0. A test that tries to allocate the signature buffer using DSA_size() and then pass it to DSA_sign() will then either. (1) Have a signature buffer of NULL. In this case it was leaking data returned via i2d_DSA_SIG. (2) Cause a seg fault because we created a buffer that was not large enough to hold the signature. As it already checked zero we also now check for negative values also. Reviewed-by: Tomas Mraz <[email protected]> Reviewed-by: Paul Dale <[email protected]> Reviewed-by: Todd Short <[email protected]> (Merged from openssl#20553) (cherry picked from commit 9559ad0) (cherry picked from commit ce90b5e)
bernd-edlinger
pushed a commit
to bernd-edlinger/openssl
that referenced
this pull request
May 13, 2023
Similiar to the issue found in PR openssl#20553 for DSA_sign(). ECDSA_sign() leaked memory if the signature was NULL when i2d_ECDSA_SIG was called. Note that this does not affect the higher level EVP functions as they correctly handle NULL. Reviewed-by: Tomas Mraz <[email protected]> Reviewed-by: Paul Dale <[email protected]> Reviewed-by: Todd Short <[email protected]> (Merged from openssl#20554) (cherry picked from commit 4befe81) (cherry picked from commit 680b4be)
bernd-edlinger
pushed a commit
to bernd-edlinger/openssl
that referenced
this pull request
May 13, 2023
Related to openssl#20268 DSA_sign() assumes that the signature passed in is related to DSA_size(). If q is negative then DSA_size() actually fails and returns 0. A test that tries to allocate the signature buffer using DSA_size() and then pass it to DSA_sign() will then either. (1) Have a signature buffer of NULL. In this case it was leaking data returned via i2d_DSA_SIG. (2) Cause a seg fault because we created a buffer that was not large enough to hold the signature. As it already checked zero we also now check for negative values also. Reviewed-by: Tomas Mraz <[email protected]> Reviewed-by: Paul Dale <[email protected]> Reviewed-by: Todd Short <[email protected]> (Merged from openssl#20553) (cherry picked from commit 9559ad0) (cherry picked from commit ce90b5e)
bernd-edlinger
pushed a commit
to bernd-edlinger/openssl
that referenced
this pull request
May 17, 2023
Similiar to the issue found in PR openssl#20553 for DSA_sign(). ECDSA_sign() leaked memory if the signature was NULL when i2d_ECDSA_SIG was called. Note that this does not affect the higher level EVP functions as they correctly handle NULL. Reviewed-by: Tomas Mraz <[email protected]> Reviewed-by: Paul Dale <[email protected]> Reviewed-by: Todd Short <[email protected]> (Merged from openssl#20554) (cherry picked from commit 4befe81) (cherry picked from commit 680b4be)
bernd-edlinger
pushed a commit
to bernd-edlinger/openssl
that referenced
this pull request
May 17, 2023
Related to openssl#20268 DSA_sign() assumes that the signature passed in is related to DSA_size(). If q is negative then DSA_size() actually fails and returns 0. A test that tries to allocate the signature buffer using DSA_size() and then pass it to DSA_sign() will then either. (1) Have a signature buffer of NULL. In this case it was leaking data returned via i2d_DSA_SIG. (2) Cause a seg fault because we created a buffer that was not large enough to hold the signature. As it already checked zero we also now check for negative values also. Reviewed-by: Tomas Mraz <[email protected]> Reviewed-by: Paul Dale <[email protected]> Reviewed-by: Todd Short <[email protected]> (Merged from openssl#20553) (cherry picked from commit 9559ad0) (cherry picked from commit ce90b5e)
bernd-edlinger
pushed a commit
to bernd-edlinger/openssl
that referenced
this pull request
May 30, 2023
Similiar to the issue found in PR openssl#20553 for DSA_sign(). ECDSA_sign() leaked memory if the signature was NULL when i2d_ECDSA_SIG was called. Note that this does not affect the higher level EVP functions as they correctly handle NULL. Reviewed-by: Tomas Mraz <[email protected]> Reviewed-by: Paul Dale <[email protected]> Reviewed-by: Todd Short <[email protected]> (Merged from openssl#20554) (cherry picked from commit 4befe81) (cherry picked from commit 680b4be)
bernd-edlinger
pushed a commit
to bernd-edlinger/openssl
that referenced
this pull request
May 30, 2023
Related to openssl#20268 DSA_sign() assumes that the signature passed in is related to DSA_size(). If q is negative then DSA_size() actually fails and returns 0. A test that tries to allocate the signature buffer using DSA_size() and then pass it to DSA_sign() will then either. (1) Have a signature buffer of NULL. In this case it was leaking data returned via i2d_DSA_SIG. (2) Cause a seg fault because we created a buffer that was not large enough to hold the signature. As it already checked zero we also now check for negative values also. Reviewed-by: Tomas Mraz <[email protected]> Reviewed-by: Paul Dale <[email protected]> Reviewed-by: Todd Short <[email protected]> (Merged from openssl#20553) (cherry picked from commit 9559ad0) (cherry picked from commit ce90b5e)
bernd-edlinger
pushed a commit
to bernd-edlinger/openssl
that referenced
this pull request
Jul 19, 2023
Similiar to the issue found in PR openssl#20553 for DSA_sign(). ECDSA_sign() leaked memory if the signature was NULL when i2d_ECDSA_SIG was called. Note that this does not affect the higher level EVP functions as they correctly handle NULL. Reviewed-by: Tomas Mraz <[email protected]> Reviewed-by: Paul Dale <[email protected]> Reviewed-by: Todd Short <[email protected]> (Merged from openssl#20554) (cherry picked from commit 4befe81) (cherry picked from commit 680b4be)
bernd-edlinger
pushed a commit
to bernd-edlinger/openssl
that referenced
this pull request
Jul 19, 2023
Related to openssl#20268 DSA_sign() assumes that the signature passed in is related to DSA_size(). If q is negative then DSA_size() actually fails and returns 0. A test that tries to allocate the signature buffer using DSA_size() and then pass it to DSA_sign() will then either. (1) Have a signature buffer of NULL. In this case it was leaking data returned via i2d_DSA_SIG. (2) Cause a seg fault because we created a buffer that was not large enough to hold the signature. As it already checked zero we also now check for negative values also. Reviewed-by: Tomas Mraz <[email protected]> Reviewed-by: Paul Dale <[email protected]> Reviewed-by: Todd Short <[email protected]> (Merged from openssl#20553) (cherry picked from commit 9559ad0) (cherry picked from commit ce90b5e)
bernd-edlinger
pushed a commit
to bernd-edlinger/openssl
that referenced
this pull request
Aug 1, 2023
Similiar to the issue found in PR openssl#20553 for DSA_sign(). ECDSA_sign() leaked memory if the signature was NULL when i2d_ECDSA_SIG was called. Note that this does not affect the higher level EVP functions as they correctly handle NULL. Reviewed-by: Tomas Mraz <[email protected]> Reviewed-by: Paul Dale <[email protected]> Reviewed-by: Todd Short <[email protected]> (Merged from openssl#20554) (cherry picked from commit 4befe81) (cherry picked from commit 680b4be)
bernd-edlinger
pushed a commit
to bernd-edlinger/openssl
that referenced
this pull request
Aug 1, 2023
Related to openssl#20268 DSA_sign() assumes that the signature passed in is related to DSA_size(). If q is negative then DSA_size() actually fails and returns 0. A test that tries to allocate the signature buffer using DSA_size() and then pass it to DSA_sign() will then either. (1) Have a signature buffer of NULL. In this case it was leaking data returned via i2d_DSA_SIG. (2) Cause a seg fault because we created a buffer that was not large enough to hold the signature. As it already checked zero we also now check for negative values also. Reviewed-by: Tomas Mraz <[email protected]> Reviewed-by: Paul Dale <[email protected]> Reviewed-by: Todd Short <[email protected]> (Merged from openssl#20553) (cherry picked from commit 9559ad0) (cherry picked from commit ce90b5e)
bernd-edlinger
pushed a commit
to bernd-edlinger/openssl
that referenced
this pull request
Aug 19, 2023
Similiar to the issue found in PR openssl#20553 for DSA_sign(). ECDSA_sign() leaked memory if the signature was NULL when i2d_ECDSA_SIG was called. Note that this does not affect the higher level EVP functions as they correctly handle NULL. Reviewed-by: Tomas Mraz <[email protected]> Reviewed-by: Paul Dale <[email protected]> Reviewed-by: Todd Short <[email protected]> (Merged from openssl#20554) (cherry picked from commit 4befe81) (cherry picked from commit 680b4be)
bernd-edlinger
pushed a commit
to bernd-edlinger/openssl
that referenced
this pull request
Aug 19, 2023
Related to openssl#20268 DSA_sign() assumes that the signature passed in is related to DSA_size(). If q is negative then DSA_size() actually fails and returns 0. A test that tries to allocate the signature buffer using DSA_size() and then pass it to DSA_sign() will then either. (1) Have a signature buffer of NULL. In this case it was leaking data returned via i2d_DSA_SIG. (2) Cause a seg fault because we created a buffer that was not large enough to hold the signature. As it already checked zero we also now check for negative values also. Reviewed-by: Tomas Mraz <[email protected]> Reviewed-by: Paul Dale <[email protected]> Reviewed-by: Todd Short <[email protected]> (Merged from openssl#20553) (cherry picked from commit 9559ad0) (cherry picked from commit ce90b5e)
bernd-edlinger
pushed a commit
to bernd-edlinger/openssl
that referenced
this pull request
Sep 12, 2023
Similiar to the issue found in PR openssl#20553 for DSA_sign(). ECDSA_sign() leaked memory if the signature was NULL when i2d_ECDSA_SIG was called. Note that this does not affect the higher level EVP functions as they correctly handle NULL. Reviewed-by: Tomas Mraz <[email protected]> Reviewed-by: Paul Dale <[email protected]> Reviewed-by: Todd Short <[email protected]> (Merged from openssl#20554) (cherry picked from commit 4befe81) (cherry picked from commit 680b4be)
bernd-edlinger
pushed a commit
to bernd-edlinger/openssl
that referenced
this pull request
Sep 12, 2023
Related to openssl#20268 DSA_sign() assumes that the signature passed in is related to DSA_size(). If q is negative then DSA_size() actually fails and returns 0. A test that tries to allocate the signature buffer using DSA_size() and then pass it to DSA_sign() will then either. (1) Have a signature buffer of NULL. In this case it was leaking data returned via i2d_DSA_SIG. (2) Cause a seg fault because we created a buffer that was not large enough to hold the signature. As it already checked zero we also now check for negative values also. Reviewed-by: Tomas Mraz <[email protected]> Reviewed-by: Paul Dale <[email protected]> Reviewed-by: Todd Short <[email protected]> (Merged from openssl#20553) (cherry picked from commit 9559ad0) (cherry picked from commit ce90b5e)
kafei-cy
added a commit
to kafei-cy/Tongsuo
that referenced
this pull request
Mar 26, 2026
DSA_sign() assumes that the signature passed in is related to DSA_size(). If q is negative then DSA_size() actually fails and returns 0. A test that tries to allocate the signature buffer using DSA_size() and then pass it to DSA_sign() will then either. (1) Have a signature buffer of NULL. In this case it was leaking data returned via i2d_DSA_SIG. (2) Cause a seg fault because we created a buffer that was not large enough to hold the signature. As it already checked zero we also now check for negative values also. (Merged from openssl/openssl#20553)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related to #20268
DSA_sign() assumes that the signature passed in is related to DSA_size(). If q is negative then DSA_size() actually fails and returns 0.
A test that tries to allocate the signature buffer using DSA_size() and then pass it to DSA_sign() will then either.
(1) Have a signature buffer of NULL. In this case it was leaking data returned via i2d_DSA_SIG.
(2) Cause a seg fault because we created a buffer that was not large enough to hold the signature. As it already checked zero we also now check for negative values also.
Checklist