This repository has been archived by the owner on Sep 6, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Regular Expression DoS vulnerability #15341
Comments
… 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
<#15341>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ART7KPQTK6YJAQVWRUHXVA3TIQM6PANCNFSM423CHLEA>
.
|
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.js2:
((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)
in brackets/src/extensions/default/JavaScriptQuickEdit/unittest-files/jquery-ui/tests/jquery-1.6.js3:
<(\w+?)\s+(?:[^<]*?\s)*?data-brackets-id='(\S+?)'
in brackets/test/spec/HTMLInstrumentation-test.js4:
-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.
The text was updated successfully, but these errors were encountered: