GHSA-7jrw-539f-x6vr / CVE-2026-14355: ext/openssl: Memory corruption (zend_mm_heap corrupted) in openssl_encrypt with AES-WRAP-PAD
- Published:
- Fetched:
- Updated:
- Affects:
- php php-src
https://github.com/php/php-src/security/advisories/GHSA-7jrw-539f-x6vr ↗
ext/openssl: Memory corruption (zend_mm_heap corrupted) in openssl_encrypt with AES-WRAP-PAD ### Summary Usate of AES-WRAP-PAD can result in memory corruption and abort of application. ### Details The output buffer for the AES key-wrap-with-padding operation is sized from the plaintext length without accounting for RFC 5649 expansion. Key-wrap-with-pad rounds the plaintext up to the next 8-byte boundary and prepends an 8-byte AIV, so ciphertext length is roundup(len, 8) + 8, not a function of the raw input length. The zend_string PHP allocates is therefore too small for what OpenSSL's EVP_EncryptUpdate/EVP_EncryptFinal writes. OpenSSL writes the full wrapped output past the end of the undersized heap allocation, corrupting adjacent Zend MM heap metadata. This surfaces as the zend_mm_heap corrupted abort — the allocator detecting corrupted bookkeeping on a later operation, not at the moment of the overflow. Further details in https://github.com/php/php-src/issues/22186 ### Impact If the attacker is able to find implementation using this rarely used algorithm, it can potentially abort the application and possibly cause DoS for the application. Patched: 8.2.32, 8.3.32, 8.4.23, 8.5.8