Lucene search

K
hackeroneOspocoH1:1048457
HistoryDec 01, 2020 - 8:53 p.m.

curl: CVE-2020-8286: Inferior OCSP verification

2020-12-0120:53:56
ospoco
hackerone.com
192

7.5 High

CVSS3

Attack Vector

NETWORK

Attack Complexity

LOW

Privileges Required

NONE

User Interaction

NONE

Scope

UNCHANGED

Confidentiality Impact

NONE

Integrity Impact

HIGH

Availability Impact

NONE

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N

5 Medium

CVSS2

Access Vector

NETWORK

Access Complexity

LOW

Authentication

NONE

Confidentiality Impact

NONE

Integrity Impact

PARTIAL

Availability Impact

NONE

AV:N/AC:L/Au:N/C:N/I:P/A:N

0.003 Low

EPSS

Percentile

62.4%

cURL (in /lib/vtls/openssl.c) does not check that the certificate serial number in the stapled OCSP response matches the serial number of the certificate it is trying to validate (the peer certificate). This results in a passed validity challenge even when connecting to a site that has had its certificate revoked.
An example program showing the vulnerability and a suggested patch are included.

EXAMPLE:

  1. Identify a site with a revoked certificate. (https://revoked.grc.com)
  2. Obtain a valid OCSP response for a site signed by the same issuer as
    the revoked site. (https://www.grc.com). See
    https://akshayranganath.github.io/OCSP-Validation-With-Openssl/ for a
    how-to. Use the ocsp option ‘respout’ to obtain the DER encoded OCSP
    response.
    Certificates for www.grc.com are provided. Use the following
    command to obtain an OCSP response for the example certificates:
    $ openssl ocsp -issuer grc_chain.pem -cert grc_cert.pem -text -url http://ocsp.digicert.com -respout grc_ocsp_resp.der
  3. See the OCSP behavior without replacing the OCSP response:
    $ ./curl_ocsp_vuln_test https://revoked.grc.com
    Curl Error: SSL server certificate status verification FAILED
    Curl correctly fails.
  4. See the OCSP behavior when replacing the OCSP response with that
    from www.grc.com:
    $ ./curl_ocsp_vuln_test https://revoked.grc.com --replace_ocsp grc_ocsp_resp.der
    <!DOCTYPE html PUBLIC…

The result is that cURL succeeds despite the site having a revoked certificate.

Impact

Certificates are usually revoked because important information, such as the private key, has become known. This could allow an attacker to cause a “validated” connection to an attacker-controlled site by substituting the OCSP response.

7.5 High

CVSS3

Attack Vector

NETWORK

Attack Complexity

LOW

Privileges Required

NONE

User Interaction

NONE

Scope

UNCHANGED

Confidentiality Impact

NONE

Integrity Impact

HIGH

Availability Impact

NONE

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N

5 Medium

CVSS2

Access Vector

NETWORK

Access Complexity

LOW

Authentication

NONE

Confidentiality Impact

NONE

Integrity Impact

PARTIAL

Availability Impact

NONE

AV:N/AC:L/Au:N/C:N/I:P/A:N

0.003 Low

EPSS

Percentile

62.4%