-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Regular Expression Denial of Service (ReDoS) #6012
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
Closed
Comments
vovikhangcdv
added a commit
to vovikhangcdv/moment
that referenced
this issue
Jun 7, 2022
Fixes: [moment#2936](moment#6012) Directly match the comment tokens in preprocessRFC2822 regex to resolve the problem [Regular Expression Denial of Service (ReDoS)moment#6012](moment#6012)
ichernev
pushed a commit
that referenced
this issue
Jul 6, 2022
8000
ichernev
pushed a commit
that referenced
this issue
Jul 6, 2022
This was referenced Jul 26, 2022
Pierre-Lannoy
added a commit
to Pierre-Lannoy/wp-device-detector
that referenced
this issue
Aug 16, 2022
Pierre-Lannoy
added a commit
to Pierre-Lannoy/wp-opcache-manager
that referenced
this issue
Aug 16, 2022
Pierre-Lannoy
added a commit
to Pierre-Lannoy/wp-apcu-manager
that referenced
this issue
Aug 16, 2022
Pierre-Lannoy
added a commit
to Pierre-Lannoy/wp-keys-master
that referenced
this issue
Aug 16, 2022
Pierre-Lannoy
added a commit
to Pierre-Lannoy/wp-ip-locator
that referenced
this issue
Aug 16, 2022
Pierre-Lannoy
added a commit
to Pierre-Lannoy/wp-sessions
that referenced
this issue
Aug 16, 2022
Pierre-Lannoy
added a commit
to Pierre-Lannoy/wp-traffic
that referenced
this issue
Aug 16, 2022
Pierre-Lannoy
added a commit
to Pierre-Lannoy/wp-vibes
that referenced
this issue
Aug 16, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
Affected versions of the package are vulnerable to Regular Expression Denial of Service (ReDoS) attacks for any string input controlled by the user.
An attacker can provide a specially crafted input to the default function
moment()
, which nearly matches the pattern being matched. This will cause the regular expression matching to take a long time, all the while occupying the event loop and preventing it from processing other requests and making the server unavailable (a Denial of Service attack).Proof of concept
Expected behavior
Execution time has to be linear, not polynomial.
Occurrences
/\([^)]*\)|[\n\t]/g
Impact
Any dependent pass user-controllable string inputs to package moment() could cause the denial of service attack. It happens in the default use of the package and potentially affects around 57,775 dependents (last access: June 7 2022).
The text was updated successfully, but these errors were encountered: