Practical overview
When it fits
Use it during Solidity development or code review when you want repeatable Semgrep checks for exploit-related patterns and gas optimization, either locally or in CI.
Who it is for
- Solidity developers who want to check code for known vulnerability patterns.
- Teams adding smart-contract security and performance checks to CI.
- Auditors who want Semgrep rules covering exploit-related patterns as part of code review.
Documented uses
- Scan a Solidity project with the repository’s security rules.
- Check code for patterns such as reentrancy, oracle manipulation and missing access controls.
- Include security and gas-optimization rules in a GitHub Actions workflow.
Requirements & limits
The rules are available in a public GitHub repository and are also listed in the Semgrep registry. Some taint-mode analysis requires Semgrep Pro.
- Semgrep currently supports Solidity in experimental mode, and the README warns that some rules may not work as expected.
- The collection includes both security and gas-optimization rules, so teams can include both types of checks in CI.
- Rules using taint mode require Semgrep Pro for intra-procedural taint analysis.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Add the rules to a GitHub Actions workflow
Configure the documented workflow to run security and gas-optimization rules on pull requests or on demand.
Before you start
- A GitHub repository containing the Solidity project.
- GitHub Actions and the workflow permissions needed for checkout and SARIF upload.
Steps
Create
.github/workflows/run-semgrep.yaml.Use the README workflow pattern to check out the project and this rules repository into a
rulesdirectory.Configure
SEMGREP_RULESwithrules/solidity/security rules/solidity/performanceand runsemgrep ci --sarif --output=semgrep.sarif || true.Use the documented SARIF upload step to send the output to GitHub Advanced Security.
Expected outcome
The workflow is configured to scan pull requests and support on-demand runs, then upload SARIF output.
Guide limitations
- The README workflow excludes pull requests created by Dependabot.
- Semgrep's Solidity support is experimental; some rules may not work as expected.
- Some taint-mode analysis requires Semgrep Pro.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 16 October 2026
- Original website title
- Decurity/semgrep-smart-contracts · Official homepage title · retained in its source language

