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

Limit str to 100 to avoid ReDoS of 0.3s #89

merged 1 commit into from May 16, 2017
File filter...
Filter file types
Jump to file or symbol
Failed to load files and symbols.
+1 −1
Diff settings


Just for now

Limit str to 100 to avoid ReDoS of 0.3s

  • Loading branch information...
karenyavine committed Apr 12, 2017
commit 305f2ddcd4eff7cc7c518aca6bb2b2d2daad8fef
Copy path View file
@@ -46,7 +46,7 @@ module.exports = function(val, options) {

function parse(str) {
str = String(str);
if (str.length > 10000) {
if (str.length > 100) {
var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(
ProTip! Use n and p to navigate between commits in a pull request.