CVE-2023-0215: Use-after-free following BIO_new_NDEF

Published Jan 25, 2023
·
Updated

A use-after-free vulnerability was found in OpenSSL's BIOnewNDEF function. The public API function BIOnewNDEF is a helper function used for streaming ASN.1 data via a BIO. It is primarily used internally by OpenSSL to support the SMIME, CMS, and PKCS7 streaming capabilities, but it may also be called directly by end-user applications. The function receives a BIO from the caller, prepends a new BIOfasn1 filter BIO onto the front of it to form a BIO chain, and then returns the new head of the BIO chain to the caller. Under certain conditions. For example, if a CMS recipient public key is invalid, the new filter BIO is freed, and the function returns a NULL result indicating a failure. However, in this case, the BIO chain is not properly cleaned up, and the BIO passed by the caller still retains internal pointers to the previously freed filter BIO. If the caller then calls BIOpop() on the BIO, a use-after-free will occur, possibly resulting in a crash.

Other sources

OpenSSL is vulnerable to a denial of service, caused by a use-after-free error related to the incorrect handling of streaming ASN.1 data by the BIOnewNDEF function. A remote attacker could exploit this vulnerability to cause a denial of service.

IBM

The public API function BIOnewNDEF is a helper function used for streaming ASN.1 data via a BIO. It is primarily used internally to OpenSSL to support the SMIME, CMS and PKCS7 streaming capabilities, but may also be called directly by end user applications.

The function receives a BIO from the caller, prepends a new BIOfasn1 filter BIO onto the front of it to form a BIO chain, and then returns the new head of the BIO chain to the caller. Under certain conditions, for example if a CMS recipient public key is invalid, the new filter BIO is freed and the function returns a NULL result indicating a failure. However, in this case, the BIO chain is not properly cleaned up and the BIO passed by the caller still retains internal pointers to the previously freed filter BIO. If the caller then goes on to call BIOpop() on the BIO then a use-after-free will occur. This will most likely result in a crash.

This scenario occurs directly in the internal function B64writeASN1() which may cause BIOnewNDEF() to be called and will subsequently call BIOpop() on the BIO. This internal function is in turn called by the public API functions PEMwritebioASN1stream, PEMwritebioCMSstream, PEMwritebioPKCS7stream, SMIMEwriteASN1, SMIMEwriteCMS and SMIMEwritePKCS7.

Other public API functions that may be impacted by this include i2dASN1biostream, BIOnewCMS, BIOnewPKCS7, i2dCMSbiostream and i2dPKCS7biostream.

GitHub

The public API function BIOnewNDEF is a helper function used for streaming ASN.1 data via a BIO. It is primarily used internally to OpenSSL to support the SMIME, CMS and PKCS7 streaming capabilities, but may also be called directly by end user applications.

The function receives a BIO from the caller, prepends a new BIOfasn1 filter BIO onto the front of it to form a BIO chain, and then returns the new head of the BIO chain to the caller. Under certain conditions, for example if a CMS recipient public key is invalid, the new filter BIO is freed and the function returns a NULL result indicating a failure. However, in this case, the BIO chain is not properly cleaned up and the BIO passed by the caller still retains internal pointers to the previously freed filter BIO. If the caller then goes on to call BIOpop() on the BIO then a use-after-free will occur. This will most likely result in a crash.

This scenario occurs directly in the internal function B64writeASN1() which may cause BIOnewNDEF() to be called and will subsequently call BIOpop() on the BIO. This internal function is in turn called by the public API functions PEMwritebioASN1stream, PEMwritebioCMSstream, PEMwritebioPKCS7stream, SMIMEwriteASN1, SMIMEwriteCMS and SMIMEwritePKCS7.

Other public API functions that may be impacted by this include i2dASN1biostream, BIOnewCMS, BIOnewPKCS7, i2dCMSbiostream and i2dPKCS7biostream.

The OpenSSL cms and smime command line applications are similarly affected.

NVD

Affected Software

31 affected componentsFixes available
redhat/jbcs-httpd24-openssl<1:1.1.1k-14.el8
1:1.1.1k-14.el8
redhat/jbcs-httpd24-openssl<1:1.1.1k-14.el7
1:1.1.1k-14.el7
redhat/edk2<0:20220126gitbb1bba3d77-4.el8
0:20220126gitbb1bba3d77-4.el8
redhat/openssl<1:1.1.1k-9.el8_7
1:1.1.1k-9.el8_7
redhat/edk2<0:20220126gitbb1bba3d77-2.el8_6.1
0:20220126gitbb1bba3d77-2.el8_6.1
redhat/openssl<1:1.1.1k-9.el8_6
1:1.1.1k-9.el8_6
redhat/openssl<1:3.0.1-47.el9_1
1:3.0.1-47.el9_1
redhat/edk2<0:20221207gitfff6d81270b5-9.el9_2
0:20221207gitfff6d81270b5-9.el9_2
redhat/openssl<1:3.0.1-46.el9_0
1:3.0.1-46.el9_0
redhat/jws5-tomcat-native<0:1.2.31-14.redhat_14.el7
0:1.2.31-14.redhat_14.el7
redhat/jws5-tomcat-native<0:1.2.31-14.redhat_14.el8
0:1.2.31-14.redhat_14.el8
redhat/jws5-tomcat-native<0:1.2.31-14.redhat_14.el9
0:1.2.31-14.redhat_14.el9
rust/openssl-src>=300.0.0<300.0.12
300.0.12
rust/openssl-src<111.25.0
111.25.0
IBM Cloud Pak for Business Automation<=V22.0.2 - V22.0.2-IF004
IBM Cloud Pak for Business Automation<=V21.0.3 - V21.0.3-IF020
IBM Cloud Pak for Business Automation<=V22.0.1 - V22.0.1-IF006 and later fixesV21.0.2 - V21.0.2-IF012 and later fixesV21.0.1 - V21.0.1-IF007 and later fixesV20.0.1 - V20.0.3 and later fixesV19.0.1 - V19.0.3 and later fixesV18.0.0 - V18.0.2 and later fixes
debian/openssl
1.1.1w-0+deb11u11.1.1n-0+deb11u53.0.14-1~deb12u13.0.14-1~deb12u23.3.2-1
OpenSSL OpenSSL>=1.0.2<1.0.2zg
OpenSSL OpenSSL>=1.1.1<1.1.1t
OpenSSL OpenSSL>=3.0.0<3.0.8
Stormshield Stormshield Management Center<3.3.3
f5 BIG-IP>=17.0.0<=17.1.0
17.1.0.1
f5 BIG-IP>=16.1.0<=16.1.3
16.1.4
f5 BIG-IP>=15.1.0<=15.1.9
15.1.10
f5 BIG-IP>=14.1.0<=14.1.5
f5 BIG-IP>=13.1.0<=13.1.5
f5 BIG-IQ Centralized Management>=8.0.0<=8.4.0
f5 BIG-IQ Centralized Management=7.1.0
f5 F5OS-A=1.3.1
f5 Traffix SDC=5.2.0

Event History

Jan 25, 2023
Data Sourced
via Red Hat·03:33 PM
DescriptionSeverityAffected Software
Feb 7, 2023
CVE Published
12:00 AM
Feb 8, 2023
CVE Published
via MITRE·07:03 PM
Data Sourced
via MITRE·07:03 PM
DescriptionWeakness
Data Sourced
via NVD·08:15 PM
RemedyDescriptionSeverityWeaknessAffected Software
Advisory Published
via GitHub·10:28 PM
Mar 13, 2023
Advisory Published
via F5·04:46 PM
Jun 28, 2024
Data Sourced
via Launchpad·02:31 AM
Description
Sep 16, 2024
Data Sourced
via Ubuntu·03:45 AM
RemedyDescriptionSeverityAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is CVE-2023-0215?

CVE-2023-0215 is a use-after-free vulnerability found in OpenSSL's BIO_new_NDEF function.

2

How does the vulnerability in CVE-2023-0215 manifest?

The vulnerability in CVE-2023-0215 manifests as a use-after-free vulnerability in the BIO_new_NDEF function.

3

Which software versions are affected by CVE-2023-0215?

OpenSSL versions 1.0.2 to 1.0.2zg, 1.1.1 to 1.1.1t, and 3.0.0 to 3.0.8 are affected by CVE-2023-0215.

4

What is the severity of CVE-2023-0215?

CVE-2023-0215 has a severity rating of high.

5

Are there any references related to CVE-2023-0215?

Yes, you can find references related to CVE-2023-0215 at the following links: [Reference 1](https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=8818064ce3c3c0f1b740a5aaba2a987e75bfbafd), [Reference 2](https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=9816136fe31d92ace4037d5da5257f763aeeb4eb), [Reference 3](https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=c3829dd8825c654652201e16f8a0a0c46ee3f344).

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203