GHSA-4646-p932-gw34 / CVE-2026-129506: SOAP use-after-free when processing DTD entity references
- Published:
- Fetched:
- Updated:
- Affects:
- php ext-soap
https://github.com/php/php-src/security/advisories/GHSA-4646-p932-gw34 ↗
SOAP use-after-free when processing DTD entity references ### Summary PHP's SOAP extension can read freed memory while processing XML containing a document type definition (DTD) and an entity reference in an attribute value. An unauthenticated attacker who can send a crafted request to an exposed SOAP endpoint can crash the PHP process handling it. Applications that load attacker-controlled WSDL or imported schema documents can also be affected. ### Details While cleaning up a parsed XML document, PHP frees the DTD even though attribute values can still refer to content it owns. Processing those attributes can then access freed memory. Removing the DTD also bypasses the SOAP server's normal rejection of documents containing a DTD. The fix keeps the DTD alive for as long as the XML document needs it and restores the existing SOAP DTD check. The issue predates the changes made for [CVE-2026-91765](https://github.com/php/php-src/security/advisories/GHSA-rgrp-mwpx-f6rm) and affects earlier releases in all supported PHP branches. ### Impact Exploitation requires the SOAP extension and an application that processes attacker-controlled SOAP XML, WSDL or schema content. Authentication does not protect an endpoint if the application parses the SOAP request before authenticating it. A crafted document can crash the PHP worker or process, and repeated requests can disrupt service. The original report also described corrupted type information after freed memory was reused. Disclosure of sensitive process memory and arbitrary code execution have not been confirmed. ### Affected versions SOAP server requests have been affected since PHP 5.6.0. The same cleanup has applied to WSDL and schema documents since PHP 5.0.0, but loading an untrusted WSDL or schema is not considered a security issue. This is based on code inspection. ### Mitigation Upgrade to the fixed release for your PHP branch when it becomes available. Until then, restrict access to affected SOAP endpoints or disable them where practical. Load WSDL and imported schemas only from trusted, controlled sources. If untrusted SOAP requests must be accepted, reject documents containing a DTD before they reach the SOAP extension. Any such filter must correctly handle the XML encodings and request-body transformations accepted by the application. A simple text search is not a complete mitigation. Affected packages: php:ext-soap Patched: ext-soap 8.2.36, ext-soap 8.3.37, ext-soap 8.4.28, ext-soap 8.5.13