Issue summary: Calling the OpenSSL API function SSL_free_buffers may cause memory to be accessed that was previously freed in some situations
Impact summary: A use after free can have a range of potential consequences such as the corruption of valid data, crashes or execution of arbitrary code. However, only applications that directly call the SSL_free_buffers function are affected by this issue. Applications that do not call this function are not vulnerable. Our investigations indicate that this function is rarely used by applications.
The SSL_free_buffers function is used to free the internal OpenSSL buffer used when processing an incoming record from the network. The call is only expected to succeed if the buffer is not currently in use. However, two scenarios have been identified where the buffer is freed even when still in use.
The first scenario occurs where a record header has been received from the network and processed by OpenSSL, but the full record body has not yet arrived. In this case calling SSL_free_buffers will succeed even though a record has only been partially processed and the buffer is still in use.
The second scenario occurs where a full record containing application data has been received and processed by OpenSSL but the application has only read part of this data. Again a call to SSL_free_buffers will succeed even though the buffer is still in use.
While these scenarios could occur accidentally during normal operation a malicious attacker could attempt to engineer a stituation where this occurs. We are not aware of this issue being actively exploited.
The FIPS modules in 3.3, 3.2, 3.1 and 3.0 are not affected by this issue.
Referencing memory after it has been freed can cause a program to crash, use unexpected values, or execute code.
Name | Vendor | Start Version | End Version |
---|---|---|---|
Red Hat Enterprise Linux 9 | RedHat | openssl-1:3.2.2-6.el9_5 | * |
Red Hat Enterprise Linux 9 | RedHat | openssl-1:3.2.2-6.el9_5 | * |
Edk2 | Ubuntu | devel | * |
Edk2 | Ubuntu | focal | * |
Edk2 | Ubuntu | jammy | * |
Edk2 | Ubuntu | mantic | * |
Edk2 | Ubuntu | noble | * |
Edk2 | Ubuntu | oracular | * |
Nodejs | Ubuntu | jammy | * |
Openssl | Ubuntu | devel | * |
Openssl | Ubuntu | fips-preview/jammy | * |
Openssl | Ubuntu | fips-updates/focal | * |
Openssl | Ubuntu | fips-updates/jammy | * |
Openssl | Ubuntu | fips/focal | * |
Openssl | Ubuntu | focal | * |
Openssl | Ubuntu | jammy | * |
Openssl | Ubuntu | mantic | * |
Openssl | Ubuntu | noble | * |
Openssl | Ubuntu | oracular | * |
The use of previously-freed memory can have any number of adverse consequences, ranging from the corruption of valid data to the execution of arbitrary code, depending on the instantiation and timing of the flaw. The simplest way data corruption may occur involves the system’s reuse of the freed memory. Use-after-free errors have two common and sometimes overlapping causes:
In this scenario, the memory in question is allocated to another pointer validly at some point after it has been freed. The original pointer to the freed memory is used again and points to somewhere within the new allocation. As the data is changed, it corrupts the validly used memory; this induces undefined behavior in the process. If the newly allocated data happens to hold a class, in C++ for example, various function pointers may be scattered within the heap data. If one of these function pointers is overwritten with an address to valid shellcode, execution of arbitrary code can be achieved.