npm
CVE-2026-118664
decode-uri-component vulnerable to denial of service via quadratic replacement of percent-encoded runs
- Severity
- High
- Published
- 29 Oct 2026
- Last changed
- 29 Oct 2026
- Added to UpHeron
- 23 Nov 2026
- Fixed in
- 0.5.1
- Exploit chance
- 0.3% in the next 30 daysHigher than 25% of CVEs. EPSS by FIRST, 24 Nov 2026
- Also known as
- GHSA-qr28-fpjm-wq7f
- Sources
- OSV.dev and GitHub
Description
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.
When native decodeURIComponent throws, decodeUriComponent() falls back to customDecodeURIComponent (index.js:122). That function:
- 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).
- 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.
Affected software
| Software | Affected versions |
|---|---|
decode-uri-componentnpm · osv:npm:decode-uri-component |
|
About decode-uri-component
- Weekly downloads (npm)
- 32,631,116npm, 23 Nov 2026
This is the only vulnerability in decode-uri-component in our list.
References
- CVE.org https://www.cve.org/CVERecord?id=CVE-2026-118664
- GitHub Advisory Database https://github.com/advisories/GHSA-qr28-fpjm-wq7f