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

Vulnerable Regular Expression #501

Closed
cristianstaicu opened this issue Sep 5, 2017 · 9 comments · Fixed by #504 or koajs/static-cache#73
Closed

Vulnerable Regular Expression #501

cristianstaicu opened this issue Sep 5, 2017 · 9 comments · Fixed by #504 or koajs/static-cache#73

Comments

@cristianstaicu
Copy link

The following regular expression used in the "o" formatter is vulnerable to ReDoS:

/\s*\n\s*/

The slowdown is moderately low: for 50.000 characters around 2 seconds matching time. However, I would still suggest one of the following:

  • remove the regex,
  • anchor the regex,
  • limit the number of characters that can be matched by the repetition,
  • limit the input size.

If needed, I can provide an actual example showing the slowdown.

@TooTallNate
Copy link
Contributor

Thanks for the report. Patch welcome! The %o formatter by design needs to remove the newlines but any performance optimizations are ❤️ 👍

@fadookie
Copy link

@TooTallNate As far as I can tell no security patch for this issue has yet been released for 3.x, is this in the works? Thanks!

@TooTallNate
Copy link
Contributor

@fadookie Yes correct, thanks for the nudge. v3.1.0 has now been published.

saadtazi pushed a commit to saadtazi/express that referenced this issue Oct 28, 2017
Fixes a security vulnerability: debug-js/debug#501
platinumazure added a commit to eslint/eslint that referenced this issue Dec 18, 2017
This version of debug addresses a minor ReDoS issue. See debug-js/debug#501, debug-js/debug#504 for more information. Looking at the rest of the changelog, this should be a pretty low-risk upgrade.
aladdin-add pushed a commit to eslint/eslint that referenced this issue Dec 19, 2017
This version of debug addresses a minor ReDoS issue. See debug-js/debug#501, debug-js/debug#504 for more information. Looking at the rest of the changelog, this should be a pretty low-risk upgrade.
@Yaniv-git
Copy link

Hello,
My name is Yaniv Nizry I’m an Application Security Researcher from CxSCA group at Checkmarx,
after looking into this issue we noticed that it might not have been resolved.
For more information please contact us at:
ScaAppSec@checkmarx.com

Thanks,
Yaniv

@Qix-
Copy link
Member

Qix- commented Sep 14, 2020

@yaniv-checkmarx Hi. Feel free to submit a report to me at josh.junon@protonmail.com if you think you've found a security issue with debug. Please be sure to specify exactly which versions and/or version ranges you think the vulnerability pertains to.

Thanks.

@Yaniv-git
Copy link

@Qix- Hi, I sent you on September 14th the email, don't know if you got it.
Are there any updates?

@Qix-
Copy link
Member

Qix- commented Oct 1, 2020

Hi @yaniv-checkmarx, I've been focused on other things the last few weeks. Apologies. I'll take a look within the next week to see if I can validate.

@Yaniv-git
Copy link

@Qix- pinging you on this issue :)

@Qix-
Copy link
Member

Qix- commented Nov 19, 2020

Confirmed, regressed in 6ab9525c9841b656d996e521cf86192d5647483a a long while ago.

Will push a fix, thank you for the report @yaniv-checkmarx @Eden-checkmarx. Apologies for the delay until now.

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

Successfully merging a pull request may close this issue.

5 participants