CVE-2026-118664: decode-uri-component: Denial of service via quadratic replacement of percent-encoded runs
decode-uri-component provides a more robust alternative to decodeURIComponent. Prior to 0.5.1, decodeUriComponent in index.js falls back to customDecodeURIComponent after native decoding throws, and the fallback collects every distinct percent-encoded run before performing a full-string regular-expression replacement for each entry. Malformed input containing many distinct runs can therefore make both the number of replacements and the scanned input length grow together, causing quadratic CPU consumption and blocking the Node.js event loop; request-body inputs can reach the demonstrated size, while ordinary URL header limits reduce the practical delay. This issue is fixed in version 0.5.1.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
decode-uri-componentto a version that resolves this vulnerability.Fixed in 0.5.1
Event History
Frequently Asked Questions
Who is most exposed to this denial of service condition?
Applications using decode-uri-component before 0.5.1 are exposed when they decode attacker-controlled malformed input, especially request bodies that can reach large sizes. Inputs limited by ordinary URL header size limits are less likely to cause a substantial delay.
What must an attacker send to trigger excessive CPU use?
The attacker needs to supply malformed percent-encoded input containing many distinct percent-encoded runs. This causes the fallback decoder to perform repeated full-string regular-expression replacements, producing quadratic CPU consumption and blocking the Node.js event loop.
Is updating the package sufficient to address the issue?
Yes. The issue is fixed in decode-uri-component version 0.5.1; installations prior to 0.5.1 are affected.