Skip to content
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

npm audit: path-to-regexp outputs backtracking regular expressions #107

Open
dowski opened this issue Oct 23, 2024 · 1 comment
Open

npm audit: path-to-regexp outputs backtracking regular expressions #107

dowski opened this issue Oct 23, 2024 · 1 comment

Comments

@dowski
Copy link
Collaborator

dowski commented Oct 23, 2024

From npm audit:

path-to-regexp  7.0.0 - 7.2.0
Severity: high
path-to-regexp outputs backtracking regular expressions - https://github.com/advisories/GHSA-9wv6-86v2-598j
fix available via `npm audit fix --force`
Will install [email protected], which is a breaking change
node_modules/path-to-regexp
@dowski
Copy link
Collaborator Author

dowski commented Oct 23, 2024

We use path-to-regexp in the createRouteMatcher implementation which can be used in a middleware.ts file to control which requests have auth requirements enforced.

We use that library because it's what Next.js uses under the covers for routing in middleware. Next.js also vendors an older version ofpath-to-regexp.

In order to allow the same syntax for matching routes in middleware for convex-auth and other Next.js middleware, we're going to keep the old path-to-regexp version.

See the following article from the path-to-regexp author which includes details on avoiding route patterns that can trigger the issue.

https://blakeembrey.com/posts/2024-09-web-redos/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant