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

JS Scanner Runs Extremely Slow in CodeQL Analysis #2756

Open
laipz8200 opened this issue Feb 7, 2025 · 3 comments
Open

JS Scanner Runs Extremely Slow in CodeQL Analysis #2756

laipz8200 opened this issue Feb 7, 2025 · 3 comments

Comments

@laipz8200
Copy link

Hi,

We have observed that the JavaScript scanner in CodeQL runs extremely slowly. Below is a snippet from the logs:

[90/90 eval 156m41s] Evaluation done; writing results to codeql/javascript-queries/Security/CWE-730/RegExpInjection.bqrs.

more info

This task took 156 minutes to complete, leading to a total execution time of approximately 2.5 hours for our GitHub Actions workflow. This significantly impacts our CI/CD efficiency.

Expected Behavior

We expect the JavaScript scanning process to complete in a more reasonable timeframe to ensure smooth and efficient CI/CD pipelines.

Actual Behavior

The scanning process is taking an excessive amount of time, causing long delays in our GitHub Actions runs.

@redsun82
Copy link
Contributor

redsun82 commented Feb 7, 2025

👋 @laipz8200 I'm sorry to hear you encountered this problem. It seems like the RegExpInjection query explodes on your repository. I will forward this info to the internal team working on it, having your repository as a reproducer will surely help!

@asgerf
Copy link

asgerf commented Feb 7, 2025

Hi @laipz8200.

Thanks for the report.

As also mentioned in github/codeql#18584, this is a consequence of our recent switch to the same data flow library used by other languages. There are rare cases where this type of slowdown can occur and we're looking into ways to fix it, but for now I've added this reproduction case to our internal tracking issue.

In the meantime, the best workaround I can offer is to disable the specific query, by adding this to a file called .github/codeql/codeql-configuration.yml:

query-filters:
  - exclude:
      id: js/regex-injection

@laipz8200
Copy link
Author

In the meantime, the best workaround I can offer is to disable the specific query, by adding this to a file called .github/codeql/codeql-configuration.yml:

Thank you all very much for your responses. I tried adding the configuration file to the project, but it doesn’t seem to have solved the problem. I’m using GitHub’s default configuration—should I switch to the advanced configuration?

Here is the PR I used for testing: langgenius/dify#13365

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

3 participants