BIT-libphp-2026-129438: Incorrect RFC 3986 URI serialization for oversized input
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.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
bitnami/libphpto a version that resolves this vulnerability.Fixed in 8.5.13 - Upgrade
Upgrade
bitnami/phpto a version that resolves this vulnerability.Fixed in 8.5.13 - Upgrade
Upgrade
bitnami/php-minto 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 deployments are affected?
PHP 8.5 releases before 8.5.13 are affected when they use the Uri\Rfc3986\Uri class to serialize URIs. The affected packages listed are bitnami/libphp, bitnami/php, and bitnami/php-min.
What must an attacker be able to do to trigger the issue?
The application must accept attacker-controlled URI data whose serialized form is approximately 2 GiB, have sufficient memory to process it, and rely on the serialization result. No privileges or user interaction are required according to the provided severity vector.
What is the practical impact?
Serialization methods including toString() and toRawString() can return a truncated or invalid URI rather than reporting an error. If the application trusts that output, it may make incorrect validation or routing decisions, while the required large allocations can also exhaust memory.
Are all PHP URI parsers affected?
No. parse_url() and Uri\WhatWg\Url are explicitly identified as not affected.
What can be done if upgrading is not immediately possible?
Do not allow untrusted URI inputs to approach approximately 2 GiB, and avoid trusting Uri\Rfc3986\Uri serialization output for validation or routing when handling oversized input. Upgrade affected PHP 8.5 installations to 8.5.13 or later when possible.