Skip to content

🚨 [security] Update path-to-regexp 8.2.0 → 8.4.1 (minor)#601

Open
depfu[bot] wants to merge 1 commit intomainfrom
depfu/update/pnpm/path-to-regexp-8.4.1
Open

🚨 [security] Update path-to-regexp 8.2.0 → 8.4.1 (minor)#601
depfu[bot] wants to merge 1 commit intomainfrom
depfu/update/pnpm/path-to-regexp-8.4.1

Conversation

@depfu
Copy link
Copy Markdown
Contributor

@depfu depfu bot commented Apr 1, 2026


🚨 Your current dependencies have known security vulnerabilities 🚨

This dependency update fixes known security vulnerabilities. Please see the details below and assess their impact carefully. We recommend to merge and deploy this as soon as possible!


Here is everything you need to know about this update. Please take a good look at what changed and the test results before merging this pull request.

What changed?

✳️ path-to-regexp (8.2.0 → 8.4.1) · Repo · Changelog

Security Advisories 🚨

🚨 path-to-regexp vulnerable to Denial of Service via sequential optional groups

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.

🚨 path-to-regexp vulnerable to Regular Expression Denial of Service via multiple wildcards

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:

/*foo-*bar-:baz
/*a-:b-*c-:d
/x/*a-:b/*c/y

Safe examples:

/*foo-:bar
/*foo-:bar-*baz

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

8.4.1

Fixed

  • Remove trie deduplication (#431) 6bc8e84
    • Using a trie required non-greedy matching, which regressed wildcards in non-ending mode by matching them up until the first match. For example:
      • /*foo with /a/b = /a
      • /*foo.htmlwith /a/b.html/c.html = /a/b.html
  • Allow backtrack handling to match itself (#427) 5bcd30b
    • When backtracking was introduced, it rejected matching things like /:"a"_:"b" against /foo__. This makes intuitive sense because the second parameter is not going to backtrack on anymore, but it's somewhat unexpected since there's no reason it shouldn't match the second`.

v8.4.0...v8.4.1

8.4.0

Important

Fixed

  • Restricts wildcard backtracking when using more than 1 in a path (#421)

Changed

  • Dedupes regex prefixes (#422)
    • This will result in shorter regular expressions for some cases using optional groups
  • Rejects large optional route combinations (#424)
    • When using groups such as /users{/delete} it will restrict the number of generated combinations to < 256, equivalent to 8 top-level optional groups and unlikely to occur in a real world application, but avoids exploding the regex size for applications that accept user created routes

8.3.0

Changed

Other

v8.2.0...v8.3.0

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 34 commits:


Depfu Status

Depfu will automatically keep this PR conflict-free, as long as you don't add any commits to this branch yourself. You can also trigger a rebase manually by commenting with @depfu rebase.

All Depfu comment commands
@​depfu rebase
Rebases against your default branch and redoes this update
@​depfu recreate
Recreates this PR, overwriting any edits that you've made to it
@​depfu merge
Merges this PR once your tests are passing and conflicts are resolved
@​depfu cancel merge
Cancels automatic merging of this PR
@​depfu close
Closes this PR and deletes the branch
@​depfu reopen
Restores the branch and reopens this PR (if it's closed)
@​depfu pause
Ignores all future updates for this dependency and closes this PR
@​depfu pause [minor|major]
Ignores all future minor/major updates for this dependency and closes this PR
@​depfu resume
Future versions of this dependency will create PRs again (leaves this PR as is)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants