| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| cryptography |
| pip |
| >= 42.0.0, < 44.0.1 |
| 44.0.1 |
The vulnerability, CVE-2024-12797, relates to OpenSSL's handling of RFC7250 Raw Public Keys (RPKs) where client handshakes do not abort as expected if server authentication fails when SSL_VERIFY_PEER is set. The provided OpenSSL commits (e.g., 738d4f9fdeaad57660dcba50a619fafced3fd5e9) clearly show modifications to the tls_post_process_server_rpk function in ssl/statem/statem_clnt.c.
The patch introduces logic to check the return value of ssl_verify_rpk and, if verification fails (v_ok <= 0) and sc->verify_mode is not SSL_VERIFY_NONE (implying SSL_VERIFY_PEER is active), it calls SSLfatal to abort the connection. This directly addresses the described vulnerability where the connection previously did not abort.
Therefore, tls_post_process_server_rpk is the primary vulnerable function as it contained the flawed logic. The function ssl_verify_rpk is also relevant as it performs the RPK verification, and its output was previously mishandled by tls_post_process_server_rpk.
The pyca/cryptography library is affected because it bundles this vulnerable version of OpenSSL. The vulnerable functions are part of the OpenSSL C code, not Python code within cryptography itself. The analysis focuses on the C functions in OpenSSL as these are the ones directly containing the vulnerability logic that would be active at runtime during a TLS handshake using RPKs.