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

Regular Expression Denial of Service (ReDoS) [HIGH SEVERITY] #147

Open
vvscode opened this issue Jun 19, 2019 · 14 comments
Open

Regular Expression Denial of Service (ReDoS) [HIGH SEVERITY] #147

vvscode opened this issue Jun 19, 2019 · 14 comments

Comments

@vvscode
Copy link

vvscode commented Jun 19, 2019

Regular Expression Denial of Service (ReDoS)
Vulnerable module: useragent
Introduced through: useragent@2.3.0
Detailed paths
Introduced through: useragent@2.3.0
Overview
useragent allows you to parse user agent string with high accuracy by using hand tuned dedicated regular expressions for browser matching.

Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) when passing long user-agent strings.

This is due to incomplete fix for this vulnerability: https://snyk.io/vuln/SNYK-JS-USERAGENT-11000.

An attempt to fix the vulnerability has been pushed to master.

https://snyk.io/vuln/SNYK-JS-USERAGENT-11000

@daKmoR
Copy link

daKmoR commented Jun 30, 2019

just got the same report 😿

it seems to be already fixed on master? 🎉

would it be possible to release a new version 🤗 pretty please 🤗

@mastermatt
Copy link

@3rd-Eden is this on your radar by chance?

@daKmoR
Copy link

daKmoR commented Jul 29, 2019

friendly reminder 🤗

@vvscode
Copy link
Author

vvscode commented Aug 5, 2019

as temporary solution I've added

app.use((req, res, next) => {
  req.headers['user-agent'] = `${req.headers['user-agent']}`.substr(0, 150);
  next();
});

@vvscode
Copy link
Author

vvscode commented Aug 5, 2019

@3rd-Eden ping

@vvscode
Copy link
Author

vvscode commented Aug 5, 2019

@jfurler
Copy link

jfurler commented Aug 28, 2019

Friendly bump @3rd-Eden. We'd really appreciate a release, if that would fix the issue.

@ccapiaux
Copy link

ccapiaux commented Sep 8, 2019

@3rd-Eden do you have an update on the fix? (https://twitter.com/vvscode/status/1158378665555746821)

@ccapiaux
Copy link

ccapiaux commented Sep 9, 2019

as temporary solution I've added

app.use((req, res, next) => {
  req.headers['user-agent'] = `${req.headers['user-agent']}`.substr(0, 150);
  next();
});

Is this the only alternative / workaround for now? Has anyone considered either 1. releasing the fix separately or 2. using an alternative library?

Side:

An attempt to fix the vulnerability has been pushed to master.

Is @3rd-Eden the only contributor who can release a fixed version? @davidkwan95 and @ChALkeR I see you both have contributed to the repository in 2019.

Thanks a lot in advance for future replies! :)

@mitermayer
Copy link

Can someone fork this and apply this patch ?

@huntr-helper
Copy link

Bug Bounty

We have opened up a bounty for this issue on our bug bounty platform. Want to solve this vulnerability and get rewarded 💰? Go to https://huntr.dev/

We will submit a pull request directly to your repository with the fix as soon as possible. Want to learn more? Go to https://github.com/418sec/huntr 📚

Automatically generated by @huntr-helper...

@yahanvesh
Copy link

Hi team, its more than a year since no update for the fix, can someone suggest an alternative for this module?

@vvscode
Copy link
Author

vvscode commented Jan 19, 2021

I continue using it, just added a patch with https://github.com/ds300/patch-package

@liamcmitchell-sc
Copy link

liamcmitchell-sc commented Jan 6, 2022

The uap-core library of regexes that this is built on continue to be updated: ua-parser/uap-core#495
This project is already set up to download the latest regexes, nothing more we can do here.

Alternatives:

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

9 participants