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

[CodeQL] Improve MongoDB Output parsing to remove warning about ReDoS #560

Closed
hasezoey opened this issue Oct 19, 2021 · 1 comment
Closed

Comments

@hasezoey
Copy link
Collaborator

Github Severity: High
Actual Severity: Low

I post this issue, because i just dont know enough about Regexes & ReDoS to know how to fix the following:

if (/lib[\w-.]+(?=: cannot open shared object)/i.test(line)) {
const lib =
line.match(/(lib[\w-.]+)(?=: cannot open shared object)/i)?.[1].toLocaleLowerCase() ??

CodeQL message:

This regular expression that depends on library input may run slow on strings starting with 'lib' and with many repetitions of 'lib'.

@hasezoey
Copy link
Collaborator Author

With 2b733b4 the libsomething.so.1: cannot open shared object CodeQL warning is gone
and with 473c278 the exception in initAndListen CodeQL warning is also gone

so there are no CodeQL / ReDoS warnings anymore with the next version (8.6.1), closing

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

No branches or pull requests

1 participant