skills/team/python-security-review/SKILL.md
OWASP-based security review of Python apps (FastAPI, Django, Flask). Detects framework and entry points, scans the OWASP Top 10 (2025) mapped to Python patterns (injection, insecure deserialization, SSTI, secrets, auth), runs bandit and pip-audit for evidence, and emits an exec summary plus graded findings. Use to audit Python for vulnerabilities. Not for architecture grading (python-architecture-checklist).
npx skillsauth add michaelalber/ai-toolkit python-security-reviewInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
"Security is not a product, but a process." — Bruce Schneier
Shared across the dotnet / python / php / rust security reviews — same values, language-specific threats.
| # | Value | What it means |
|---|-------|---------------|
| 1 | Validate at boundaries | Every external input validated and typed at the edge (Pydantic/serializers); never trust client data. |
| 2 | Parameterized queries only | No f-string / %-formatted SQL; bound parameters or the ORM everywhere. |
| 3 | Secrets out of code | No hardcoded secrets; env / secret-manager; never logged. |
| 4 | Authn/authz at every boundary | Authentication and authorization enforced server-side at each trust boundary; deny by default. |
| 5 | Least privilege & safe defaults | Minimal permissions; secure defaults; fail closed. |
| 6 | Protect data in transit & at rest | No sensitive data (passwords, tokens, PII) in logs; TLS; encryption at rest. |
| 7 | Dependencies pinned & audited | Versions pinned; pip-audit in CI; supply chain reviewed. |
| 8 | Evidence-based, graded findings | Every finding cites file:line + OWASP category + severity; report is graded and manager-readable. |
Shared skeleton: DETECT → SCAN → EXECUTIVE SUMMARY → GRADED FINDINGS.
DETECT Framework (FastAPI/Django/Flask + version), entry points (routes, views, tasks, CLIs),
and the data stores / external calls in scope.
SCAN Walk the Python Threat Checklist below, one OWASP category at a time. Gather evidence:
bandit -r <pkg> # static security analysis
pip-audit # known CVEs in dependencies
grep -rn "yaml.load(\|shell=True\|format(.*SELECT" <pkg>
Every issue becomes a finding with file:line, OWASP category, and severity.
EXEC SUMMARY Manager-friendly: risk grade, count by severity, top 3 risks in plain language.
FINDINGS Technical table: severity · location · OWASP · finding · remediation.
| OWASP (2025) | Python check | Severity signal |
|---|---|---|
| A01 Broken Access Control | Auth dependencies/decorators on every protected route; object-level checks (no IDOR); deny by default | Critical |
| A02 Cryptographic Failures | hashlib SHA-256+ (never MD5/SHA1 for security); secrets/os.urandom for tokens (not random); passlib/bcrypt for passwords | High |
| A03 Injection | ORM or bound params (no f-string/% SQL); no shell-command execution on input (subprocess(..., shell=True), shell helpers); no dynamic eval/exec on input | Critical |
| A04 Insecure Design | Server-Side Template Injection (Jinja2 rendering user input); open redirects | High |
| A05 Misconfiguration | DEBUG=False in prod; ALLOWED_HOSTS/CORS locked down; secure cookie flags; SECRET_KEY from env | High |
| A06 Vulnerable Components | pip-audit clean; versions pinned in pyproject.toml; no abandoned packages | High |
| A08 Integrity Failures | No insecure deserialization of untrusted input (native object deserialization, yaml.load without SafeLoader) | Critical |
| A09 Logging Failures | No passwords/tokens/PII in logs; auth and access failures logged | Medium |
| A10 SSRF | Outbound URLs from user input validated/allow-listed; no raw requests.get(user_url) | High |
Full per-category checklist: owasp python checklist.
<security-review-state>
language: python
mode: DETECT | SCAN | EXEC-SUMMARY | FINDINGS | COMPLETE
detected: [framework+version | entry points | data stores]
owasp_covered: [A01..A10 progress]
findings: [critical:N high:N medium:N low:N]
last_action: [what was just done]
next_action: [what should happen next]
</security-review-state>
Shared across all four security reviews. Executive summary template: executive summary.
## Security Review: [project] (Python)
**Framework**: [FastAPI/Django/Flask] | **Scope**: [paths] | **Risk grade**: [A–F]
### Executive Summary (manager-friendly)
[2–3 sentences: overall posture, the most serious risk in plain language, recommended next step.]
Findings: Critical [N] · High [N] · Medium [N] · Low [N]
### Technical Findings
| Severity | Location | OWASP | Finding | Remediation |
|----------|----------|-------|---------|-------------|
| CRITICAL | file:line | A03 | [pattern] | [fix] |
**Top 3 priorities**: 1. … 2. … 3. …
Risk grade: A no critical/high · B no critical, ≤2 high · C no critical, multiple high · D 1+ critical · F systemic (injection + secrets in code + broken access control).
file:line and the OWASP category. No speculative findings.python-architecture-checklist — note and route.security-review-federal after this base review.security-review-federal — Federal/gov overlay (NIST 800-53, FIPS, CUI, POA&M) applied on top of this base review.python-architecture-checklist — Companion for structure/maintainability; run first for context.supply-chain-audit — Deeper dependency/CVE and license analysis beyond pip-audit.dotnet / php / rust-security-review — Sibling skills sharing this exact Core Values + workflow + output.development
Interviews the user relentlessly about a plan, decision, or idea — one question at a time, each with a recommended answer. Shared engine behind "grill-me" and "grill-with-docs". Use on any "grill" trigger phrase or to stress-test thinking. Do NOT use to build the plan; it ends at shared understanding, not implementation.
testing
Runs a relentless interview to sharpen a plan or design, capturing the decisions as ADRs and a glossary along the way. Use when the user wants to be grilled AND wants the session to leave durable domain documentation behind. Do NOT use for a throwaway stress-test with no artifacts; use grill-me instead.
tools
OWASP-based security review of Vue/TypeScript front-ends. Detects framework (Vite/Vue CLI/Nuxt), entry points, and data flows; scans the OWASP Top 10 (2025) mapped to Vue client-side risks (raw-HTML XSS via v-html, URL/protocol injection, bundled secrets, insecure token storage, dependency CVEs, missing CSP, open redirects, router guard bypass); emits an exec summary plus graded findings. Use to audit Vue for vulnerabilities. Not for architecture grading (vue-architecture-checklist).
tools
Analyzes legacy Vue codebases and produces actionable modernization plans. Primary migration paths include Options API to Composition API, Vue 2 to Vue 3, Vue CLI to Vite, JavaScript to TypeScript, Vue Test Utils/Karma/Mocha to Vitest + Vue Testing Library, legacy Vuex to Pinia, and removed-in-Vue-3 pattern cleanup (filters, event bus, `$listeners`). Does NOT perform the migration — assesses, quantifies risk, and plans.