CVE-2025-6491: NULL Pointer Dereference in PHP SOAP Extension via Large XML Namespace Prefix
Fixed (NULL Pointer Dereference in PHP SOAP Extension via Large XML Namespace Prefix). (CVE-2025-6491)
Other sources
If a SoapVar instance is created with a fully qualified name larger than 2G, this will cause a NULL pointer dereference resulting in a segmentation fault, leading to a denial of service.
Libxml versions prior to 2.13 cannot correctly handle a call to xmlNodeSetName() with a name longer than 2G. It will leave the node object in an invalid state with a NULL name. This later causes a NULL pointer dereference when using the name during message serialization.
This can be exploited if a SoapVar is created with a fully qualified name that is longer than 2G. This would be possible if some application code uses a namespace prefix from an untrusted source like from a remote SOAP service.
— Red Hat
In PHP versions:8.1. before 8.1.33, 8.2. before 8.2.29, 8.3. before 8.3.23, 8.4. before 8.4.10 when parsing XML data in SOAP extensions, overly large (>2Gb) XML namespace prefix may lead to null pointer dereference. This may lead to crashes and affect the availability of the target server.
— MITRE
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 8.3.23 - Upgrade
Upgrade
PHP 8.1to a version that resolves this vulnerability.Fixed in 8.1.33 - Upgrade
Upgrade
PHP 8.2to a version that resolves this vulnerability.Fixed in 8.2.29 - Upgrade
Upgrade
PHP 8.3to a version that resolves this vulnerability.Fixed in 8.3.23 - Upgrade
Upgrade
PHP 8.4to a version that resolves this vulnerability.Fixed in 8.4.10 - Upgrade
Upgrade
libxmlto a version that resolves this vulnerability.Fixed in 2.13 - Compensating control
Ensure applications do not use a namespace prefix (or other fully-qualified name used in SoapVar) from an untrusted source such as a remote SOAP service; prevent attacker-controlled oversized (>2Gb) XML namespace prefixes/names from reaching PHP SOAP serialization.
Event History
Frequently Asked Questions
What is the severity of CVE-2025-6491?
CVE-2025-6491 has a high severity rating due to the potential for a denial of service via NULL pointer dereference.
What versions of PHP are affected by CVE-2025-6491?
CVE-2025-6491 affects PHP versions 8.1.* before 8.1.33, 8.2.* before 8.2.29, 8.3.* before 8.3.23, and 8.4.* before 8.4.10.
How do I fix CVE-2025-6491?
To fix CVE-2025-6491, upgrade to PHP version 8.3.23 or newer.
What impact does CVE-2025-6491 have on my web application?
CVE-2025-6491 can cause your web application to crash if it attempts to process excessively large XML namespace prefixes.
Is there a workaround for CVE-2025-6491?
There is no official workaround for CVE-2025-6491; upgrading to a patched PHP version is recommended.