kcve.ai취약점 정보 · 내 자산 확인

CVE-2022-4450 Double free after calling PEM_read_bio_ex

PEM_read_bio_ex를 호출한 후 이중 해제(Double free)

설명

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.

PEM_read_bio_ex() 함수는 BIO로부터 PEM 파일을 읽고 "name"을 파싱하고 디코딩합니다(예: . "인증서", 모든 헤더 데이터 및 페이로드 데이터. 함수가 성공하면 "name_out", "header" 및 "data" 인수는 관련 디코딩된 데이터를 포함하는 버퍼에 대한 포인터로 채워집니다. 호출자는 버퍼를 해제할 책임이 있습니다. a 를 만드는 것이 가능하다. 페이로드 데이터의 0 바이트를 초래하는 PEM 파일. 이 경우 PEM_read_bio_ex()는 실패 코드를 반환하지만 이미 해제된 버퍼에 대한 포인터로 헤더 인수를 채웁니다. 호출자가 이 버퍼를 해제하면 이중 해제(double free)이 발생합니다. 이것은 아마 충돌로 이어질 것입니다. 이 공격은 서비스 거부 공격을 달성하기 위해 악의적인 PEM 파일을 제공할 수 있는 공격자가 악용할 수 있습니다. PEM_read_bio() 함수와 PEM_read() 함수는 간단한 래퍼입니다. PEM_read_bio_ex()와 이 함수들은 또한 직접적으로 영향을 받습니다. 이러한 함수는 PEM_X509_INFO_read_bio_ex()를 포함한 여러 다른 OpenSSL 함수에 의해 간접적으로 호출됩니다. SSL_CTX_use_serverinfo_file() 또한 취약합니다. PEM_read_bio_ex()가 실패 코드를 반환하는 경우 호출자가 헤더 인수를 해제하지 않기 때문에 이러한 함수의 일부 OpenSSL 내부 사용은 취약하지 않습니다. 이러한 위치는 PEM_read_bio_TYPE() 함수와 이에 도입된 디코더를 포함합니다. OpenSSL 3.0. OpenSSL asn1parse 명령줄 응용 프로그램도 이 문제의 영향을 받습니다.

영향 받는 제품 제품 1개

  • OpenSSL

    OpenSSL

    해결 버전 있음

    영향 받는 버전

    • 3.0.0 이상 3.0.8 미만
    • 1.1.1 이상 1.1.1t 미만

    해결 버전

    • 3.0.8 이상
    • 1.1.1t 이상

참고 자료 4건

‹ 목록

점검 지원 범위 문의

도입 문의