Skip to content
Crypto Disclosed report Advanced CVE-2020-8286

CVE-2020-8286: Inferior OCSP verification

cURL's OCSP verification did not check that the certificate serial number in the stapled OCSP response matched the peer certificate's serial number. An attacker could substitute a valid OCSP response from a different certificate, causing cURL to accept a revoked certificate as valid.

ospoco Follow

Originally disclosed on HackerOne

Medium 6.6 View original
  • Triaged in 41 hours
  • Fixed in 7 days
  • Paid in 41 hours
  • Disclosed after 8 days

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.

The original report as published on HackerOne, by ospoco. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Impact

An attacker could cause a validated connection to an attacker-controlled site by substituting the OCSP response, even though the certificate was revoked.

What the attacker needed

Attacker can substitute the OCSP response; attacker has a valid OCSP response from same issuer

The fix

The text includes a suggested patch, but does not state that it was applied or released.

How it was found

  1. Identify a site with a revoked certificate.
  2. Obtain a valid OCSP response for a site signed by the same issuer as the revoked site.
  3. Run the test program against the revoked site without replacing the OCSP response; cURL correctly fails.
  4. Run the test program again, replacing the OCSP response with the one from the valid site; cURL succeeds.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

When a website's certificate is revoked, browsers and tools like cURL should refuse to connect. They check a signed message called an OCSP response to confirm the certificate is still good. This bug meant cURL accepted an OCSP response that was meant for a different certificate, so it wrongly trusted a revoked site.

What is Crypto?

Encryption, signatures, randomness or certificate checks that do not protect what they claim to.

More from curl

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Cryptographic weaknesses

The lesson behind this report.

Encryption, signatures, randomness or certificate checks that do not protect what they claim to.