Version: master branch
Subsystem: readline
lib/readline.js contains this code snippet:
Interface.prototype._wordLeft = function() {
if (this.cursor > 0) {
var leading = this.line.slice(0, this.cursor);
var match = leading.match(/(?:[^\w\s]+|\w+|)\s*$/);
this._moveCursor(-match[0].length);
}
};
This regex is quadratic: /(?:[^\w\s]+|\w+|)\s*$/.
I would be shocked if this were a viable ReDoS vector (hence the public bug report), but if this.line can be long (100K chars?) then it might present a performance problem.
I have not investigated reachability/triggerability nor the use cases of readline.
Version: master branch
Subsystem: readline
lib/readline.jscontains this code snippet:This regex is quadratic:
/(?:[^\w\s]+|\w+|)\s*$/.I would be shocked if this were a viable ReDoS vector (hence the public bug report), but if
this.linecan be long (100K chars?) then it might present a performance problem.I have not investigated reachability/triggerability nor the use cases of readline.