Skip to content
Back to skills

Sast Lite

ASecurity

Static security analysis for Python source via AST walking — finds command injection, insecure deserialization, eval/exec, weak crypto, SQL injection, disabled TLS verification, hardcoded secrets and more, each tagged with a CWE. Use when the user asks to "audit this code for vulnerabilities", "run a SAST scan", "security review this Python file", or before merging untrusted code.

  • 12 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added June 9, 2026
securitypythonrustshellbashsqlflaskapisecurity

Works with

  • api

Security analysis

A100/100

Pro scans all 3 files and shows the line behind each finding

Scanned September 22, 2026

npx -y skills add NovaCode37/claude-security-skills --skill sast-lite --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Sast Lite?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Sast Lite
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/novacode37-sast-lite/badge)](https://www.skillsdirectory.com/skills/novacode37-sast-lite)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: sast-lite
description: >-
  Static security analysis for Python source via AST walking — finds command
  injection, insecure deserialization, eval/exec, weak crypto, SQL injection,
  disabled TLS verification, hardcoded secrets and more, each tagged with a
  CWE. Use when the user asks to "audit this code for vulnerabilities", "run a
  SAST scan", "security review this Python file", or before merging untrusted
  code.
license: MIT
---

# SAST Lite

An AST-based static analyzer for Python. Instead of fragile regex matching, it
parses each file into an abstract syntax tree and inspects how dangerous APIs
are actually called — so `subprocess.run(cmd, shell=True)` is flagged while
`subprocess.run(["ls"])` is not. **No third-party dependencies.**

## When to use this skill

- "Audit / security-review this Python code."
- "Run a SAST scan on the project."
- Reviewing a PR or untrusted snippet before running it.
- A pre-merge CI gate for security regressions.

## What it detects

| Rule | CWE | Severity |
|------|-----|----------|
| `eval()` / `exec()` on dynamic input | CWE-95 | critical/high |
| `os.system` / `subprocess(shell=True)` | CWE-78 | high |
| `pickle`/`marshal` deserialization | CWE-502 | high |
| `yaml.load` without SafeLoader | CWE-20 | high |
| SQL via f-string / concat / `.format` / `%` | CWE-89 | high |
| `requests(verify=False)` | CWE-295 | high |
| Hardcoded password/secret literal | CWE-798 | high |
| `random` used for a token, password, OTP, nonce or salt | CWE-330 | high |
| Weak hash (md5/sha1) | CWE-327 | medium |
| `tempfile.mktemp` | CWE-377 | medium |
| `Flask(debug=True)` | CWE-489 | medium |
| Jinja2 `autoescape=False` | CWE-79 | medium |
| `assert` used for a security check | CWE-617 | medium |

## How to run it

```bash
# Scan a directory
python skills/sast-lite/analyzer.py src/

# JSON for tooling / CI
python skills/sast-lite/analyzer.py . --json

# Only show high+ severity
python skills/sast-lite/analyzer.py . --min-severity high
```

**Exit codes:** `0` clean · `1` issues found · `2` usage/parse error — ready
for CI gating.

## Recommended workflow for Claude

1. Run with `--json` and parse the issue list.
2. For each issue, open `path:line` and confirm the data flow is genuinely
   attacker-controllable (the analyzer is intra-procedural, so it may flag
   patterns that are safe in context).
3. Propose a concrete fix per finding — e.g. parameterized queries for
   `py.sql-injection`, `yaml.safe_load` for `py.yaml-load`,
   list-form `subprocess` calls for `py.subprocess-shell`.
4. Summarize by severity and CWE.

## Limitations

This is a *lite* analyzer: single-file, no cross-function taint tracking. It is
designed for fast, high-signal triage — not a replacement for a full SAST
suite. Treat findings as leads to verify, not automatic verdicts.

Files in this skill

  • SKILL.md2.7 KB
  • analyzer.py11.8 KB
  • tests/test_analyzer.py4 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in security →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.