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 #510

Closed
cristianstaicu opened this issue Sep 8, 2017 · 11 comments
Closed

Vulnerable Regular Expression #510

cristianstaicu opened this issue Sep 8, 2017 · 11 comments

Comments

@cristianstaicu
Copy link

The following regular expression used in unescapeHTML is vulnerable to ReDoS:

/\&([^;]+);/g

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.

@simonstewart-bridgement

Any movement on this?

esamattis added a commit that referenced this issue Oct 3, 2018
@esamattis
Copy link
Owner

Maybe? #517

@esamattis
Copy link
Owner

Fix released in 3.3.5. Please reopen if still an issue.

@magesh0819
Copy link

magesh0819 commented Jun 11, 2019

Though the regex in question has been updated in unescapeHTML.js it is still present in underscore.string.js and underscore.string.min.js. Hence the 3.3.5 version in npm registry is still vulnerable to the Regular expression Denial of Service (ReDoS) attack.

I believe the dist was not recreated after the fix. Need to rebuild underscore.string.js and underscore.string.min.js and release new version to npm.

akito19 added a commit to akito19/sider-docs that referenced this issue Jun 19, 2019
under.score package had valnerability:
esamattis/underscore.string#510

Therefore, I upgraded the package together with other packages by `yarn
upgrade`. There will be tolerable execution since we have 8 days after
running `yarn upgrade` and almost upgraded packages were minor updates.
vBm added a commit to OmertaBeyond/OBv3 that referenced this issue Aug 21, 2019
@PenguinOfWar
Copy link

PenguinOfWar commented Feb 7, 2020

This appears to still be an issue. NPM audit is showing a vulnerability for this package even when fully up to date with the latest version.

Am I missing something?

@esamattis
Copy link
Owner

We tried to fix this issue sometime ago. Really not sure what should be done more to solve it. PRs are very much welcome.

I'll re-open this issue to get more eyes on it.

@PenguinOfWar
Copy link

We tried to fix this issue sometime ago. Really not sure what should be done more to solve it. PRs are very much welcome.

I'll re-open this issue to get more eyes on it.

Thanks @esamattis.

I have created a pull request for this issue: #525

Appreciate if you can check and, if happy, merge and redeploy to npm to resolve this vulnerability.

@PenguinOfWar
Copy link

Any update on this?

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

7 participants