chore(deps): update dependency path-to-regexp@<0.1.13 to v1 [security]#6306
Open
renovate[bot] wants to merge 1 commit intomainfrom
Open
chore(deps): update dependency path-to-regexp@<0.1.13 to v1 [security]#6306renovate[bot] wants to merge 1 commit intomainfrom
renovate[bot] wants to merge 1 commit intomainfrom
Conversation
|
✅ Meticulous spotted 0 visual differences across 256 screens tested: view results. Meticulous evaluated ~4 hours of user flows against your PR. Expected differences? Click here. Last updated for commit |
3a64eae to
9e81487
Compare
9e81487 to
0edf2bb
Compare
0edf2bb to
da70f96
Compare
da70f96 to
914e5ed
Compare
914e5ed to
a70f1c9
Compare
a70f1c9 to
bcf94c6
Compare
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.2.5→1.9.0GitHub 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: trueand 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-:bto/: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-:bwill 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/aat the end ensures this route would never match but due to naive backtracking it will still attempt every combination of the:a-:bon 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@<0.1.13)
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
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 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.