-
Notifications
You must be signed in to change notification settings - Fork 890
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 #67
Comments
Thanks for your contribution. As this project is just a "satellite" of Mobile-Detect (php) and all patterns are generated based on Mobile-Detect, we have limited power to change the RegExs. BTW the string used to match patterns is the user-agent string. Do you think there's still an issue? |
An attacker can send a user-agent string of arbitrary length |
@cristianstaicu @darrenscerri @hgoebl Ok, I'm limiting the |
@hgoebl can you assign me to this? |
IMHO we should better limit the input size. @serbanghita (dumb question) how can I assign this to you? |
@hgoebl I think a global limit on the input size would be more appropriate than fiddling with the regexps. I think a limit of 500 characters is quite reasonable. |
hgoebl/mobile-detect.js#67 * simplified the Dell regex
Guys I took a look at the User-Agent database regarding Dell and simplified the regex, I also limited the length of the User-Agent to max 500 characters. |
Is this still a vulnerability or is everything good in 1.4.1? |
fixed in 1.4.0 |
The following regular expression used for parsing the user agent is vulnerable to ReDoS:
/Dell.*Streak|Dell.*Aero|Dell.*Venue|DELL.*Venue Pro|Dell Flash|Dell Smoke|Dell Mini 3iX|XCD28|XCD35|\b001DL\b|\b101DL\b|\bGS01\b/i
The slowdown is moderate: for 50.000 characters around 10 seconds matching time. I would suggest one of the following:
If needed, I can provide an actual example showing the slowdown.
The text was updated successfully, but these errors were encountered: