secure-code-review
Skill22 starsChanged 5 months agoMITView on GitHub
The sinks and boundaries that belong to no framework: passing input to a shell or an evaluator, letting input choose a filesystem path, validating at a boundary that is not an HTTP request, and handling regulated data (PII, PHI, cardholder data) so it does not spread into paths nobody reviews. Use when generating or reviewing code that shells out, touches the filesystem, reads a queue message, CLI argument, or parsed file, or when a change crosses a PII, PHI, or PCI boundary.
10 other projects use a version of this.
Adopted by
Most recently taken up by
- hemapriyan-rk/claude-rigor-skillstheir own version, first seen Sep 26, 2026
- nahid-sparktales/agent-dispatchertheir own version, first seen Sep 21, 2026
- alizafarbati/opencode-agents-mcptheir own version, first seen Sep 8, 2026
- xAmirHamza77/PenKit51their own version, first seen Jul 6, 2026
- Hayatelin/devsecops-skillstheir own version, first seen Jun 27, 2026
- JayRHa/AgentSkillstheir own version, first seen Jun 9, 2026
Used with
Projects with it also use secrets-management and incident-response.
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.
xfstudioSkillsecrets-management
Implement secure secrets management for CI/CD pipelines using Vault, AWS Secrets Manager, or native platform solutions. Use when handling sensitive credentials, rotating secrets, or securing CI/CD environments.
Also in 3 projects that use this
AnthropicSkillincident-response
Run an incident response workflow — triage, communicate, and write postmortem. Trigger with "we have an incident", "production is down", an alert that needs severity assessment, a status update mid-incident, or when writing a blameless postmortem after resolution.
Also in 4 projects that use this
Other versions10 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 10
- zebbern/claude-code-guide★ 4.6ksame name
- UnitOneAI/SecuritySkills★ 78same name
- nahid-sparktales/agent-dispatcher★ 59same name
- Robotti-io/copilot-security-instructions★ 42same name
- Hack23/European-Parliament-MCP-Server★ 28same name
- JayRHa/AgentSkills★ 11same name
- xAmirHamza77/PenKit51★ 2same name
- alizafarbati/opencode-agents-mcp★ 1same name
- hemapriyan-rk/claude-rigor-skills★ 1same name
- Hayatelin/devsecops-skills★ 0same name
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 repository36 other files it gives its agents.
- AGENTS.mdAGENTS.md
- dist/AGENTS.mdAGENTS.md
- dist/CLAUDE.mdCLAUDE.md
- dist/copilot-instructions.mdCopilot instructions
- docs/llms-full.txtllms.txt
- docs/llms.txtllms.txt
- api-securitySkill
- auth-securitySkill
- cicd-securitySkill
- container-securitySkill
- cors-securitySkill
- crypto-misuseSkill
- database-securitySkill
- deserialization-securitySkill
- dynamic-verificationSkill
- electron-securitySkill
- error-handling-securitySkill
- file-upload-securitySkill
- frontend-securitySkill
- graphql-securitySkill
- iac-securitySkill
- iam-best-practicesSkill
- llm-app-securitySkill
- logging-securitySkill
- ml-securitySkill
- mobile-securitySkill
- protocol-securitySkill
- saas-securitySkill
- secret-detectionSkill
- security-regression-testsSkill
- serverless-securitySkill
- ssrf-preventionSkill
- supply-chain-securitySkill
- template-injectionSkill
- threat-modelingSkill
- websocket-securitySkill
The file
We split this skill into the rules it gives an agent
1 rule. 0 are common, 1 is distinctive, and 0 are very specific to this project.
0
Common
Most of the 8 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 74
Treat client-side validation as a control.
“Common” is measured: kept by at least 6 in 10 of the 8 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
Secure Code Review
Rules (for AI agents)
ALWAYS
- Validate input at every trust boundary, not only the HTTP one. A CLI argument, an
environment variable, a queue message, a filename, a parsed config or spreadsheet
cell all arrive from outside and none of them pass through the request-validation
layer. Check type, length, allowed characters and allowed range, and reject before
processing.
api-securityowns the HTTP request body and its schema; this rule is every other way input gets in. - Build a command as an argument vector, never as a string a shell will parse:
subprocess.run([...])withoutshell=True,execFile/spawnwith an array,exec.Command(name, args...). Passing an array is what removes the shell, and removing the shell is what removes the injection — quoting and escaping are the fallback for when you cannot. - Canonicalize then check any path built from input: resolve it to an absolute real
path, then confirm it is inside the intended directory. Checking the raw string first
misses
.., symlinks, absolute-path replacement, and encoded separators.file-upload-securityowns stored uploads and archive extraction; this rule covers a static-file handler, a template loader, a log path, an export filename. - Tag any function or module handling PII, PHI or cardholder data with an explicit
classification comment (
// classification: PII), and keep that handling in clearly-named modules rather than in general utility code. An untagged helper is how regulated data spreads into paths nobody reviews for it, and the tag is what makes the later review possible. - Consult the owner for anything with one:
database-securitywhen code builds a query,crypto-misusewhen it hashes, encrypts, signs or compares a secret,frontend-securityfor output encoding and response headers,auth-securityfor who the caller is,iam-best-practicesfor the privileges a process runs with. Each of those states its rule with the API names and the false positives this skill would have to leave out.
NEVER
- Pass input to a shell or an evaluator:
system,popen,os.system,subprocess.run(..., shell=True),child_process.exec/execSync, backticks,eval,new Function(),vm.runInNewContext,pickle.loadson a request body. The dangerous property is that the callee parses the string; a value that is only ever an argument is not the same risk. - Let input reach a path without canonicalization — including as a segment joined
onto a trusted base, which is where
../still works. - Treat client-side validation as a control. Re-validate on the server, and treat the client check as what it is: a message to the user, not a boundary.
- Store a payment card number, CVV, or full track data in your own database. Send the card to a tokenization provider and persist only the opaque token plus the last four digits. The CVV is never persisted at all, not even encrypted, not even briefly — retention is the violation, not exposure.
- Copy real regulated data into a fixture, a seed script, a local dump, or a bug report to reproduce something. The copy inherits the classification and leaves the reviewed path, which is the whole failure this skill's tagging rule exists to prevent.
KNOWN FALSE POSITIVES
- Obviously fake fixture data is not regulated data:
4111-1111-1111-1111,555-0100,John Doe,test@example.com. The classification rules apply to real data paths. - A command built entirely from constants, or one whose only variable parts are passed as separate argv elements, is not command injection. The finding is a shell parsing a string that input reached — not the presence of a subprocess call.
- A path joined from values the application itself generated — a UUID, a hash, a database id — is not traversal. The finding is a caller-supplied component.
- A regulated-data module that is correctly tagged and narrowly scoped is the rule working. The finding is untagged handling in general-purpose code.
Context (for humans)
This skill covers what is left when every framework-shaped concern has an owner. A
query has database-security. A response header has frontend-security. An endpoint
has api-security. What has no owner is the plain script: something shells out,
something opens a file whose name came from somewhere, something reads a queue message
and believes it. Those are not web vulnerabilities and no framework defends against
them, which is why this is the skill that fires on languages: ["*"] and on code with
no framework at all.
The command-execution rule is worth stating as a property rather than a list, because
the list is always incomplete. The property is: does the callee parse the string? A
shell does. eval does. A deserializer does. An argv array does not, and that is why
switching to one is a fix rather than a mitigation — there is no remaining parser for
an attacker to target.
The regulated-data rules came from a separate compliance skill and are deliberately narrow. They are not a compliance programme; they are the two decisions that get made in code and are expensive to reverse — where the classification is written down, and the fact that cardholder data does not live in your database.
References
references/verifying-findings.md— confirm or refute a finding, then lock itreferences/verifying-compliance-findings.md— tie a flagged control gap to a specific clause, then look for the evidence that the control actually firedchecklists/owasp_top10.yamlchecklists/injection_patterns.yaml- CWE-78 · CWE-22 · CWE-20.
- OWASP Top 10 2021.
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.

