security-audit
Inspect code and configuration for common security risks before deployment, after sensitive feature changes, before client demo, before handover, or before merging high-risk code. Use when Codex needs
SKILL.mdskills/security-audit/SKILL.md
GitHubSecurity Audit
Use this skill when code must be reviewed from a security-risk perspective.
Core Rule
Keep findings evidence-based, specific, severity-ranked, and actionable. Do not print real secrets, do not make broad security claims from a partial review, and do not treat frontend hiding as security.
Workflow
- Understand audit scope:
- whole app or feature, frontend/backend/database/deployment scope, roles, sensitive data, APIs, uploads, integrations, environment, and recent changes reviewed
- Check for exposed secrets:
- source, config, tests, docs, Docker, CI/CD, frontend env vars, logs, debug output,
.envfiles, keys, tokens, private keys, webhook secrets, and passwords
- source, config, tests, docs, Docker, CI/CD, frontend env vars, logs, debug output,
- Check environment configuration:
.env.example, ignored real env files, production debug mode, production URLs, secure cookies, HTTPS, secret exposure to frontend bundles, and dev settings in production
- Check authentication:
- password hashing, safe login errors, token signing/verification, expiration, refresh token safety, logout revocation/cleanup, inactive/banned users, reset tokens, and verification flows
- Check backend authorization and access control:
- role checks, ownership, user/shop/branch/tenant/organization scope, ID guessing, privileged actions, role assignment abuse, and public registration privilege escalation
- Check API input validation:
- required fields, types, formats, enums, lengths, ranges, files, status transitions, pagination/search limits, request size, extra fields, and nested object validation
- Check injection risks:
- SQL/NoSQL, command, template, path traversal, unsafe dynamic queries, eval-like behavior, shell usage, unsafe HTML rendering, and unsafe redirects
- Check file upload security when applicable:
- type/size/content validation, randomized names, storage location, path traversal, private access controls, signed URLs, image processing, deletion policy, and error handling
- Check CORS, cookies, sessions, CSRF, and cross-origin behavior.
- Check error message and logging safety:
- stack traces, database errors, secrets, tokens, internal paths, auth enumeration, full request bodies, and safe server-only logs
- Check sensitive data exposure:
- API responses, frontend state, exports, reports, cache, logs, local/session/mobile storage, tokens, hashes, reset tokens, addresses, payment data, admin notes, and private files
- Check dependency and package risk where practical.
- Check rate limiting and abuse protection:
- login, registration, reset, OTP, upload, public forms, search, webhooks, payment callbacks, reports, AI endpoints, and email/SMS sending
- Check webhook and external integration security:
- signature verification, shared secrets, timestamp/replay protection, idempotency, retries, logging, and permission boundaries
- Check admin and privileged actions:
- role changes, refunds, payment status, exports, deletes, settings, audit logs, API keys, and destructive overrides
- Assign severity:
- Critical, High, Medium, Low, or Informational, with impact and deployment blocking status
- Recommend specific fixes and security tests.
- Provide deployment recommendation:
- safe to deploy, safe with fixes, or do not deploy until issues are fixed
- Summarize scope, findings, severity, affected files/areas, risks, fixes, checks, and follow-up actions.
Read references/security-audit-checklist.md for detailed security review categories, severity guidance, test recommendations, deployment recommendation rules, and the final report format.
Non-Negotiable Rules
- Do not print real secrets in the report.
- Do not claim the app is secure after only a partial review.
- Do not ignore backend authorization.
- Do not treat frontend hiding as security.
- Do not ignore cross-user, cross-shop, cross-branch, or cross-tenant access risks.
- Do not ignore file upload risks.
- Do not ignore injection risks from user input.
- Do not ignore production configuration.
- Do not expose sensitive data in examples.
- Do not remove security controls for convenience.
- Do not suggest disabling validation, auth, or permission checks.
- Do not run destructive commands.
- Do not make broad security claims without evidence.
- Keep findings specific, actionable, and severity-ranked.
Output Contract
When using this skill, provide:
- Audit scope and overall risk assessment.
- Severity-ranked findings summary.
- Critical, high, medium, low, and informational findings as applicable.
- Authentication review.
- Authorization and access control review.
- Input validation and injection review.
- File upload review when applicable.
- Data exposure, logging, frontend storage, and error message review.
- Configuration, CORS, cookies/session, dependency, webhook, rate-limit, and admin action review as applicable.
- Security tests or checks recommended.
- Deployment recommendation.
- Follow-up actions.