-
Notifications
You must be signed in to change notification settings - Fork 243
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 v8 [security] - autoclosed #1770
Closed
Conversation
This file contains 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
backstage-goalie
bot
requested review from
backstage-service and
a team
as code owners
October 25, 2024 20:11
backstage-goalie
bot
added
dependencies
Pull requests that update a dependency file
security
labels
Oct 25, 2024
Changed Packages
|
backstage-goalie
bot
force-pushed
the
renovate/npm-path-to-regexp-vulnerability
branch
14 times, most recently
from
October 31, 2024 22:12
8b5e7c6
to
d0c82a6
Compare
backstage-goalie
bot
force-pushed
the
renovate/npm-path-to-regexp-vulnerability
branch
from
November 4, 2024 10:11
d0c82a6
to
3173512
Compare
Edited/Blocked NotificationRenovate will not automatically rebase this PR, because it does not recognize the last commit author and assumes somebody else may have edited the PR. You can manually request rebase by checking the rebase/retry box above. |
backstage-goalie
bot
force-pushed
the
renovate/npm-path-to-regexp-vulnerability
branch
4 times, most recently
from
November 12, 2024 23:11
0218677
to
a2a12d8
Compare
backstage-goalie
bot
force-pushed
the
renovate/npm-path-to-regexp-vulnerability
branch
4 times, most recently
from
November 17, 2024 00:17
712e2a2
to
77c7117
Compare
backstage-goalie
bot
force-pushed
the
renovate/npm-path-to-regexp-vulnerability
branch
8 times, most recently
from
November 18, 2024 20:45
536d22f
to
3a121f7
Compare
backstage-service
force-pushed
the
renovate/npm-path-to-regexp-vulnerability
branch
from
November 18, 2024 20:45
3a121f7
to
c90be50
Compare
backstage-goalie
bot
force-pushed
the
renovate/npm-path-to-regexp-vulnerability
branch
from
November 18, 2024 21:08
c90be50
to
8985304
Compare
backstage-service
force-pushed
the
renovate/npm-path-to-regexp-vulnerability
branch
from
November 18, 2024 21:09
8985304
to
584d77b
Compare
backstage-goalie
bot
force-pushed
the
renovate/npm-path-to-regexp-vulnerability
branch
from
November 18, 2024 22:08
584d77b
to
b2365c6
Compare
backstage-service
force-pushed
the
renovate/npm-path-to-regexp-vulnerability
branch
from
November 18, 2024 22:09
b2365c6
to
964ee41
Compare
backstage-goalie
bot
force-pushed
the
renovate/npm-path-to-regexp-vulnerability
branch
from
November 19, 2024 01:36
964ee41
to
9e62596
Compare
backstage-service
force-pushed
the
renovate/npm-path-to-regexp-vulnerability
branch
from
November 19, 2024 01:38
9e62596
to
2cc8d95
Compare
backstage-goalie
bot
force-pushed
the
renovate/npm-path-to-regexp-vulnerability
branch
from
November 19, 2024 07:09
2cc8d95
to
8bb0e82
Compare
backstage-service
force-pushed
the
renovate/npm-path-to-regexp-vulnerability
branch
from
November 19, 2024 07:09
8bb0e82
to
b03aea5
Compare
backstage-goalie
bot
force-pushed
the
renovate/npm-path-to-regexp-vulnerability
branch
from
November 19, 2024 10:10
b03aea5
to
f77f912
Compare
backstage-service
force-pushed
the
renovate/npm-path-to-regexp-vulnerability
branch
from
November 19, 2024 10:10
f77f912
to
dd42592
Compare
backstage-goalie
bot
force-pushed
the
renovate/npm-path-to-regexp-vulnerability
branch
from
November 19, 2024 12:09
dd42592
to
3c9d0a6
Compare
backstage-service
force-pushed
the
renovate/npm-path-to-regexp-vulnerability
branch
from
November 19, 2024 12:10
3c9d0a6
to
a0204da
Compare
backstage-goalie
bot
force-pushed
the
renovate/npm-path-to-regexp-vulnerability
branch
from
November 19, 2024 16:13
a0204da
to
b8884f4
Compare
Signed-off-by: Renovate Bot <bot@renovateapp.com>
backstage-service
force-pushed
the
renovate/npm-path-to-regexp-vulnerability
branch
from
November 19, 2024 16:14
b8884f4
to
c72a903
Compare
backstage-goalie
bot
changed the title
fix(deps): update dependency path-to-regexp to v8 [security]
fix(deps): update dependency path-to-regexp to v8 [security] - autoclosed
Nov 19, 2024
backstage-goalie
bot
deleted the
renovate/npm-path-to-regexp-vulnerability
branch
November 19, 2024 19:15
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:
^7.1.0
->^8.0.0
path-to-regexp outputs backtracking regular expressions
CVE-2024-45296 / GHSA-9wv6-86v2-598j
More information
Details
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
Severity
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
References
This data is provided by OSV and the GitHub Advisory Database (CC-BY 4.0).
Release Notes
pillarjs/path-to-regexp (path-to-regexp)
v8.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
*name
syntax, 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
loose
modeConfiguration
📅 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 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 has been generated by Renovate Bot.