SamVerschueren decode-uri-component
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 versions and mitigation
From the CVE record and the vendor's references.Affected
- < 0.5.1
Fixed in 0.5.1
Mitigation
Upgrade decode-uri-component to 0.5.1 or later.
References
- Vendor advisory github.com/SamVerschueren/decode-uri-component…
- Patch github.com/SamVerschueren/decode-uri-component…
- Release notes github.com/SamVerschueren/decode-uri-component…
Timeline
Days relative to CVE publicationNo public PoC found yet; not in CISA KEV.
PoC repositories
Found on GitHub.No PoC repositories found yet.