Repository navigation
Update dependency decode-uri-component to v0.5.1 [SECURITY] - #2951
Open
renovate[bot] wants to merge 1 commit into
Open
renovate[bot] wants to merge 1 commit into
renovate[bot] wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
0.5.0→0.5.1decode-uri-component vulnerable to denial of service via quadratic replacement of percent-encoded runs
CVE-2026-118664 / GHSA-qr28-fpjm-wq7f
More information
Details
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 tocustomDecodeURIComponent(index.js:122). That function:%C3%A5) and stores each distinct run, with its decoded value, in a lookup table (index.js:130-144).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
%zzis enough to force the fallback path.The 0.5.0 fix for CVE-2026-45822 (
fa479da) replaced the recursivedecode()routine with a linear scanner, but left this replacement loop unchanged.Proof of concept
Running the following code takes ~20 seconds.
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 asquery-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().Severity
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Release Notes
SamVerschueren/decode-uri-component (decode-uri-component)
v0.5.1Compare Source
fad01d6Configuration
📅 Schedule: (UTC)
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.