security-review
Skill1 starsChanged 5 months agoMITView on GitHub
Audits a diff for this stack's top risks — tenant isolation on every business queryset (fail-closed, no client-supplied tenant id trusted), RBAC on every custom endpoint and @action, PII leakage in list endpoints/logs/exports, file-upload validation (content-type, size, extension, private storage), and secrets not committed. Use when reviewing a Django/DRF change before merge, auditing a new ViewSet or upload handler, checking a PR for security issues, or asked "is this safe to ship". Findings are confidence-gated. Run only on TRUSTED diffs — not hardened against prompt injection. Not for generic correctness/quality review (see code-review) or proving behavior works (see verify).
- Reads credentials
187 other projects use a version of this.
Adopted by
Most recently taken up by
- rafaelob/pragmatic-agent-skillstheir own version, first seen Oct 5, 2026
- Lukk17/agent-standardstheir own version, first seen Oct 5, 2026
- CaseyLabs/kc-secure-repo-templatetheir own version, first seen Oct 4, 2026
- HMBSbige/skillstheir own version, first seen Oct 3, 2026
- aprameyak/coding-skillstheir own version, first seen Oct 2, 2026
- hahuyhungdev/ai-coding-configtheir own version, first seen Oct 2, 2026
Used with
Projects with it also use kotlin-testing, configure-ecc and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
tpavanipradeepSkillkotlin-testing
Kotlin testing patterns with Kotest, MockK, coroutine testing, property-based testing, and Kover coverage. Follows TDD methodology with idiomatic Kotlin practices.
Also in 6 projects that use this
saxon-ySkillconfigure-ecc
Interactive installer for Everything Claude Code — guides users through selecting and installing skills and rules to user-level or project-level directories, verifies paths, and optionally optimizes installed files.
Also in 12 projects that use this
InfopibeSkillcontent-hash-cache-pattern
Cache expensive file processing results using SHA-256 content hashes — path-independent, auto-invalidating, with service layer separation.
Also in 12 projects that use this
InfopibeSkillralphinho-rfc-pipeline
RFC-driven multi-agent DAG execution pattern with quality gates, merge queues, and work unit orchestration.
Also in 10 projects that use this
mryeastcodeSkillpytorch-patterns
PyTorch deep learning patterns and best practices for building robust, efficient, and reproducible training pipelines, model architectures, and data loading.
Also in 9 projects that use this
berntpoppSkilldependency-cve-sweep
Use when handling Dependabot PRs, CodeQL/Trivy alerts, or doing a routine dependency/CVE sweep for this repo.
Also in 5 projects that use this
Other versions187 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 187
- github/awesome-copilot★ 40ksame name
- WorldFlowAI/everything-claude-code★ 4ksame name
- compozy/compozy★ 2.8ksame name
- getsentry/sentry-python★ 2.2ksame name
- xu-xiang/everything-claude-code-zh★ 2ksame name
- codeaholicguy/ai-devkit★ 1.6ksame name
- getsentry/skills★ 1ksame name
- microsoft/power-platform-skills★ 961same name
- thesongzhu/Friday★ 837same name
- ktnyt/cclsp★ 675same name
177 more not listed
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 repository49 other files it gives its agents.
- accessibilitySkill
- ai-evalsSkill
- ai-integrationSkill
- architecture-decisionsSkill
- audit-loggingSkill
- aws-servicesSkill
- browser-e2e-testingSkill
- celery-tasksSkill
- changelogSkill
- ci-cdSkill
- codebase-guideSkill
- code-reviewSkill
- commit-messageSkill
- cookie-auth-csrfSkill
- dashboard-data-designSkill
- db-concurrencySkill
- debugSkill
- dependency-auditSkill
- deploy-awsSkill
- design-systemSkill
- drf-apiSkill
- drf-zod-contractSkill
- frontend-perfSkill
- git-workflowSkill
- i18n-rtlSkill
- incident-responseSkill
- migrationsSkill
- money-decimalSkill
- multi-tenancySkill
- nextjs-moduleSkill
- observabilitySkill
- perf-reviewSkill
- production-readinessSkill
- product-ux-designSkill
- rbac-permissionsSkill
- react-querySkill
- skill-authoringSkill
- tailwind-shadcnSkill
- tenant-session-switchSkill
- threat-modelingSkill
- verifySkill
- version-checkSkill
- visual-ui-designSkill
- webhook-handlerSkill
- websockets-channelsSkill
- write-testsSkill
- zod-formsSkill
- zustand-stateSkill
- example-skillSkill
The file
We split this skill into the rules it gives an agent
3 rules. 0 are common, 0 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 165 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 26
Tenant isolation: Every business queryset scoped by the tenant FK (entreprise) and fail-closed — no tenant resolves to .none(), never all …
- Very specific: line 31
RBAC: Every custom endpoint and every @action carries an explicit permission — no endpoint relies on "logged in" alone.
- Very specific: line 39
Secrets: No keys, tokens, or .env values in the diff — config comes from the environment.
“Common” is measured: kept by at least 6 in 10 of the 165 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Security review (audit changes for top risks)
When to use
Reviewing a diff before merge on this stack, especially one that touches a
ViewSet, a custom @action, a serializer, an upload handler, an export, or
logging. Focus on the handful of risks that actually bite this architecture,
not a generic OWASP recital.
CAUTION — trusted diffs only. This skill reads code and follows its intent. It is not hardened against prompt injection. Do not run it on untrusted or attacker-controlled diffs; a hostile comment or string could steer the review.
Pattern
Walk the diff against a fixed checklist, and gate every finding by confidence: report Confirmed (you can point at the vulnerable line and the exploit), Likely (pattern is present but the sink is one hop away), or Question (needs the author to confirm). Never pad the report with speculative low-signal noise — a fail-closed tenant leak outranks a style nit by orders of magnitude.
The checklist
- Tenant isolation. Every business queryset scoped by the tenant FK
(
entreprise) and fail-closed — no tenant resolves to.none(), never all rows. The tenant comes fromrequest.user, never from a body/query param. Flag any rawModel.objects.get/filter(...)in a view that bypasses the scoped queryset, and any@actionthat re-queries without scoping (seemulti-tenancy). - RBAC. Every custom endpoint and every
@actioncarries an explicit permission — no endpoint relies on "logged in" alone. A new action without a{resource}_{action}gate is a finding (seerbac-permissions). - PII leakage. List/export serializers must not spill emails, phones, tokens, or internal ids beyond what the screen needs; logs and error payloads must not echo request bodies or secrets.
- File uploads. Validate content-type and extension and size; store to private storage (never a public-read S3 ACL); never trust the client filename.
- Secrets. No keys, tokens, or
.envvalues in the diff — config comes from the environment. Watch AI/search keys especially (seeai-integration). - Money & counters. Flag any balance/counter that reads a value into app code
and writes it back. A read-modify-write without
select_for_update()insidetransaction.atomic()is a race. Confirmed example: two concurrent requests both read100, both subtract, one write is lost. Require an atomicF()-style expression, a decimal type for money, and validation inside the locked block — an "insufficient funds" check outside the lock still oversells (seemoney-decimal,db-concurrency). - Object-level authz / BOLA. Validate every foreign-key id in the body or
params against the caller's tenant, not just the object being fetched. An
unvalidated FK lets a user reference or attach another tenant's row even when the
top-level queryset looks correctly scoped — e.g. posting a
category_idthat belongs to a different tenant. Re-scope each FK through the caller's queryset. - Auth & tokens. Tokens live in
HttpOnly/Secure/SameSitecookies, neverlocalStorage. Never log a token, cookie, orAuthorizationheader. No hand-rolled auth/session flow — lean on the framework. External credentials (third-party API keys, OAuth secrets) encrypted at rest, not stored plaintext.
Idioms — what a real finding looks like
# CONFIRMED — cross-tenant leak plus an unsafe upload, both attacker-reachable.
@action(detail=False, methods=["post"])
def bulk_send(self, request):
ids = request.data["invoice_ids"]
qs = Invoice.objects.filter(id__in=ids) # BUG: not tenant-scoped
# fix: qs = self.get_queryset().filter(id__in=ids) # reuse fail-closed scope
f = request.FILES["doc"]
if f.content_type == "application/pdf": # BUG: spoofable header only
default_storage.save(f.name, f) # public bucket + raw name
# fix: check f.size, whitelist the extension, sniff magic bytes, private storage
...OWASP quick-map
The generic OWASP list only earns its keep when pinned to a real sink. Three that bite this stack, confidence-gated like everything else:
- SSRF (server-side request forgery). Any server-side URL fetch in the AI /
OCR / RAG or webhook paths must validate the target against an egress
allowlist — never fetch a user- or model-supplied URL blindly. A model that
returns a link, or a webhook payload carrying a callback URL, is attacker
reachable; a blind
requests.get(url)there can hit169.254.169.254or an internal service. Confirmed when the fetched URL flows from request/model data with no host check (seewebhook-handler,ai-integration). - Injection escape hatches. The ORM parameterizes for you, so a plain
.filter(...)is safe — flag the code that leaves it:.raw(),.extra(),RawSQL(...),cursor.execute(f"... {x}"), or any string-built query. An id or name interpolated into that string is SQL injection even though the surrounding code "uses the ORM." - Security headers. Confirm Django
SECURE_*settings — HSTS (SECURE_HSTS_SECONDS),SECURE_SSL_REDIRECT, andSecure/HttpOnly/SameSitesession and CSRF cookies — plus a Content-Security-Policy on the frontend. Missing HSTS or a permissive CSP is Likely, not Confirmed, unless you can show the header is actually absent in a response.
Adapt to your repo
Rename entreprise/Entreprise and the tenant accessor (user.entreprise_id vs
user.profile.entreprise_id) to match your project. Confirm where "logged in" is
enforced globally so you can spot endpoints that only have that and nothing more.
Know your storage default (public vs private bucket) before judging upload code.
Gotchas
- Absence is the bug: a missing tenant filter or missing permission won't appear as a red line — you must notice what isn't there. Diff-only review misses it; open the whole changed view.
- A 200 that returns another tenant's row is worse than a 500 — verify the fix
actually fails closed, don't just eyeball the filter (see
verify). - Client-supplied
entreprise/tenantids, filenames, and content-types are all attacker-controlled — never trusted, even when "the frontend sets it". - Rank by blast radius, not count. One confirmed cross-tenant leak beats ten nits.
See also
multi-tenancyrbac-permissionsai-integrationwebhook-handlermoney-decimaldb-concurrency
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.

