CVE-2024-0853:
curl inadvertently kept the SSL session ID for connections in its cache even when the verify...
5.3
Basic Information
Technical Details
Vulnerability Intelligence
Miggo AI
Root 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:
- Commit
395365ad2d9a6c3f1a35d
modifiedservercert
to skip theverifystatus
call (which performs the OCSP check) if thereused_session
flag was true. This flag is set inossl_connect_step1
when a session ID is found in the cache and reused. - Crucially, before the fix in commit
c28e9478cb2548848ec
, theservercert
function did not remove a session ID from curl's cache even if theverifystatus
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
.