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.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- None
What an attacker can affect
- Confidentiality
- None
- Integrity
- None
- Availability
- High
Exploit likelihood
What each source reports
CVE List Score used
8.2
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.
- Record
CVE-2026-118664- CVSS 4.0
- 8.2 High
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N - Weakness
- CWE-400, CWE-407
- Updated
- 2026-11-02
EUVDEUVD-2026-112471
8.2
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.
- Record
EUVD-2026-112471- CVSS 4.0
- 8.2 High
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-qr28-fpjm-wq7f
8.2
decode-uri-component vulnerable to denial of service via quadratic replacement of percent-encoded runs
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().
- Record
GHSA-qr28-fpjm-wq7f- CVSS 4.0
- 8.2 High
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N - Weakness
- CWE-400, CWE-407
- Updated
- 2026-11-02
NVD
8.2
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.
- Record
CVE-2026-118664- CVSS 4.0
- 8.2 High
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X - Weakness
- CWE-400, CWE-407
- Updated
- 2026-11-02
OSV
8.2
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.
- Record
CVE-2026-118664- CVSS 4.0
- 8.2 High
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N - Weakness
- CWE-400, CWE-407
- Updated
- 2026-11-02
OSVGHSA-qr28-fpjm-wq7f
8.2
decode-uri-component vulnerable to denial of service via quadratic replacement of percent-encoded runs
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().
- Record
GHSA-qr28-fpjm-wq7f- CVSS 4.0
- 8.2 High
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N - Weakness
- CWE-400, CWE-407
- Updated
- 2026-11-02
Show 4 moreShow less
OSVAZL-111706 No score
CVE-2026-118664 affecting package js-jquery 3.5.0-4
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.
- Record
AZL-111706- Updated
- 2026-11-05
OSVCLSA-2026-1793790091 No score
TuxCare security update for decode-uri-component (1 CVE)
TuxCare rebuilt decode-uri-component to address 1 CVE. Fixed in 0.2.2-tuxcare.2.
- Record
CLSA-2026-1793790091- Updated
- 2026-11-04
OSVCLSA-2026-1793801861 No score
TuxCare security update for decode-uri-component (1 CVE)
TuxCare rebuilt decode-uri-component to address 1 CVE. Fixed in 0.2.0-tuxcare.3.
- Record
CLSA-2026-1793801861- Updated
- 2026-11-04
OSVROOT-APP-NPM-CVE-2026-118664 No score
CVE-2026-118664 in decode-uri-component - Patched by Root
Root has patched CVE-2026-118664 in the decode-uri-component package for Root:npm. Multiple fixed versions available.
- Record
ROOT-APP-NPM-CVE-2026-118664- Updated
- 2026-11-03
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
decode-uri-componentnpm |
through 0.5.0 | 0.5.1 |
js-jqueryAzure Linux:3 |
through 3.5.0-4 | None known |
decode-uri-componentTuxCare:npm |
0.2.2-tuxcare.0 up to 0.2.2-tuxcare.2, plus listed versions 0.2.20.2.2-tuxcare.1 |
0.2.2-tuxcare.2 |
decode-uri-componentTuxCare:npm |
0.2.0-tuxcare.0 up to 0.2.0-tuxcare.3, plus listed versions 0.2.00.2.0-tuxcare.10.2.0-tuxcare.2 |
0.2.0-tuxcare.3 |
decode-uri-componentnpm |
before 0.5.1 | 0.5.1 |
decode-uri-componentRoot:npm |
before 0.2.2-aikido.1 | 0.2.2-aikido.1 |
@rootio/decode-uri-componentRoot:npm |
before 0.2.2-root.io.1 | 0.2.2-root.io.1 |
History
| Recorded | Changed | Sources |
|---|---|---|
| affected, aliases | OSV | |
| affected, aliases, facts | OSV | |
| affected, aliases | OSV | |
| first indexed | CVE List, EUVD, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2026-118664 is a high vulnerability (CVSS 8.2) in Samverschueren Decode-uri-component, published October 28, 2026. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.32%, the 24th percentile. Fixed in decode-uri-component 0.5.1.
References
github.com/SamVerschueren/decode-uri-component/security/advisories/GHSA-qr28-fpjm-wq7f
github.com/SamVerschueren/decode-uri-component/commit/fad01d65b93bd3f2f0dc32dfd8d57a38b57bc608
github.com/SamVerschueren/decode-uri-component/releases/tag/v0.5.1
nvd.nist.gov/vuln/detail/CVE-2026-118664
github.com/advisories/GHSA-qr28-fpjm-wq7f
github.com/CVEProject/cvelistV5/tree/main/cves/2026/118xxx/CVE-2026-118664.json
github.com/SamVerschueren/decode-uri-component