CVE-2023-0215

Source
https://nvd.nist.gov/vuln/detail/CVE-2023-0215
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2023-0215.json
Aliases
Related
Published
2023-02-08T20:15:24Z
Modified
2024-02-04T11:10:13.289092Z
Details

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 BIO_pop() 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 SMIMEwrite_PKCS7.

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

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

References

Affected packages

Alpine:v3.14 / openssl

Package

Name
openssl

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0The exact introduced commit is unknown
Fixed
1.1.1t-r0

Alpine:v3.15 / openssl

Package

Name
openssl

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0The exact introduced commit is unknown
Fixed
1.1.1t-r0

Alpine:v3.15 / openssl3

Package

Name
openssl3

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0The exact introduced commit is unknown
Fixed
3.0.8-r0

Alpine:v3.16 / openssl

Package

Name
openssl

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0The exact introduced commit is unknown
Fixed
1.1.1t-r0

Alpine:v3.16 / openssl3

Package

Name
openssl3

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0The exact introduced commit is unknown
Fixed
3.0.8-r0

Alpine:v3.17 / openssl

Package

Name
openssl

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0The exact introduced commit is unknown
Fixed
3.0.8-r0

Alpine:v3.18 / openssl

Package

Name
openssl

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0The exact introduced commit is unknown
Fixed
3.0.8-r0

Alpine:v3.19 / openssl

Package

Name
openssl

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0The exact introduced commit is unknown
Fixed
3.0.8-r0

Git / github.com/openssl/openssl

Affected ranges

Affected versions

Other

OpenSSL_1_0_2u