CVE-2026-118664: decode-uri-component vulnerable to denial of service via quadratic replacement of percent-encoded runs

Published Oct 28, 2026
·
Updated

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 '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().

Other sources

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.

— MITRE

decode-uri-component: Denial of service via quadratic replacement of percent-encoded runs

— Microsoft

Affected Software

5 affected componentsFixes available
npm/decode-uri-component<0.5.1
npm/decode-uri-component<=0.5.0
0.5.1
npm/decode-uri-component<0.5.1
0.5.1
IBM App Connect Operator<=CD: 12.1.0 - 12.21.0 12.0 LTS: 12.0.0 - 12.0.28 13 LTS: 13.0.0 - 13.6.0
IBM App Connect EnterpriseCertified Containers Operands<=CD: 12.0.11.1-r1 - 12.0.12.5-r1, 13.0.1.0-r1 - 13.0.6.2-r1 12.0 LTS: 12.0.12-r1 - 12.0.12-r28 13 LTS: 13.0.7.0-r1 - 13.0.9.0-r1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade npm/decode-uri-component to a version that resolves this vulnerability.

    Fixed in 0.5.1
  2. Upgrade

    Upgrade decode-uri-component to a version that resolves this vulnerability.

    Fixed in 0.5.1

Event History

Oct 28, 2026
CVE Published
via MITRE·08:37 PM
Data Sourced
via MITRE·08:37 PM
DescriptionWeakness
Data Sourced
via OSV·08:37 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·09:16 PM
DescriptionSeverityWeakness
Oct 29, 2026
Advisory Published
via GitHub·04:41 PM
Data Sourced
via GitHub·04:41 PM
DescriptionWeaknessAffected Software
Data Sourced
via OSV·04:41 PM
Affected Software
Nov 9, 2026
Data Sourced
via IBM·12:00 AM
DescriptionAffected Software
Nov 17, 2026
Data Sourced
via Microsoft·06:41 AM
DescriptionSeverityWeakness

Parent advisories

This vulnerability appears in the following advisories.

Frequently Asked Questions

1

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.

2

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.

3

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.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203