← ClaudeAtlas

secure-difflisted

Security self-check of your own diff before you hand it over: scan for secrets, then walk every new input path for injection, missing authorization, unsafe file and network access, and risky defaults, and prove each suspect with a quick probe. Use before committing or pushing agent-written code, for "security check my changes", "is this diff safe", "check for secrets", or any change touching auth, user input, files, shell commands, SQL, HTML output, URLs or config.
ychampion/ystack · ★ 4 · Code & Development · score 77
Install: claude install-skill ychampion/ystack
# Secure diff Agents add input paths fast and forget who can reach them. This is a short pass over your own change, done by the author, before anyone else reviews it. It complements a full review; it doesn't replace one. ## When it applies - Any diff that takes outside input, touches auth or permissions, runs commands, builds queries or HTML, reads or writes files by name, fetches URLs, or changes config and defaults. - Before the first push of agent-written code. ## Procedure ### 1. Secrets Scan the diff and any new files, including test fixtures, logs and notebooks: ```bash git diff <base> | grep -nEi '(api[_-]?key|secret|token|passw|bearer|private key|-----BEGIN)' ``` Use a real scanner if installed (`gitleaks`, `trufflehog`). Any real value found: remove it, use an env var or the project's secret store, and tell the user the value must be rotated if it was ever committed or pushed. ### 2. List the new inputs Every place the diff accepts data it didn't create: request params, headers, bodies, CLI args, env, files, uploads, webhooks, messages, model output. One line each, with file:line. ### 3. Walk each input to where it is used | Sink | Check | | --- | --- | | SQL / queries | parameters, never string concatenation | | Shell / process spawn | argument arrays, no shell string built from input | | HTML / templates | escaped by default; no raw-HTML escape hatch on input | | File paths | resolved and confined to an allowed directory; no `..` escape | | URLs fetch