CVE-2026-118664 — decode-uri-component
Fix: SamVerschueren/decode-uri-component@fad01d6CVE-2026-118664 is a Uncontrolled Resource Consumption vulnerability in decode-uri-component. A fix is available for decode-uri-component — see the affected versions and patch details below.
decode-uri-component: Denial of service via quadratic replacement of percent-encoded runs
Exploitation Status
No confirmed exploitation observed yet
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for CVE-2026-118664.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
Real-World Exposure
How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.
decode-uri-componentnpmDescription
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:
- 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.
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.
import decodeUriComponent from 'decode-uri-component';
let payload = '';
for (let i = 0; i < 32000; i++) {
const high = Math.floor(i / 256).toString(16).padStart(2, '0');
const low = (i % 256).toString(16).padStart(2, '0');
payload += `%${high}%${low}x`; // distinct run each iteration
}
payload += '%zz'; // forces the fallback decoder
console.time('decode');
decodeUriComponent(payload); // ~224 KB
console.timeEnd('decode');
Impact
This is an availability issue only and there's no confidentiality or integrity impact. Any application that passes untrusted input to decodeUriComponent(), directly or through a dependency such as query-string, can be made unresponsive. Because Node.js runs on one thread, one request stalls every other client.
The worst case needs input well beyond URL length limits. Node's default 16 KB header limit keeps payloads passed in via a URL query string to roughly 40 ms per request. Applications that decode request bodies are fully exposed, for example form bodies parsed with query-string.parse().
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 📦npm | decode-uri-component | all versions | 0.5.1npm install decode-uri-component@0.5.1 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for decode-uri-component, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update decode-uri-component to 0.5.1 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2026-118664 is resolved across your whole dependency graph.
Workarounds
Cap what an attacker can consume: apply request size, rate and timeout limits in front of the affected component, and run it with memory and CPU limits so exhaustion degrades one worker rather than the whole service.
Fixing This On Your OS
If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.
Red Hat has evaluated this vulnerability as having an Important security impact because an unauthenticated remote attacker can monopolize server resources and cause a complete denial of service across exposed web interfaces without needing elevated credentials. Multiple Red Hat management consoles and backend services…
| Product | Fixed in | Advisory |
|---|---|---|
| Red Hat OpenShift distributed tracing 3.11 | rhosdt/tempo-jaeger-query-rhel9:1793703190 | RHSA-2026:94580 |
Frequently Asked Questions
Is CVE-2026-118664 in your dependencies?
Find it across npm, including transitive dependencies.