-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(deps): update dependency path-to-regexp to v1 [security] #1454
base: master
Are you sure you want to change the base?
Conversation
868e47b
to
4229ba6
Compare
Any chance this will be merged soon? @micalevisk |
@oFlo193o should be but there is no ETA. |
tbf, I'm not sure if we can just merge this because we are moving from v0 to v1 here. |
@micalevisk |
Hoping to see this merged soon, too 👍 According to the PR comment linked by @oFlo193o it would indeed seem that there were no API changes between 0.2.5 and 1.0.0 so this should be safe to merge? See https://github.com/pillarjs/path-to-regexp/blob/7aff887e73ee8bca5cc98ee6239616da07eb8523/History.md#100--2014-08-17 |
any update? :) |
Looking for an update on this as well 👀 |
Yes, it would be nice to have it merged, since using "override" in the root package.json is not working and this is reported as a high-risk CVE. |
Any predictions for this pr to be integrated? |
Reviewers have accepted the change. Can you please merge this @micalevisk |
Only Kamil can merge PRs |
I'm not sure if we can address this issue without introducing breaking changes |
Hey guys, looking for an update on this as well |
when i try to change dependencies i faceed an issue - https://stackoverflow.com/questions/79051743/npm-override-overrides-not-only-the-package-i-specify , npm override change not only specified package but others too, some ideas how to fix it? |
any updates? |
This would introduce a breaking change so we need to wait till the next major release |
This PR contains the following updates:
0.2.5
->1.9.0
GitHub Vulnerability Alerts
CVE-2024-45296
Impact
A bad regular expression is generated any time you have two parameters within a single segment, separated by something that is not a period (
.
). For example,/:a-:b
.Patches
For users of 0.1, upgrade to
0.1.10
. All other users should upgrade to8.0.0
.These versions add backtrack protection when a custom regex pattern is not provided:
They do not protect against vulnerable user supplied capture groups. Protecting against explicit user patterns is out of scope for old versions and not considered a vulnerability.
Version 7.1.0 can enable
strict: true
and get an error when the regular expression might be bad.Version 8.0.0 removes the features that can cause a ReDoS.
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
to/:a-:b([^-/]+)
.If paths cannot be rewritten and versions cannot be upgraded, another alternative is to limit the URL length. For example, halving the attack string improves performance by 4x faster.
Details
Using
/:a-:b
will produce the regular expression/^\/([^\/]+?)-([^\/]+?)\/?$/
. This can be exploited by a path such as/a${'-a'.repeat(8_000)}/a
. OWASP has a good example of why this occurs, but the TL;DR is the/a
at the end ensures this route would never match but due to naive backtracking it will still attempt every combination of the:a-:b
on the repeated 8,000-a
.Because JavaScript is single threaded and regex matching runs on the main thread, poor performance will block the event loop and can lead to a DoS. In local benchmarks, exploiting the unsafe regex will result in performance that is over 1000x worse than the safe regex. In a more realistic environment using Express v4 and 10 concurrent connections, this translated to average latency of ~600ms vs 1ms.
References
Release Notes
pillarjs/path-to-regexp (path-to-regexp)
v1.9.0
: Fix backtracking in 1.xCompare Source
Fixed
925ac8e
re.exec(&#​39;/test/route&#​39;)
result (#267)32a14b0
v1.8.0
: Backport token to function optionsCompare Source
Added
TokensToFunctionOptions
v1.7.0
Compare Source
delimiter
option to be passed in withtokensToRegExp
which will be used for "non-ending" token match situationsv1.6.0
Compare Source
RegExp.keys
when using thetokensToRegExp
method (making it consistent with the main export)delimiter
option to be passed in withparse
Keys
andOptions
updatedv1.5.3
Compare Source
\\
to the ignore character group to avoid backtracking on mismatched parensv1.5.2
Compare Source
\\
in string segments of regexpv1.5.1
Compare Source
index.d.ts
to NPM packagev1.5.0
Compare Source
v1.4.0
Compare Source
v1.3.0
Compare Source
/:foo?-bar
)v1.2.1
Compare Source
v1.2.0
Compare Source
*
) as an unnamed match everything group ((.*)
)v1.1.1
Compare Source
v1.1.0
Compare Source
v1.0.3
Compare Source
files
topackage.json
v1.0.2
Compare Source
Array.isArray
shimv1.0.1
Compare Source
v1.0.0
Compare Source
Configuration
📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ 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.