[Debian] CVE: CVE-2022-4450/CVE-2023-0215: openssl: multi CVEs

Bug #2009336 reported by Yue Tao
256
This bug affects 1 person
Affects Status Importance Assigned to Milestone
StarlingX
Fix Released
High
Li Zhou

Bug Description

CVE-2022-4450: https://nvd.nist.gov/vuln/detail/CVE-2022-4450

The function PEM_read_bio_ex() reads a PEM file from a BIO and parses and decodes the "name" (e.g. "CERTIFICATE"), any header data and the payload data. If the function succeeds then the "name_out", "header" and "data" arguments are populated with pointers to buffers containing the relevant decoded data. The caller is responsible for freeing those buffers. It is possible to construct a PEM file that results in 0 bytes of payload data. In this case PEM_read_bio_ex() will return a failure code but will populate the header argument with a pointer to a buffer that has already been freed. If the caller also frees this buffer then a double free will occur. This will most likely lead to a crash. This could be exploited by an attacker who has the ability to supply malicious PEM files for parsing to achieve a denial of service attack. The functions PEM_read_bio() and PEM_read() are simple wrappers around PEM_read_bio_ex() and therefore these functions are also directly affected. These functions are also called indirectly by a number of other OpenSSL functions including PEM_X509_INFO_read_bio_ex() and SSL_CTX_use_serverinfo_file() which are also vulnerable. Some OpenSSL internal uses of these functions are not vulnerable because the caller does not free the header argument if PEM_read_bio_ex() returns a failure code. These locations include the PEM_read_bio_TYPE() functions as well as the decoders introduced in OpenSSL 3.0. The OpenSSL asn1parse command line application is also impacted by this issue.

CVE-2023-0215: https://nvd.nist.gov/vuln/detail/CVE-2023-0215

The public API function BIO_new_NDEF 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 BIO_f_asn1 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 B64_write_ASN1() which may cause BIO_new_NDEF() to be called and will subsequently call BIO_pop() on the BIO. This internal function is in turn called by the public API functions PEM_write_bio_ASN1_stream, PEM_write_bio_CMS_stream, PEM_write_bio_PKCS7_stream, SMIME_write_ASN1, SMIME_write_CMS and SMIME_write_PKCS7. Other public API functions that may be impacted by this include i2d_ASN1_bio_stream, BIO_new_CMS, BIO_new_PKCS7, i2d_CMS_bio_stream and i2d_PKCS7_bio_stream. The OpenSSL cms and smime command line applications are similarly affected.

Score:
cve_id status cvss3Score av ac pr ui ai
CVE-2022-4450 fixed 7.5 N L N N H

CVE-2023-0215 fixed 7.5 N L N N H

References:
['libssl1.1_1.1.1n-0+deb11u3_amd64.deb===>libssl1.1_1.1.1n-0+deb11u4_amd64.deb', 'libssl-dev_1.1.1n-0+deb11u3_amd64.deb===>libssl-dev_1.1.1n-0+deb11u4_amd64.deb', 'openssl_1.1.1n-0+deb11u3_amd64.deb===>openssl_1.1.1n-0+deb11u4_amd64.deb']

Yue Tao (wrytao)
Changed in starlingx:
importance: Undecided → High
status: New → Triaged
information type: Public → Public Security
tags: added: stx.9.0 stx.security
Yue Tao (wrytao)
Changed in starlingx:
assignee: nobody → Li Zhou (lzhou2)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tools (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/starlingx/tools/+/877073

Changed in starlingx:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tools (master)

Reviewed: https://review.opendev.org/c/starlingx/tools/+/877073
Committed: https://opendev.org/starlingx/tools/commit/875df53cafcc10a63479777d37ac24aceff58da2
Submitter: "Zuul (22348)"
Branch: master

commit 875df53cafcc10a63479777d37ac24aceff58da2
Author: Li Zhou <email address hidden>
Date: Thu Mar 9 10:23:34 2023 +0800

    Debian: openssl: fix CVE-2022-4450/CVE-2023-0215

    Upgrade packages to below version to fix CVE-2022-4450/CVE-2023-0215:
    libssl1.1_1.1.1n-0+deb11u4_amd64.deb
    libssl-dev_1.1.1n-0+deb11u4_amd64.deb
    openssl_1.1.1n-0+deb11u4_amd64.deb

    Refer to:
    https://security-tracker.debian.org/tracker/CVE-2022-4450
    https://security-tracker.debian.org/tracker/CVE-2023-0215

    Test Plan:
    Pass: downloader
    Pass: build-pkgs --clean --all
    Pass: build-image
    Pass: boot

    Closes-bug: #2009336

    Signed-off-by: Li Zhou <email address hidden>
    Change-Id: Ieb7f59020e7e3e54bde0693f860d74850d10914b

Changed in starlingx:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public Security information  
Everyone can see this security related information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.