The vulnerability, CVE-2026-80229, is a heap-use-after-free in libcurl when using its multi interface with OpenSSL 3 provider configurations. The core issue is that a TLS connection, once pooled, could be reused even after the 'easy handle' that initiated it was destroyed. This easy handle held an OpenSSL library context (libctx) which was freed when the handle was destroyed. If the connection was then reused, it would attempt to access this freed libctx, resulting in a use-after-free.
The provided patch, identified by commit 7ea37abc6ac0120ba5f6d94be8d196f7cf1506bb, modifies the lib/vtls/openssl.c file. Specifically, it adds a conditional block within the Curl_ossl_ctx_init function. This block checks if OPENSSL_HAS_PROVIDERS is defined and if data->state.libctx exists. If both conditions are true, it calls connclose(data->conn) to explicitly forbid connection reuse. This change directly addresses the root cause by preventing the vulnerable scenario where a connection with an associated libctx could be reused after the libctx was freed.
Therefore, the Curl_ossl_ctx_init function is identified as the vulnerable function because, in its unpatched state, it failed to implement the necessary check and connection closure, allowing the use-after-free condition to arise. An attacker exploiting this vulnerability would trigger the execution path within Curl_ossl_ctx_init that lacked this connclose call, leading to the subsequent use-after-free when the connection is reused.