decode-uri-component vulnerable to denial of service via quadratic replacement of percent-encoded runs
CVE-2026-118664
Summary decodeUriComponent() takes quadratic time on malformed input that has many distinct percent-encoded runs. A single unauthenticated request of about 224 KB can block the Node.js event loop for about 20 seconds. Version 0.5.0, the release that fixed CVE-2026-45822, is affected. Details When native decodeURIComponent throws, decodeUriComponent() falls back to customDecodeURIComponent (index.js:122). That function: 1. Scans the input for every run of percent-encoded bytes (e.g. %C3%A5) and stores each distinct run, with its decoded value, in a lookup table (index.js:130-144). 2. Runs one full-string input.replace(new RegExp(key, 'g'), …) per table entry (index.js:154). With K distinct runs in an input of length L, that's K regex compilations and K full scans of the string, so O(K·L). An attacker controls both K and L, and K grows with L. One malformed sequence such as a trailing %zz is enough to force the fallback path. The 0.5.0 fix for CVE-2026-45822 (fa479da) replaced the recursive decode() routine with a linear scanner, but left this replacement loop unchanged. Proof of concept Running the following code takes ~20 seconds. js import decodeUriComponent from…
Assessment
- CVSS
- 8.2 (v4.0)
- Severity
- High
- EPSS
- 0.00318% chance of exploitation in the next 30 days
- Known exploited
- Not listed in CISA KEV
- Exploit availability
- Nothing found in Exploit-DB, Metasploit, Nuclei or public PoC repositories
- Published
- 29 October 2026
- Last updated
- 29 October 2026
- Affected
- npm · decode-uri-component
- Weakness
- CWE-400, CWE-407
CVSS vectorCVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
At the source
References
- https://github.com/SamVerschueren/decode-uri-component/security/advisories/GHSA-qr28-fpjm-wq7f
- https://nvd.nist.gov/vuln/detail/CVE-2026-118664
- https://github.com/SamVerschueren/decode-uri-component/commit/fad01d65b93bd3f2f0dc32dfd8d57a38b57bc608
- https://github.com/SamVerschueren/decode-uri-component/releases/tag/v0.5.1
- https://github.com/advisories/GHSA-qr28-fpjm-wq7f
Query this programmatically
Agents can read this through the MCP endpoint, or over HTTP:
curl https://cve.zerocrew.in/api/cve/CVE-2026-118664