Open core-ai-bot opened 3 years ago
Comment by KwasiEvans Thursday Apr 15, 2021 at 08:50 GMT
On Tue, 13 Apr 2021, 10:35 123, @.***> wrote:
We are working on the ReDoS https://www.owasp.org/index.php/Regular_expression_Denial_of_Service_-_ReDoS problem and detected 4 vulnerable regex(es) from your repository.
1: :((?:[\w\u00c0-\uFFFF-]|\.)+)(?:((['"]?)((?:([^)]+)|[^()])+)\2))? in brackets/src/extensions/default/JavaScriptQuickEdit/unittest-files/jquery-ui/tests/jquery-1.7.js 2: ((?:((?:([^()]+)|[^()]+)+)|[(?:[[^[]]]|['"][^'"]*['"]|[^[]'"]+)+]|\.|[^
+~,([\]+)+|[>+~])(\s,\s)?((?:.|\r|\n)) in brackets/src/extensions/default/JavaScriptQuickEdit/unittest-files/jquery-ui/tests/jquery-1.6.js 3: <(\w+?)\s+(?:[^<]?\s)?data-brackets-id='(\S+?)' in brackets/test/spec/HTMLInstrumentation-test.js 4: -webkit-gradient((?:[^(]?(?:((?:[^(]?(?:([^)]?))?)?))?)?)|(?:(?:-moz-|-ms-|-o-|-webkit-|:|\s)((repeating-)?linear-gradient)|(?:-moz-|-ms-|-o-|-webkit-|:|\s)((repeating-)?radial-gradient))(((?:[^)]?(?:([^)]?))?)?)) in brackets/src/extensions/default/QuickView/main.js
Please try the following:
var pattern = ":((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['\"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?";
var input = ":\\b(\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b";
var re = new RegExp(pattern);
var matched = input.match(re);
var pattern = "((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]\]|['\"][^'\"]['\"]|[^\[\]'\"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s,\s)?((?:.|\r|\n)*)";
var input = "[\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b";
var re = new RegExp(pattern);
var matched = input.match(re);
var pattern = "<(\w+?)\s+(?:[^<]?\s)?data-brackets-id='(\S+?)'";
var input = "<0 \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t <";
var re = new RegExp(pattern);
var matched = input.match(re);
var pattern = "-webkit-gradient\((?:[^\(]?(?:\((?:[^\(]?(?:\([^\)]?\))?)?\))?)?\)|(?:(?:-moz-|-ms-|-o-|-webkit-|:|\s)((repeating-)?linear-gradient)|(?:-moz-|-ms-|-o-|-webkit-|:|\s)((repeating-)?radial-gradient))(\((?:[^\)]?(?:\([^\)]?\))?)*?\))";
var input = "-webkit-gradient(\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b";
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.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/adobe/brackets/issues/15341, or unsubscribe https://github.com/notifications/unsubscribe-auth/ART7KPQTK6YJAQVWRUHXVA3TIQM6PANCNFSM423CHLEA .
Issue by linci8210 Tuesday Apr 13, 2021 at 10:34 GMT Originally opened as https://github.com/adobe/brackets/issues/15341
We are working on the ReDoS problem and detected 4 vulnerable regex(es) from your repository.
1:
:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?
in brackets/src/extensions/default/JavaScriptQuickEdit/unittest-files/jquery-ui/tests/jquery-1.7.js 2:((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)
in brackets/src/extensions/default/JavaScriptQuickEdit/unittest-files/jquery-ui/tests/jquery-1.6.js 3:<(\w+?)\s+(?:[^<]*?\s)*?data-brackets-id='(\S+?)'
in brackets/test/spec/HTMLInstrumentation-test.js 4:-webkit-gradient\((?:[^\(]*?(?:\((?:[^\(]*?(?:\([^\)]*?\))*?)*?\))*?)*?\)|(?:(?:-moz-|-ms-|-o-|-webkit-|:|\s)((repeating-)?linear-gradient)|(?:-moz-|-ms-|-o-|-webkit-|:|\s)((repeating-)?radial-gradient))(\((?:[^\)]*?(?:\([^\)]*?\))*?)*?\))
in brackets/src/extensions/default/QuickView/main.jsPlease try the following:
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.