Skip to content
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

Regular Expression DoS vulnerability in the gedit3 plugin #191

Open
yinxiL opened this issue May 29, 2020 · 1 comment
Open

Regular Expression DoS vulnerability in the gedit3 plugin #191

yinxiL opened this issue May 29, 2020 · 1 comment

Comments

@yinxiL
Copy link

yinxiL commented May 29, 2020

Regular Expression DoS vulnerability in the gedit3 plugin

We are working on the ReDoS problem and detected two vulnerable regexes from your gedit3 plugin code.

Vulnerable regex 1:
.+(<.+>)+([0-9]+)(<.+>)+.* in link
It takes forever for the regex to match the string
"\b<\b>0<\b><><\b><><\b><><\b><><\b><><\b><><\b><><\b><><\b><><\b><><\b><><\b><><\b><><\b><><\b><><\b><><\b><><\b><><\b><><\b><><\b><><\b><><\b><><\b><>\n"
We suggest you change the structure (<.+>)+.*, since "." can accept "<" and ">".

Vulnerable regex 2:
</?[\w:-]+(?:\s+[\w-:]+(?:\s*=\s*(?:(?:"[^"]")|(?:'[^\']')|[^>\s]+))?)\s(/?)>$
in link and link
This vulnerability can be triggered by
"<- -=\"\" -=\"\" -=\"\" -=\"\" -=\"\" -=\"\" -=\"\" -=\"\" -=\"\" -=\"\" -=\"\" -=\"\" -=\"\" -=\"\" -=\"\" -=\"\" -=\"\" -=\"\" -=\"\" -=\"\" -=\"\" -=\"\" -=\"\" -=\"\" -=\"\"\b"
Both \s+[\w\-:]+\s*=\s*"[^"]*" and \s+[\w\-:]+\s*=\s*[^>\s]+ can match " -=\"\"", we suggest you to change (?:"[^"]*") since this branch is mainly included in [^>\s]+.

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.

@abergmann
Copy link

CVE-2020-23469 was assigned to this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants