JavaScript support in Semgrep Code
Semgrep Code is a static application security testing (SAST) tool that detects security vulnerabilities in your first-party code.Analyses and frameworks
- Framework-specific control flow analysis
- Interfile analysis (cross-file)
- Interprocedural analysis (cross-function)
- All analyses performed by Semgrep Community Edition (CE)
Coverage
Semgrep aims to provide comprehensive and accurate detection of common OWASP Top 10 issues in source code. Semgrep uses rules, which are instructions based on which it detects patterns in code. These rules are usually organized in rulesets. By default, Semgrep Code provides you with thep/comment and p/default rulesets. These rulesets provide the most accurate and comprehensive coverage across Semgrep’s supported languages.
In addition to rules, the Semgrep engine itself can analyze code and implicit dataflows in the context of the following supported frameworks:
Semgrep Code supports 50+ libraries & frameworks based on their overall popularity.
Semgrep Code supports 50+ libraries & frameworks based on their overall popularity.
Benchmark results exclusive of AI processing
Semgrep’s benchmarking process involves scanning open source repositories, triaging the findings, and making iterative rule updates. This process was developed and is used internally by the Semgrep security research team to monitor and improve rule performance. Results as of February 25, 2025:JavaScript support in Semgrep Supply Chain
Semgrep Supply Chain is a software composition analysis (SCA) tool that detects security vulnerabilities in your codebase introduced by open source dependencies.Supported package managers
Semgrep supports the following JavaScript package managers:- npm
- Yarn
- pnpm
Analyses and features
The following analyses and features are available for JavaScript: Reachability analysis Reachability refers to whether or not a vulnerable code pattern from a dependency is used in the codebase that imports it. In Semgrep Supply Chain, both a dependency’s vulnerable version and code pattern must match for a vulnerability to be considered reachable. License detection Semgrep Supply Chain’s license compliance feature enables you to explicitly allow or disallow (block) a package’s use in your repository based on its license. For example, your company policy may disallow the use of packages with the Creative Commons Attribution-NonCommercial (CC-BY-NC) license. Semgrep can help enforce this restriction. Malicious dependency detection Semgrep is able to detect malicious dependencies in your projects and in pull requests (PRs) or merge requests (MRs). SBOM generation Semgrep enables you to generate a software bill of materials (SBOM) to assess your third-party dependencies and comply with auditing procedures. Semgrep Supply Chain (SSC) can generate an SBOM for each repository you have added to Semgrep AppSec Platform.JavaScript support in Semgrep CE
Semgrep CE is a fast, lightweight program analysis tool that can help you detect bugs in your code. It makes use of Semgrep’s LGPL 2.1 open source engine.Analyses
- Single-file, cross-function constant propagation
- Single-function taint analysis
- Semantic analysis
Coverage
The Semgrep Registry provides the following JavaScript rulesets:p/javascriptp/eslintp/expressjsp/hapip/headless-browserp/koap/nextjsp/nestjsp/nodejsp/typescript