A use-after-free vulnerability exists in the SOAP extension of libphp when processing DTD entity references. This flaw allows the SOAP extension to free the document type definition (DTD) of a parsed XML document while attribute values still reference entities it owns, leading to reading freed memory. This also bypasses the SOAP server's rejection of documents containing a DTD. An unauthenticated remote attacker can send crafted requests to a SOAP endpoint or control a WSDL/schema document to crash the PHP process, causing denial of service. Memory disclosure and code execution have not been confirmed. The issue affects PHP versions before 8.2.36, 8.3.37, 8.4.28, and 8.5.13 and has been fixed in those versions.