prahladyeri / VisualAlchemist

Open source database diagramming and automation tool
GNU General Public License v3.0
728 stars 57 forks source link

Regular Expression DoS vulnerability #48

Closed yinxiL closed 4 months ago

yinxiL commented 3 years ago

We are working on the ReDoS problem and detected 1 vulnerable regex(es) from your repository.

1: ^"(?:[^\n\f\r"\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*" in VisualAlchemist/lib/prettify/lang-css.js

Please try the following:

var pattern = "^\"(?:[^\\n\\f\\r\"\\\\]|\\\\(?:\\r\\n?|\\n|\\f)|\\\\[\\S\\s])*\"";
var input = "\"\\\n\\\n\\\n\\\n\\\n\\\n\\\n\\\n\\\n\\\n\\\n\\\n\\\n\\\n\\\n\\\n\\\n\\\n\\\n\\\n\\\n\\\n\\\n\\\n\\\n\\\n\\\n\\\n\\\n\\\n\\\n\\\n\\\n\\\n\\\n\\\n\\\n\\\n\\\n\\\n\\\n\\\n\\\n\\\n\\\n\\\n\\\n\\\n\\\n\\\n\\\n\\\n\\\n\\\n\\\n\\\n\\\n\\\n\\\n\\\n\\\n\\\n\n";
var re = new RegExp(pattern);
var matched = input.match(re);

We didn’t create a pull request because we're not sure if these cases are possible to take place in your program, we also do not understand the functionality of these regexes as you do. Thank you for your understanding.

mullinmax commented 3 years ago

Is this even really an issue? There isn't a backend server to effect right? So why not let users slow down their own computer?

prahladyeri commented 4 months ago

This project is being decommissioned due to lack of general interest and use. It will come back in another avatar in a better form soon, stay tuned.