Miggo Logo

CVE-2024-0853:
curl inadvertently kept the SSL session ID for connections in its cache even when the verify...

5.3

CVSS Score
3.1

Basic Information

EPSS Score
0.37212%
Published
2/3/2024
Updated
5/3/2024
KEV Status
No
Technology
-

Technical Details

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

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability CVE-2024-0853 in curl allows bypassing OCSP stapling verification when a TLS session is reused. My analysis of the provided commit information pinpoints the servercert function in lib/vtls/openssl.c as the locus of the vulnerability.

The issue stems from two key changes/omissions:

  1. Commit 395365ad2d9a6c3f1a35d modified servercert to skip the verifystatus call (which performs the OCSP check) if the reused_session flag was true. This flag is set in ossl_connect_step1 when a session ID is found in the cache and reused.
  2. Crucially, before the fix in commit c28e9478cb2548848ec, the servercert function did not remove a session ID from curl's cache even if the verifystatus check failed for that session. This meant a session ID corresponding to a connection with a failed OCSP check could persist in the cache.

The combination of these two points created the vulnerability: a 'bad' session ID (from a failed OCSP check) could be cached, and if this session ID was later reused for a new connection, servercert would then skip the OCSP check due to the reused_session flag being true.

The fixing commit c28e9478cb2548848ec directly addresses this by adding logic to servercert to explicitly remove the session ID from the cache (Curl_ssl_delsessionid) if verifystatus returns an error.

Therefore, servercert is identified as the vulnerable function because it contained the logic to skip the OCSP check on reused sessions and, prior to the fix, failed to ensure that only sessions with successful OCSP checks were eligible for reuse by not clearing out bad sessions from the cache. The function ossl_connect_step1 plays a role in enabling session reuse but the decision to skip the check and the failure to clear the cache reside within servercert.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

*url in**v*rt*ntly k*pt t** SSL s*ssion I* *or *onn**tions in its ***** *v*n w**n t** v*ri*y st*tus (*O*SP st*plin**) t*st **il**. * su*s*qu*nt tr*ns**r to t** s*m* *ostn*m* *oul* t**n su***** i* t** s*ssion I* ***** w*s still *r*s*, w*i** t**n skipp

Reasoning

T** vuln*r**ility *V*-****-**** in *url *llows *yp*ssin* O*SP st*plin* v*ri*i**tion w**n * TLS s*ssion is r*us**. My *n*lysis o* t** provi*** *ommit in*orm*tion pinpoints t** `s*rv*r**rt` *un*tion in `li*/vtls/op*nssl.*` *s t** lo*us o* t** vuln*r**i