Skip to content

x509: check inner/outer signatureAlgorithm match in X509_CRL_verify - #31213

Closed
vdukhovni wants to merge 1 commit into
openssl:masterfrom
vdukhovni:crl-sigalg
Closed

vdukhovni wants to merge 1 commit into
openssl:masterfrom
vdukhovni:crl-sigalg

Conversation

@vdukhovni

Copy link
Copy Markdown

RFC 5280 section 5.1.1.2 requires the signatureAlgorithm in the outer CertificateList wrapper to be identical to the signature field inside the signed TBSCertList. def_crl_verify() did not enforce this, unlike X509_verify() and X509_ACERT_verify() which both carry an X509_ALGOR_cmp guard.

Add the same guard to def_crl_verify(). A mismatch raises X509_R_CRL_SIGNATURE_ALGORITHM_MISMATCH. No known attack results from the missing check; this is a conformance and hardening fix only.

Add a regression test: a CRL with a valid RSA-SHA256 signature over a TBSCertList whose inner signatureAlgorithm claims ecdsaWithSHA256 is now rejected.

Checklist
  • documentation is added or updated
  • tests are added or updated

RFC 5280 section 5.1.1.2 requires the signatureAlgorithm in the outer
CertificateList wrapper to be identical to the signature field inside
the signed TBSCertList.  def_crl_verify() did not enforce this, unlike
X509_verify() and X509_ACERT_verify() which both carry an X509_ALGOR_cmp
guard.

Add the same guard to def_crl_verify().  A mismatch raises
X509_R_CRL_SIGNATURE_ALGORITHM_MISMATCH.  No known attack results from
the missing check; this is a conformance and hardening fix only.

Add a regression test: a CRL with a valid RSA-SHA256 signature over a
TBSCertList whose inner signatureAlgorithm claims ecdsaWithSHA256 is
now rejected.
@vdukhovni
vdukhovni requested review from t8m and tomato42 May 18, 2026 10:44
@github-actions github-actions Bot added the severity: fips change The pull request changes FIPS provider sources label May 18, 2026
@openssl-machine openssl-machine added the approval: review pending This pull request needs review by a committer label Jun 2, 2026

@jogme jogme left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@openssl-machine openssl-machine added approval: done This pull request has the required number of approvals approval: ready to merge The 24 hour grace period has passed, ready to merge and removed approval: review pending This pull request needs review by a committer approval: done This pull request has the required number of approvals labels Jun 4, 2026
@openssl-machine

Copy link
Copy Markdown
Collaborator

This pull request is ready to merge

@jogme jogme added branch: master Applies to master branch triaged: bug The issue/pr is/fixes a bug branch: 3.0 Applies to openssl-3.0 branch (EOL) branch: 3.4 Applies to openssl-3.4 branch: 3.5 Applies to openssl-3.5 branch: 3.6 Applies to openssl-3.6 branch: 4.0 Applies to openssl-4.0 labels Jun 11, 2026
openssl-machine pushed a commit that referenced this pull request Jun 11, 2026
RFC 5280 section 5.1.1.2 requires the signatureAlgorithm in the outer
CertificateList wrapper to be identical to the signature field inside
the signed TBSCertList.  def_crl_verify() did not enforce this, unlike
X509_verify() and X509_ACERT_verify() which both carry an X509_ALGOR_cmp
guard.

Add the same guard to def_crl_verify().  A mismatch raises
X509_R_CRL_SIGNATURE_ALGORITHM_MISMATCH.  No known attack results from
the missing check; this is a conformance and hardening fix only.

Add a regression test: a CRL with a valid RSA-SHA256 signature over a
TBSCertList whose inner signatureAlgorithm claims ecdsaWithSHA256 is
now rejected.

Reviewed-by: Neil Horman <[email protected]>
Reviewed-by: Norbert Pocs <[email protected]>
MergeDate: Thu Jun 11 08:45:41 2026
(Merged from #31213)
openssl-machine pushed a commit that referenced this pull request Jun 11, 2026
RFC 5280 section 5.1.1.2 requires the signatureAlgorithm in the outer
CertificateList wrapper to be identical to the signature field inside
the signed TBSCertList.  def_crl_verify() did not enforce this, unlike
X509_verify() and X509_ACERT_verify() which both carry an X509_ALGOR_cmp
guard.

Add the same guard to def_crl_verify().  A mismatch raises
X509_R_CRL_SIGNATURE_ALGORITHM_MISMATCH.  No known attack results from
the missing check; this is a conformance and hardening fix only.

Add a regression test: a CRL with a valid RSA-SHA256 signature over a
TBSCertList whose inner signatureAlgorithm claims ecdsaWithSHA256 is
now rejected.

Reviewed-by: Neil Horman <[email protected]>
Reviewed-by: Norbert Pocs <[email protected]>
MergeDate: Thu Jun 11 08:48:28 2026
(Merged from #31213)
openssl-machine pushed a commit that referenced this pull request Jun 11, 2026
RFC 5280 section 5.1.1.2 requires the signatureAlgorithm in the outer
CertificateList wrapper to be identical to the signature field inside
the signed TBSCertList.  def_crl_verify() did not enforce this, unlike
X509_verify() and X509_ACERT_verify() which both carry an X509_ALGOR_cmp
guard.

Add the same guard to def_crl_verify().  A mismatch raises
X509_R_CRL_SIGNATURE_ALGORITHM_MISMATCH.  No known attack results from
the missing check; this is a conformance and hardening fix only.

Add a regression test: a CRL with a valid RSA-SHA256 signature over a
TBSCertList whose inner signatureAlgorithm claims ecdsaWithSHA256 is
now rejected.

Reviewed-by: Neil Horman <[email protected]>
Reviewed-by: Norbert Pocs <[email protected]>
MergeDate: Thu Jun 11 08:49:42 2026
(Merged from #31213)
openssl-machine pushed a commit that referenced this pull request Jun 11, 2026
RFC 5280 section 5.1.1.2 requires the signatureAlgorithm in the outer
CertificateList wrapper to be identical to the signature field inside
the signed TBSCertList.  def_crl_verify() did not enforce this, unlike
X509_verify() and X509_ACERT_verify() which both carry an X509_ALGOR_cmp
guard.

Add the same guard to def_crl_verify().  A mismatch raises
X509_R_CRL_SIGNATURE_ALGORITHM_MISMATCH.  No known attack results from
the missing check; this is a conformance and hardening fix only.

Add a regression test: a CRL with a valid RSA-SHA256 signature over a
TBSCertList whose inner signatureAlgorithm claims ecdsaWithSHA256 is
now rejected.

Reviewed-by: Neil Horman <[email protected]>
Reviewed-by: Norbert Pocs <[email protected]>
MergeDate: Thu Jun 11 08:51:03 2026
(Merged from #31213)
@jogme

jogme commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Merged to all active branches. Thank you!

@jogme jogme closed this Jun 11, 2026
openssl-machine pushed a commit that referenced this pull request Jun 11, 2026
RFC 5280 section 5.1.1.2 requires the signatureAlgorithm in the outer
CertificateList wrapper to be identical to the signature field inside
the signed TBSCertList.  def_crl_verify() did not enforce this, unlike
X509_verify() and X509_ACERT_verify() which both carry an X509_ALGOR_cmp
guard.

Add the same guard to def_crl_verify().  A mismatch raises
X509_R_CRL_SIGNATURE_ALGORITHM_MISMATCH.  No known attack results from
the missing check; this is a conformance and hardening fix only.

Add a regression test: a CRL with a valid RSA-SHA256 signature over a
TBSCertList whose inner signatureAlgorithm claims ecdsaWithSHA256 is
now rejected.

Reviewed-by: Neil Horman <[email protected]>
Reviewed-by: Norbert Pocs <[email protected]>
MergeDate: Thu Jun 11 08:52:54 2026
(Merged from #31213)
openssl-machine pushed a commit that referenced this pull request Jun 11, 2026
RFC 5280 section 5.1.1.2 requires the signatureAlgorithm in the outer
CertificateList wrapper to be identical to the signature field inside
the signed TBSCertList.  def_crl_verify() did not enforce this, unlike
X509_verify() and X509_ACERT_verify() which both carry an X509_ALGOR_cmp
guard.

Add the same guard to def_crl_verify().  A mismatch raises
X509_R_CRL_SIGNATURE_ALGORITHM_MISMATCH.  No known attack results from
the missing check; this is a conformance and hardening fix only.

Add a regression test: a CRL with a valid RSA-SHA256 signature over a
TBSCertList whose inner signatureAlgorithm claims ecdsaWithSHA256 is
now rejected.

Reviewed-by: Neil Horman <[email protected]>
Reviewed-by: Norbert Pocs <[email protected]>
MergeDate: Thu Jun 11 08:52:19 2026
(Merged from #31213)
n13l pushed a commit to n13l/openssl that referenced this pull request Jul 25, 2026
RFC 5280 section 5.1.1.2 requires the signatureAlgorithm in the outer
CertificateList wrapper to be identical to the signature field inside
the signed TBSCertList.  def_crl_verify() did not enforce this, unlike
X509_verify() and X509_ACERT_verify() which both carry an X509_ALGOR_cmp
guard.

Add the same guard to def_crl_verify().  A mismatch raises
X509_R_CRL_SIGNATURE_ALGORITHM_MISMATCH.  No known attack results from
the missing check; this is a conformance and hardening fix only.

Add a regression test: a CRL with a valid RSA-SHA256 signature over a
TBSCertList whose inner signatureAlgorithm claims ecdsaWithSHA256 is
now rejected.

Reviewed-by: Neil Horman <[email protected]>
Reviewed-by: Norbert Pocs <[email protected]>
MergeDate: Thu Jun 11 08:45:41 2026
(Merged from openssl#31213)
rickyringler pushed a commit to rickyringler/openssl that referenced this pull request Aug 21, 2026
RFC 5280 section 5.1.1.2 requires the signatureAlgorithm in the outer
CertificateList wrapper to be identical to the signature field inside
the signed TBSCertList.  def_crl_verify() did not enforce this, unlike
X509_verify() and X509_ACERT_verify() which both carry an X509_ALGOR_cmp
guard.

Add the same guard to def_crl_verify().  A mismatch raises
X509_R_CRL_SIGNATURE_ALGORITHM_MISMATCH.  No known attack results from
the missing check; this is a conformance and hardening fix only.

Add a regression test: a CRL with a valid RSA-SHA256 signature over a
TBSCertList whose inner signatureAlgorithm claims ecdsaWithSHA256 is
now rejected.

Reviewed-by: Neil Horman <[email protected]>
Reviewed-by: Norbert Pocs <[email protected]>
MergeDate: Thu Jun 11 08:45:41 2026
(Merged from openssl#31213)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approval: ready to merge The 24 hour grace period has passed, ready to merge branch: master Applies to master branch branch: 3.0 Applies to openssl-3.0 branch (EOL) branch: 3.4 Applies to openssl-3.4 branch: 3.5 Applies to openssl-3.5 branch: 3.6 Applies to openssl-3.6 branch: 4.0 Applies to openssl-4.0 severity: fips change The pull request changes FIPS provider sources triaged: bug The issue/pr is/fixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants