OpenSSL clients using RPKs: OpenSSL TLS/DTLS RFC7250 Raw Public Key Handler flaw (CVE-2024-12797) #shorts

Summary

Today, we're diving into a recently published high-severity vulnerability within OpenSSL, identified as CVE-2024-12797. This flaw can enable man-in-the-middle attacks when certain conditions are met, and affects a range of OpenSSL versions below 3.4.1, specifically those leveraging RFC7250 Raw Public Keys.

Product details

OpenSSL is a robust, full-featured toolkit for the Transport Layer Security (TLS) and Secure Sockets Layer (SSL) protocols. It's commonly employed across a wide array of applications to ensure secure communications. Versions up to 3.2.3, 3.3.2, and 3.4.0 are affected by this particular vulnerability.

Vulnerability type summary

This vulnerability pertains to a missing report of error condition, categorized as CWE-392. It specifically affects the way OpenSSL handles RFC7250 Raw Public Keys during server-client verification processes.

Details of the vulnerability

In affected OpenSSL versions, when TLS or DTLS connections utilize raw public keys, there exists a risk of man-in-the-middle attacks. This occurs if the client fails to verify the server correctly due to the handshake not aborting as expected when an RPK mismatch occurs under SSL_VERIFY_PEER verification mode. Typically, clients rely on the handshake process to fail when the server’s RPK doesn't match any expected public keys. However, this vulnerability can permit the connection to proceed unnoticed, making the client susceptible to potential attacks.

Conclusion

It is crucial for users of OpenSSL versions 3.4.0, 3.3.0, and 3.2.0 to update immediately to the latest patched versions to avoid potential security compromises. Staying informed and proactive in applying security updates provides the best defense against vulnerabilities like CVE-2024-12797. For those using these OpenSSL versions in combination with RFC7250 RPKs, this update is especially critical.

Watch the full video on YouTube: CVE-2024-12797

Remediation and exploitation details

This chain involves the following actors

This following systems are involved

Attack entry point

Remediation actions

Exploitation actions

Related Content

NOTE: The following related content has not been vetted and may be unsafe.

CVE database technical details

CVE ID
CVE-2024-12797
Description
Issue summary: Clients using RFC7250 Raw Public Keys (RPKs) to authenticate a server may fail to notice that the server was not authenticated, because handshakes don't abort as expected when the SSL_VERIFY_PEER verification mode is set. Impact summary: TLS and DTLS connections using raw public keys may be vulnerable to man-in-middle attacks when server authentication failure is not detected by clients. RPKs are disabled by default in both TLS clients and TLS servers. The issue only arises when TLS clients explicitly enable RPK use by the server, and the server, likewise, enables sending of an RPK instead of an X.509 certificate chain. The affected clients are those that then rely on the handshake to fail when the server's RPK fails to match one of the expected public keys, by setting the verification mode to SSL_VERIFY_PEER. Clients that enable server-side raw public keys can still find out that raw public key verification failed by calling SSL_get_verify_result(), and those that do, and take appropriate action, are not affected. This issue was introduced in the initial implementation of RPK support in OpenSSL 3.2. The FIPS modules in 3.4, 3.3, 3.2, 3.1 and 3.0 are not affected by this issue.
Provider
openssl
CWE / problem types
CWE-392 Missing Report of Error Condition
Affected Software Versions
OpenSSL:OpenSSL:[{'lessThan': '3.4.1', 'status': 'affected', 'version': '3.4.0', 'versionType': 'semver'}, {'lessThan': '3.3.3', 'status': 'affected', 'version': '3.3.0', 'versionType': 'semver'}, {'lessThan': '3.2.4', 'status': 'affected', 'version': '3.2.0', 'versionType': 'semver'}]
Date Published
2025-02-11T15:59:36.719Z
Last Updated
2025-02-18T14:01:55.140Z