VulnWatch by ve1ve2
high 7.5 EPSS 0.36%

GHSA-m8rr-4c36-8gq4 / CVE-2026-7258: Out-of-bounds read in urldecode()

Source:
PHP releases (GitHub php/php-src tags)
Published:
Fetched:
Updated:
Affects:
php php-src

https://github.com/php/php-src/security/advisories/GHSA-m8rr-4c36-8gq4 ↗

repo-advisoryphpCWE-125securityrepo:php/php-srcstack

Out-of-bounds read in urldecode() Consider the following snippet within `php_url_decode_ex()` at `ext/standard/url.c`, called from PHPs `urldecode()` function: https://github.com/php/php-src/blob/dcf653339c245e25ea319248d0fc071a9405d688/ext/standard/url.c#L592-L593 According to the C11 specification, `isxdigit()`'s (and all other `ctype.h` functions') only argument is of type `int`, and any value passed to it must be representable by `unsigned char`, i.e. 0-255. §7.4: > The header declares several functions useful for classifying and mapping characters. In all cases the argument is an int, the value of which shall be representable as an unsigned char or shall equal the value of the macro EOF. If the argument has any other value, the behavior is undefined. On platforms where plain `char` is signed (which is most), passing a `char` with a value <0 to `int` (or casting to `int` explicitly as in this case) will lead to signed integer extension, leading to a negative `int` value. Instead, the `char` value should be cast to `unsigned char`, so that no sign extension occurs. Most platforms account for this common mistake. However, on NetBSD passing negative values to `isxdigit()` lead to an out-of-bounds read, leading to a segfault. ```php urldecode("%\x80"); ``` Affected packages: php:php-src Patched: php-src 8.2.31, php-src 8.3.31, php-src 8.4.21, php-src 8.5.6

Linked vulnerabilities (2)

CVE-2026-7258 high 7.5 EPSS 0.36% (p31) NVDCVE.orgGHSA
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

php8.2 - security update

CWE: CWE-125Aliases: CVE-2025-14179, CVE-2026-6722, CVE-2026-6735, CVE-2026-7259, CVE-2026-7261, CVE-2026-7262, CVE-2026-7568, CVE-2026-12184, CVE-2026-6104, CVE-2026-7263, GHSA-m8rr-4c36-8gq4
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N

Out-of-bounds read in urldecode()

CWE: CWE-125Aliases: CVE-2026-7258