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

Mitigate against Redos #4

Merged
merged 2 commits into from
Feb 7, 2021
Merged

Mitigate against Redos #4

merged 2 commits into from
Feb 7, 2021

Conversation

Janpot
Copy link
Contributor

@Janpot Janpot commented Feb 7, 2021

Avoid turning

/*********************.js$

into regex

new RegExp("^\/(?:.*)(?:.*)(?:.*)(?:.*)(?:.*)(?:.*)(?:.*)(?:.*)(?:.*)(?:.*)(?:.*)(?:.*)(?:.*)(?:.*)(?:.*)(?:.*)(?:.*)(?:.*)(?:.*)(?:.*)(?:.*)\.js$")

which takes seconds to execute, while

new RegExp("^\/(?:.*)\.js$")

can achieve the same

@Janpot Janpot merged commit c03827c into master Feb 7, 2021
@Janpot Janpot deleted the redos branch February 7, 2021 12:41
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

Successfully merging this pull request may close these issues.

2 participants