PHP 8.5 added a URI extension with two parsers, Uri\Rfc3986\Uri on top of the uriparser C library and Uri\WhatWg\Url on top of a WHATWG implementation. The RFC 3986 class did not handle uriparser’s output-size limit and its error returns correctly when turning a parsed URI back into a string: for a URI whose serialised form reaches roughly 2 GiB, toString(), toRawString() and the other serialising operations can return a truncated or invalid string rather than throwing. The PHP Group says 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 that the allocations involved can exhaust memory. Update to PHP 8.5.13, and put a byte-length limit on untrusted URIs well below 2 GiB whether or not you have.
CVE-2026-129438 at a glance.
| Component | PHP, the URI extension (ext/uri) introduced in 8.5: the Uri\Rfc3986\Uri class’s serialisation path over the bundled uriparser library. parse_url() and Uri\WhatWg\Url are not affected |
| Affected versions | PHP 8.5.0 through 8.5.12 only, per the PHP Group record; 8.2, 8.3 and 8.4 have no URI extension and are not affected. The advisory says updating the uriparser library alone does not fix it, since the size calculation is in PHP’s binding |
| Fixed in | PHP 8.5.13, released 19 November 2026 (and 8.6.0 the same day). Ubuntu: USN-9185-1 for the php8.5 packages on 26.04 and 26.10; Debian and Red Hat Enterprise Linux ship no 8.5 and mark themselves not affected; SUSE Tumbleweed 8.5.13-1.1 |
| Severity | PHP Group (CNA) CVSS 4.0 6.3 Medium (AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:L/VA:L), CWE-190 (integer overflow) and CWE-252 (unchecked return value). Red Hat rates it Moderate, CVSS 3.1 4.8 (AC:H); SUSE moderate at 6.5; Ubuntu Medium; NVD Awaiting Analysis with the CNA score only |
| Exploited in the wild | Not on CISA’s Known Exploited Vulnerabilities list as of 1 December 2026 (catalogue 2026.11.30). EPSS 0.00562 (40.5th percentile) on 30 November 2026 |
| Who is exposed | PHP 8.5 applications that build a Uri\Rfc3986\Uri from input the request controls and then act on its string form: routing, allow-list checks, redirect validation. The precondition is severe: the URI’s serialised form has to approach 2 GiB, so the request body has to be that large, the application has to accept it, and the worker has to have the memory to hold it, which post_max_size and memory_limit normally forbid. The realistic effects are the memory exhaustion of a worker that tries, and a wrong decision in an application that has lifted those limits |
| Published | PHP advisory GHSA-mg3p-mxj9-g2mm and CVE record 19 November 2026; this page built 1 December 2026, last updated 1 December 2026 |
What it is
uriparser serialises a URI into a caller-supplied buffer and reports how much it wrote, with an error code when the buffer is too small or the output would exceed what it can address. PHP’s binding computes the size it needs for the output string and allocates it, and that calculation wraps at the 32-bit boundary, about 2,147,483,647 bytes; past it the binding either asks for too little or misreads the library’s error as success. The result is a PHP string that is shorter than the URI it claims to represent, or one that is not a valid URI at all, handed back from a method the caller expects either to succeed or to throw. That is CWE-190 for the wrap and CWE-252 for the ignored error, together.
What an attacker gains is a URI that validates as one thing and serialises as another, which matters only where the application checks a URI object and then uses the string. The advisory’s own framing is cautious: it needs attacker-controlled URI data of that size, enough memory to process it, and an application that trusts the result, and it notes that the large allocations on the way can exhaust memory before anything else happens. The AT:P in the vector is those conditions. On a default PHP-FPM pool the request would be refused by post_max_size long before the parser saw it.
The fix makes the binding honour uriparser’s limit and its error codes, so an oversized URI throws. It is PHP’s code, not the library’s, which is why the advisory says that upgrading uriparser does not help; the related CVE-2026-48841 in uriparser 1.0.3 was bundled in the same release. The advisory credits Sahan-Chathumina-25 with the report and TimWolla and alexandre-daubois with the fix, and names no commit.
Who is affected on Linux
Each row is what the distribution’s own security tracker said on 1 December 2026; the link in the row is the tracker page, which will be newer than this one. Only distributions that ship PHP 8.5 carry the bug.
| Distribution | Status | Fixed package |
|---|---|---|
| Alpine | Not consulted for this page; the Alpine tracker refused automated readers on earlier runs | — |
| Debian | Not affected: Debian ships no PHP 8.5; the tracker’s notes say both php8.2 and php8.4 are not affected (the per-suite table shows them as “fixed”, which is the tracker’s way of saying the same). No DSA or DLA | — |
| Ubuntu | Priority Medium; php8.5 fixed on 26.04 and 26.10 by USN-9185-1 of 23 November 2026; php8.1 (22.04) and php8.3 (24.04) not affected | 8.5.4-0ubuntu1.6 (26.04), 8.5.9-0ubuntu2.2 (26.10) |
| RHEL, Rocky, Alma, CentOS Stream | Moderate, CVSS 3.1 4.8; RHEL packages Not affected (no 8.5 stream); the only affected product is Red Hat Hardened Images, fixed in php-main-8.5.13-0.1.hum1 by RHSA-2026:101658; Bugzilla 2576611 | — (RHEL); Hardened Images 8.5.13 |
| openSUSE/SLE | Rated moderate, CVSS 3.1 6.5; openSUSE Tumbleweed fixed php8 >= 8.5.13-1.1; openSUSE Leap 16.1 Affected; SLES 16.1 In progress; SLES 15 SP4–SP7 Not affected | php8 8.5.13-1.1 (Tumbleweed) |
php.net source builds, Docker php:* images, Remi and Ondřej Surý repositories | The upstream release applies; a container keeps the old PHP until the image is rebuilt | PHP 8.5.13 |
How to check
Two questions: is this PHP 8.5 below 8.5.13, and does the application use Uri\Rfc3986\Uri on request data. The third question, whether the request limits would ever let a 2 GiB body through, is the one that decides whether this is urgent.
# 1. PHP 8.5 below 8.5.13 is the only affected build
php -v | head -1
dpkg -l 'php8.5*' 2>/dev/null | awk '/^ii/ {print $2, $3}'
rpm -q php 2>/dev/null
# 2. does the application use the RFC 3986 URI class on input?
grep -rnE 'Uri\\Rfc3986\\Uri|use Uri\\Rfc3986' --include='*.php' /var/www /srv 2>/dev/null | head
php -r 'var_dump(class_exists("Uri\\Rfc3986\\Uri"));'
# 3. would a request of that size ever reach it? (defaults are 8M and 128M)
php -i 2>/dev/null | grep -E '^(post_max_size|memory_limit|upload_max_filesize)'
grep -rhE '^(post_max_size|memory_limit)' /etc/php/8.5/fpm/php.ini /etc/php/8.5/fpm/pool.d/*.conf /etc/php.ini 2>/dev/nullAnything other than PHP 8.5.0–8.5.12 is not affected, and an 8.5 application that never names Uri\Rfc3986\Uri has no path to the bug. For an application that does, step 3 is the real answer: with post_max_size and memory_limit at anything like their defaults, no request can carry a 2 GiB URI into the parser, and the exposure is confined to CLI tools and workers that read URIs from files or queues. A pool that has raised both limits into the gigabytes for uploads is the case worth updating today.
How to fix it
Update to 8.5.13 and restart the FPM pool. Only the 8.5 packages change; on Debian and RHEL there is nothing to install.
# Ubuntu 26.04 / 26.10 (USN-9185-1)
sudo apt update && sudo apt install --only-upgrade 'php8.5*'
# openSUSE Tumbleweed
sudo zypper refresh && sudo zypper update 'php8*'
# php.net source or Docker: move to 8.5.13 (php:8.5-fpm images rebuilt after 19 November)
docker pull php:8.5-fpm && docker run --rm php:8.5-fpm php -v | head -1
# restart and confirm
sudo systemctl restart php8.5-fpm && php -v | head -1The advisory’s interim advice is a byte-length limit on untrusted URIs well below 2 GiB, which is good practice on a fixed build too. In the application it is one check before the constructor; at the pool it is the request limits that most deployments already have:
<?php
// before new Uri\Rfc3986\Uri($input): refuse anything that could not be a sane URI
if (strlen($input) > 65536) {
throw new InvalidArgumentException('URI too long');
}
; /etc/php/8.5/fpm/pool.d/www.conf — keep the pool's own limits sane
php_admin_value[post_max_size] = 32M
php_admin_value[memory_limit] = 256MDo not switch the application to Uri\WhatWg\Url as a workaround unless you want WHATWG parsing semantics, which differ from RFC 3986 in ways that change what a URI means (percent-encoding, host normalisation, relative resolution); the advisory says the WHATWG class is unaffected, not that it is a drop-in. And do not expect a uriparser package update to close this: the wrap is in PHP’s binding, and only the PHP build fixes it.
Sources
- CVE-2026-129438 at CVE.org — the PHP Group CNA record (19 November 2026): the description, the affected ranges per branch, the CVSS 4.0 vector and the CWE
- GHSA-mg3p-mxj9-g2mm — the PHP project’s advisory: the mechanism (the size calculation overflows at 2,147,483,647 bytes), the
ext-urirange, the 8.5.13 fix, the note that updating uriparser alone does not help, the interim byte-limit advice and the credit to Sahan-Chathumina-25, TimWolla and alexandre-daubois - PHP 8 ChangeLog — the 19 November 2026 entries for 8.5.13 (and 8.6.0), which list this CVE among the eighteen fixed in the release set; the 8.4, 8.3 and 8.2 sections were beyond the readable part of the page on 1 December, so their build numbers are taken from the advisory
- NVD entry — Awaiting Analysis; published 19 November; the CNA’s CVSS 4.0 6.3, CWE-190 and CWE-252; no NVD score and no
cisaExploitAdd - Distribution trackers: Debian (not affected) · Ubuntu (Medium, USN-9185-1 for php8.5) · Red Hat (Moderate, 4.8; RHEL not affected; Hardened Images fixed) · SUSE (moderate, 6.5; Tumbleweed fixed)
- CISA KEV catalogue 2026.11.30, not listed · EPSS: 0.00562, 40.5th percentile, on 30 November 2026
Related reading
- CVE-2026-129506: PHP SOAP extension frees a document’s DTD while entity references still point into it — fixed in the same 19 November release set
- CVE-2026-15353: PHP SOAP decoder turns four bytes of heap into an array key when arraySize is malformed — fixed in the same 19 November release set
- CVE-2026-129501: PHP DOM serializer frees a generated namespace prefix twice — fixed in the same 19 November release set
- CVE-2026-128064: PHP sends upper-case HTTPS and FTPS URLs in plaintext — the other URL-handling bug of the same release set
- What happens when you type a URL — what a URI’s parts mean and why two parsers can disagree about them
- Security advisories — every Linux-relevant CVE we track, newest first, with the component index
This advisory page was assembled from the primary sources listed above on 1 December 2026 and is updated when they change. The facts are theirs; the checks and the ordering are ours. If a row in the distribution table is out of date, the tracker link in that row is the current word.
