ext/openssl: Memory corruption (zend_mm_heap corrupted) in openssl_encrypt with AES-WRAP-PAD

Kurzinfo

Metadaten

  • Original (extern): Link oeffnen
  • Veroeffentlicht: 2026-07-02 16:56 UTC
  • Importiert: 2026-10-21 14:15 UTC
  • CVSS: 5.6
  • Quelle-ID: php_sec
  • uid_hash: bc31ed7d2f068dfd43b6ad8a0f5b7f057862b07e7f4c87fadea4a0219f48ec73

Inhalt

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.

Verknuepfte CVEs

CVE-ID Severity (Quelle) CVSS (Quelle) Severity (CVE.org) CVSS (CVE.org) EPSS EPSS-Pctl Veroeffentlicht (CVE.org)

CVE-2026-14355

MEDIUM

5.6

MEDIUM

5.6

2026-07-03

Quellen-Details

Bezeichnung Name Kategorie Tags Zielgruppe Sprache Feed-URL
PHP Security (php/php-src GHSA)

php_sec

vendor_advisory php, runtime - de https://github.com/php/php-src/security/advisories