Technical impact
A function in OpenSSL, PEM_X509_INFO_read_bio_ex(), attempts to add certificates, CRLs and keys from PEM data to a caller-supplied stack. If the read fails, the function frees every node in the stack—including those previously present—yet leaves the freed pointers in the stack. Subsequent accesses to the stack can therefore use memory that has already been freed, causing a crash or, in principle, memory corruption. The flaw is a classic use‑after‑free condition (CWE‑416).
Affected Systems
The issue exists in any OpenSSL build that exposes the PEM_X509_INFO_read_bio_ex() family of functions and allows callers to provide an existing stack (i.e., a non‑NULL stack pointer). The vulnerability also applies to the older PEM_X509_INFO_read_bio(), PEM_X509_INFO_read() and PEM_X509_INFO_read_ex() variants found in OpenSSL 1.1.1 and 1.0.2. The problem does not affect OpenSSL’s internal callers, which always pass NULL, nor any deployment that never supplies an existing stack. Applications that load PEM data into a pre‑built list of X509_INFO structures for reuse are the only ones potentially impacted.
Risk and Exploitability
Because the attacker must supply malformed PEM data to trigger the failure and the target must be executing code that passes a pre‑existing stack, the attack vector is limited to a small subset of applications. The precise attack path is inferred from the description: an application that calls the affected function with a non‑null stack and then continues to use or free that stack after a failure may experience a use‑after‑free scenario. No EPSS score is available and the vulnerability is not listed in CISA’s KEV catalog, indicating no well‑known exploitation at this time. Nevertheless, the flaw could lead to program termination or, if exploited carefully, memory corruption that might be leveraged for further compromise in sensitive deployments.