code-review-python
Skill26 starsChanged 31 days agoMITView on GitHub
Security review of Python code — dangerous sinks and framework-specific pitfalls (Django/Flask/ FastAPI). Load when reviewing a Python codebase/PR, on .py source in scope, or "review this Python". Signals: requirements.txt/pyproject, Django/Flask/FastAPI, ORMs, pickle/yaml, subprocess.
- Reads credentials
2 other projects use a version of this.
Adopted by
Most recently taken up by
- NoorQureshi/roninword for word, first seen Oct 11, 2026
- NoorQureshi/security-skillsword for word, first seen Oct 11, 2026
Other versions2 projects use a version of this.
Word for word · 2
- NoorQureshi/security-skills★ 27100% same
- NoorQureshi/ronin★ 26100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository207 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- ad-adcsSkill
- ad-dacl-abuseSkill
- ad-delegation-abuseSkill
- ad-kerberoastingSkill
- ad-pivot-arsenalSkill
- ai-agent-tool-abuseSkill
- ai-insecure-output-handlingSkill
- ai-jailbreakSkill
- ai-llm-dosSkill
- ai-mcp-securitySkill
- ai-model-extractionSkill
- ai-prompt-injectionSkill
- ai-rag-poisoningSkill
- ai-sensitive-data-disclosureSkill
- ai-supply-chainSkill
- ai-system-prompt-leakageSkill
- api-auth-attacksSkill
- api-bolaSkill
- api-fuzzingSkill
- api-graphqlSkill
- api-grpcSkill
- api-mass-assignmentSkill
- api-mongo-agg-facet-bypassSkill
- api-testing-checklistSkill
- api-versioningSkill
- automation-browserSkill
- automation-nuclei-templatesSkill
- automation-recon-pipelineSkill
- cloud-azureSkill
- cloud-container-escapeSkill
- cloud-docker-api-abuseSkill
- cloud-docker-registrySkill
- cloud-gcpSkill
- cloud-iam-privescSkill
- cloud-imds-ssrfSkill
- cloud-kubernetesSkill
- cloud-s3-exposureSkill
- code-review-cicdSkill
- code-review-cppSkill
- code-review-dangerous-sinksSkill
- code-review-dotnetSkill
- code-review-goSkill
- code-review-iacSkill
- code-review-javaSkill
- code-review-methodologySkill
- code-review-nodejsSkill
- code-review-phpSkill
- code-review-rubySkill
- code-review-rustSkill
- code-review-secrets-detectionSkill
- code-review-soliditySkill
- crypto-oracle-attacksSkill
- crypto-rsa-attacksSkill
- ctf-cryptoSkill
- ctf-forensicsSkill
- ctf-methodologySkill
- ctf-pwnSkill
- ctf-revSkill
- The first 60 shown.
The file
Files
Python security code review
When it applies
You're reading Python source (a repo, a PR, a service). This is the language-specific companion to
code-review-methodology — the exact sinks and framework gotchas to grep and trace.
Why it works
Most severe Python bugs come from a known set of sinks plus framework misuse. Grep the sinks, trace each argument to a user source, and check the framework's safe-vs-unsafe API was used.
Sinks & patterns (grep, then trace to user input)
- Command exec:
os.system,subprocess.*(..., shell=True),os.popen— shell=True + user input = injection. - Code eval:
eval,exec,pickle.loads,yaml.load(withoutSafeLoader),marshal— deserialization/eval RCE. - SQL: raw/f-string queries,
.raw(),.extra(),cursor.execute("... %s" % x)— use params, not formatting. - SSRF:
requests.get/urllib/httpxon a user URL (→web-ssrf). - Path/upload:
open/send_file/os.path.joinwith user paths (traversal); zip extraction (zip-slip). - Template (SSTI):
render_template_string, Jinja from user input (→web-ssti). - Secrets: hardcoded keys/passwords;
DEBUG=Truein prod.
Framework specifics
- Django:
mark_safe/|safe(XSS),.raw()/.extra()(SQLi),DEBUG=True(info leak),SECRET_KEYexposure (session forgery), missing@login_required/object-level checks (IDOR),ALLOWED_HOSTS='*', pickle session serializer. - Flask:
render_template_string(SSTI),debug=True(Werkzeug console RCE), weakSECRET_KEY(session tampering —flask-unsign),send_filetraversal. - FastAPI: missing dependency-injected auth on routes, over-broad CORS, Pydantic not enforcing server-side authz (BOLA at the data layer).
Method
rg -n "shell=True|eval\(|exec\(|pickle.loads|yaml.load\(|render_template_string|\.raw\(|\.extra\(";
run bandit -r . and semgrep --config auto; triage by exploitable source→sink.
Gotchas
yaml.safe_loadand parameterized ORM queries are the safe variants — confirm which is used.- Bandit is noisy; rank by user-controllable input reaching the sink.
References
Bandit; Semgrep Python rules; OWASP Django/Flask cheat sheets.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

