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

GitHub Code Scanning / CodeQL on some regular expression code #1337

Open
mfranzke opened this issue Jun 28, 2021 · 0 comments
Open

GitHub Code Scanning / CodeQL on some regular expression code #1337

mfranzke opened this issue Jun 28, 2021 · 0 comments

Comments

@mfranzke
Copy link
Contributor

I am using Pattern Lab Node v5.14.3 on Mac, with Node v12.12, using a Vanilla Edition.

Expected Behavior

The build runs through without a feedback by CodeQL.

Actual Behavior

The build runs through without a feedback by CodeQL.

Steps to Reproduce

CodeQL reports a problem with the following regular expression:

const findPartialsRE = /{{#?>\s*([\w-\/.]+)(?:.|\s+)*?}}/g;

The exact message is:

Inefficient regular expression
This part of the regular expression may cause exponential backtracking on strings starting with '{{{{>.' and containing many repetitions of ' '.

Here's the related check on a current merge request (which changes themselves aren't related to this topic):
https://github.com/pattern-lab/patternlab-node/pull/1335/checks?check_run_id=2908755127

Sadly I'm not a regular expression expert. @geoffp, the previous change with commit 2485996 with a heavy simplification on the previous more complex regular expression has been made you – do you have the chance in supporting by having a look at this reporting ?

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

2 participants