CVE-2026-129438: Incorrect RFC 3986 URI serialization for oversized input
Fixed (Incorrect RFC 3986 URI serialization for oversized input). (CVE-2026-129438)
Other sources
Incorrect RFC 3986 URI serialization for oversized input.
The Uri\Rfc3986\Uri class does not correctly handle the output-size limit and errors of the uriparser library when converting a URI back to a string. For a URI whose string representation reaches approximately 2 GiB, toString(), toRawString() and other serializing operations can return a truncated or invalid string instead of an error. An application that accepts attacker-controlled URI data of that size, has enough memory to process it and trusts the result may make incorrect validation or routing decisions, and the large allocations can exhaust memory. parseurl() and Uri\WhatWg\Url are not affected.
This issue affects PHP versions 8.5. before 8.5.13.
— MITRE
PHP's RFC 3986 URI implementation can return an incorrect string when a very large URI is converted back to text. An application that accepts attacker-controlled URI data and has enough memory to process it may receive a truncated or invalid URI instead of an error. Processing these inputs can also exhaust memory or terminate the PHP process. This affects the Uri\Rfc3986\Uri class introduced in PHP 8.5.0. The legacy parseurl() function and the separate Uri\WhatWg\Url implementation are not affected by this issue.
— OSV
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.5.13 - Upgrade
Upgrade
PHPto a version that resolves this vulnerability.Fixed in 8.5.13
Event History
Frequently Asked Questions
Which applications are realistically exposed to this issue?
Applications using the Uri\Rfc3986\Uri class and serializing attacker-controlled URIs are exposed when URI text can approach approximately 2 GiB and the application has sufficient memory to process it. The application must also rely on the serialized result for validation, routing, or other security-relevant decisions.
Does this affect PHP URI parsing generally?
No. parse_url() and Uri\WhatWg\Url are not affected; the issue is specific to serialization operations on Uri\Rfc3986\Uri, including toString() and toRawString().
What can happen if exploitation is successful?
Serialization can return a truncated or invalid URI instead of reporting an error, which can lead to incorrect validation or routing decisions if the result is trusted. Processing the oversized input can also exhaust memory or terminate the PHP process.
Which PHP releases are known to be affected?
PHP 8.5 releases before 8.5.13 are affected. The affected functionality is the RFC 3986 URI implementation introduced in PHP 8.5.