chore(deps): update dependency path-to-regexp@0.1.12 to v8 [security] - autoclosed#33116
Closed
renovate[bot] wants to merge 1 commit into
Closed
chore(deps): update dependency path-to-regexp@0.1.12 to v8 [security] - autoclosed#33116renovate[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.1.13→8.4.0Warning
Some dependencies could not be looked up. Check the Dependency Dashboard for more information.
GitHub Vulnerability Alerts
CVE-2026-4867
Impact
A bad regular expression is generated any time you have three or more parameters within a single segment, separated by something that is not a period (
.). For example,/:a-:b-:cor/:a-:b-:c-:d. The backtrack protection added inpath-to-regexp@0.1.12only prevents ambiguity for two parameters. With three or more, the generated lookahead does not block single separator characters, so capture groups overlap and cause catastrophic backtracking.Patches
Upgrade to path-to-regexp@0.1.13
Custom regex patterns in route definitions (e.g.,
/:a-:b([^-/]+)-:c([^-/]+)) are not affected because they override the default capture group.Workarounds
All versions can be patched by providing a custom regular expression for parameters after the first in a single segment. As long as the custom regular expression does not match the text before the parameter, you will be safe. For example, change
/:a-:b-:cto/:a-:b([^-/]+)-:c([^-/]+).If paths cannot be rewritten and versions cannot be upgraded, another alternative is to limit the URL length.
References
CVE-2026-4926
Impact
A bad regular expression is generated any time you have multiple sequential optional groups (curly brace syntax), such as
{a}{b}{c}:z. The generated regex grows exponentially with the number of groups, causing denial of service.Patches
Fixed in version 8.4.0.
Workarounds
Limit the number of sequential optional groups in route patterns. Avoid passing user-controlled input as route patterns.
CVE-2026-4923
Impact
When using multiple wildcards, combined with at least one parameter, a regular expression can be generated that is vulnerable to ReDoS. This backtracking vulnerability requires the second wildcard to be somewhere other than the end of the path.
Unsafe examples:
Safe examples:
Patches
Upgrade to version
8.4.0.Workarounds
If developers are using multiple wildcard parameters, they can check the regex output with a tool such as https://makenowjust-labs.github.io/recheck/playground/ to confirm whether a path is vulnerable.
Release Notes
pillarjs/path-to-regexp (path-to-regexp@0.1.12)
v8.4.0Compare Source
v8.3.0: 8.3.0Compare Source
Changed
2a7f2a4TokenData(#391)687a9bba4a8552a6bdf40Other
9df24484a91505d63f44b973d15cv8.2.0: 8.2.0Compare Source
Fixed
path-to-regexpto run on older browsers by targeting ES20155969033sflag from regexp51dbd45v8.1.0Compare Source
Added
pathToRegexpmethod back for generating a regexstringifymethod for convertingTokenDatainto a path stringv8.0.0: Simpler APICompare Source
Heads up! This is a fairly large change (again) and I need to apologize in advance. If I foresaw what this version would have ended up being I would not have released version 7. A longer blog post and explanation will be incoming this week, but the pivot has been due to work on Express.js v5 and this will the finalized syntax used in Express moving forward.
Edit: The post is out - https://blakeembrey.com/posts/2024-09-web-redos/
Added
*namesyntax, aligns with:behavior but using an asterisk insteadChanged
?,+, and*- only optional exists moving forward (use wildcards for+,{*foo}for*)Added
:"foo-bar"string | TokenData | Array<string | TokenData>Removed
loosemodev7.2.0: Support array inputs (again)Compare Source
Added
matchandpathToRegexp3fdd88fv7.1.0: Strict modeCompare Source
Added
strictoption to detect potential ReDOS issuesFixed
suffix + prefixwhen not specifiedTokenDataTokenDatamanually, previouslyparsefilled it in automaticallyComments
strict: trueand I'm probably releasing a V8 with it enabled by default ASAP as a necessary security mitigationv7.0.0: Wildcard, unicode, and modifier changesCompare Source
Hi all! There's a few major breaking changes in this release so read carefully.
Breaking changes:
compileonly accepts strings as values (i.e. no numbers, useString(value)before compiling a path)encode !== false, it must be an array of strings\p{XID_Continue}).?,*,+) must be used after a param explicitly wrapped in{}/or.*) has been added back and matches Express.js expected behaviorendsWithoptionstrict: truetotrailing: false;,,,!, and@for future use-casestokensToRegexp,tokensToFunctionandregexpToFunctionin favor of simplifying exports/can be repeated multiple times in a matched path (i.e./fooworks like//foo, etc)encodeanddecodeno longer receive the token as the second parameterencodeURIComponentand decode defaults todecodeURIComponentAdded:
encodePathto fix an issue aroundencodebeing used for both path and parameters (the path and parameter should be encoded slightly differently)looseas an option to support arbitrarily matching the delimiter in paths, e.g.foo/barandfoo///barshould work the sameencodeanddecodeto be set tofalsewhich skips all processing of the parameters input/outputTokenData(exported, returned byparse) as inputRequests for feedback:
{}is an obvious drawback but I'm seeking feedback on whether it helps make path behavior clearer/and.as implicit prefixesv6.3.0: Fix backtracking in 6.xCompare Source
Fixed
f1253b4v6.2.2: Updated READMECompare Source
No API changes. Documentation only release.
Changed
c7ec332e828000v6.2.1: Fix matching:name*parameterCompare Source
Fixed
:name*parameter (#261)762bc6b86baef8Added
ae9e57677df638b39edd4v6.2.0: Named Capturing GroupsCompare Source
Added
Fixed
strictflag documentation (#227)v6.1.0: Use/#?as Default DelimiterCompare Source
Fixed
/#?as default delimiter to avoid matching on query or fragment parametersdelimiter: '.'v6.0.0: Custom Prefix and Suffix GroupsCompare Source
This release reverts the prefix behavior added in v3 back to the behavior seen in v2. For the most part, path matching is backward compatible with v2 with these enhancements:
/(abc(?=d))/{abc(.*)def}/test(foopreviously worked treating(as a literal character, now it expects(to be closed and is treated as a group/test\(fooChanged
prefixesoption to configure this (starts as/.which acts like every version since 0.x again){}to capture prefix/suffix explicitly, enables custom use-cases like/:attr1{-:attr2}?v5.0.0: Remove Default Encode URI ComponentCompare Source
No changes to path rules since 3.x, except support for nested RegEx parts in 4.x.
Changed
RegexpOptionsinterface toTokensToRegexpOptionsnormalizePathnamefrom library, document solution in READMEencodeURIComponentv4.0.5: Decode URICompare Source
Removed
whitelistin favor ofdecodeURI(advanced behavior can happen outsidepath-to-regexp)v4.0.4: RemoveString#normalizeCompare Source
Fixed
String.prototype.normalizeto continue supporting IEv4.0.3: Normalize Path WhitelistCompare Source
Added
/%.-)v4.0.2: AllowRegexpOptionsinmatchCompare Source
Fixed
RegexpOptionsinmatch(...)functionv4.0.1: Fix Spelling of RegexpCompare Source
Fixed
regexpspelling across 4.xv4.0.0: ES2015 Package for BundlersCompare Source
All path rules are backward compatible with 3.x, except for nested
()and other RegEx special characters that were previously ignored.Changed
matchdoes not default todecodeURIComponentAdded
normalizePathnameutility for supporting unicode paths in librariesv3.3.0: Add backtracking protectionCompare Source
Fixed
d31670av3.2.0: Match FunctionCompare Source
Added
matchfunction to libraryv3.1.0: Validate and sensitive optionsCompare Source
sensitiveoption fortokensToFunction(#191)validateoption to path functions (#178)v3.0.0Compare Source
/:att1-:att2-:att3-:att4-:att5)partialsupport, prefer escaping the prefix delimiter explicitly (e.g.\\/(apple-)?icon-:res(\\d+).png)v2.4.0Compare Source
startoption to disable anchoring from beginning of the stringv2.3.0Compare Source
delimiterwhen processing repeated matching groups (e.g.foo/barhas no prefix, but has a delimiter)v2.2.1Compare Source
end: falseto match both relative and absolute pathsv2.2.0Compare Source
tokenas second argument toencodeoption (e.g.encode(value, token))v2.1.0Compare Source
/foo/before required either/foo/or/foo//to match in non-ending modev2.0.0Compare Source
endsWithto match paths like/test?query=stringup to the query stringdelimitersfor specific characters to be treated as parameter prefixes (e.g./:test)isarraydependency/test/is now treated as/test/instead of/testwhen matching)keysargument that acceptedoptionskeyslist attached to theRegExpoutputtokensToFunction(e.g.compile) to accept anencodefunction for pretty encoding (e.g. pass your own implementation)v1.9.0: Fix backtracking in 1.xCompare Source
Fixed
925ac8ere.exec(&#​39;/test/route&#​39;)result (#267)32a14b0v1.8.0: Backport token to function optionsCompare Source
Added
TokensToFunctionOptionsv1.7.0Compare Source
delimiteroption to be passed in withtokensToRegExpwhich will be used for "non-ending" token match situationsv1.6.0Compare Source
RegExp.keyswhen using thetokensToRegExpmethod (making it consistent with the main export)delimiteroption to be passed in withparseKeysandOptionsupdatedv1.5.3Compare Source
\\to the ignore character group to avoid backtracking on mismatched parensv1.5.2Compare Source
\\in string segments of regexpv1.5.1Compare Source
index.d.tsto NPM packagev1.5.0Compare Source
v1.4.0Compare Source
v1.3.0Compare Source
/:foo?-bar)v1.2.1Compare Source
v1.2.0Compare Source
*) as an unnamed match everything group ((.*))v1.1.1Compare Source
v1.1.0Compare Source
v1.0.3Compare Source
filestopackage.jsonv1.0.2Compare Source
Array.isArrayshimv1.0.1Compare Source
v1.0.0Compare Source
v0.2.5Compare Source
v0.2.4Compare Source
v0.2.3Compare Source
v0.2.2Compare Source
v0.2.1Compare Source
v0.2.0Compare Source
*,+and?Configuration
📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR becomes conflicted, 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.