Skip to main content
command CX Codex

security-audit · centminmod — Claude Code command: audit and install

The security-audit command scans a codebase for vulnerabilities and unsafe patterns across a project or a specific module.

MIT ★ 2,744 updated 2026-10-08

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/commands/security-audit.md
Open on GitHub

What security-audit does

The command checks code for common security issues, including weak password handling, access-control gaps, SQL injection, XSS, exposed secrets, and vulnerable dependencies. It draws on OWASP guidance and covers frontend, backend, database, and infrastructure code.

Its report groups findings by severity and gives each issue a location, an explanation of potential impact, and a remediation suggestion. It also provides general recommendations. The prompt asks for file locations and line numbers; findings still need contextual review to avoid false positives.

What it helps with

  • find SQL injection risks in a codebase
  • review authentication and permission checks
  • locate hardcoded secrets and API keys
  • check file-upload handling for security risks
  • organize findings by severity and suggested fixes

Example prompts for the agent

  • /security-audit Audit this project for security issues and write a report with remediation steps.
  • /security-audit Review the authentication module for problems with password handling and access control.
  • /security-audit Look for SQL injection and unsafe file-upload handling.

How to install security-audit

Manually: put the files in place

.claude/commands/security-audit.md

Call it with /security-audit. For all projects use ~/.claude/commands/

Questions about security-audit

How do I install security-audit in Claude Code?

Place the command file at .claude/commands/security-audit.md.

What does security-audit do?

It scans code for vulnerabilities and unsafe patterns, then reports their severity, location, impact, and possible fixes.

Which parts of a project does security-audit review?

It checks frontend, backend, database, and infrastructure code. The checklist includes authentication, input handling, API security, and data protection.

Source text

security-audit.md · MIT
# Security Audit

Perform a comprehensive security audit of the codebase to identify potential vulnerabilities, insecure patterns, and security best practice violations.

## Usage Examples

### Basic Usage
"Run a security audit on this project"
"Check for security vulnerabilities in the authentication module"
"Scan the API endpoints for security issues"

### Specific Audits
"Check for SQL injection vulnerabilities"
"Audit the file upload functionality for security risks"
"Review authentication and authorization implementation"
"Check for hardcoded secrets and API keys"

## Instructions for Claude

When performing a security audit:

1. **Systematic Scanning**: Examine the codebase systematically for common vulnerability patterns
2. **Use OWASP Guidelines**: Reference OWASP Top 10 and other security standards
3. **Check Multiple Layers**: Review frontend, backend, database, and infrastructure code
4. **Prioritize Findings**: Categorize issues by severity (Critical, High, Medium, Low)
5. **Provide Remediation**: Include specific fixes for each identified issue

### Security Checklist

#### Authentication & Authorization
- Password storage and hashing methods
- Session management security
- JWT implementation and validation
- Access control and permission checks
- Multi-factor authentication support

#### Input Validation & Sanitization
- SQL injection prevention
- XSS (Cross-Site Scripting) protection
- Command injection safeguards
- Path traversal prevention
- File upload validation

#### Data Protection
- Encryption in transit (HTTPS/TLS)
- Encryption at rest
- Sensitive data exposure
- API key and secret management
- PII handling compliance

#### Common Vulnerabilities
- CSRF protection
- Clickjacking prevention
- Security headers configuration
- Dependency vulnerabilities
- Insecure direct object references

#### API Security
- Rate limiting implementation
- API authentication methods
- Input validation on endpoints
- Error message information leakage
- CORS configuration

### Output Format

Provide a structured security report with:

```markdown
## Security Audit Report

### Summary
- Total issues found: X
- Critical: X, High: X, Medium: X, Low: X

### Critical Issues
#### 1. [Issue Name]
- **Location**: file.js:line
- **Description**: Detailed explanation
- **Impact**: Potential consequences
- **Remediation**: Specific fix with code example

### High Priority Issues
[Similar format]

### Medium Priority Issues
[Similar format]

### Low Priority Issues
[Similar format]

### Recommendations
- General security improvements
- Best practices to implement
- Tools and libraries to consider
```

Remember to:
- Be specific about file locations and line numbers
- Provide code examples for fixes
- Explain the security impact clearly
- Avoid false positives by understanding the context

© centminmod · MIT · centminmod/my-claude-code-setup

Similar slash commands

All slash commands for Security →

security-audit by other authors comes first.

security-audit davila7 security-audit runs a structured security review on your codebase, dependencies, and configuration. Handy before shipping to production or during code audits. CX Codex +1 1,485installs security-audit FlorianBruniaux The security-audit command for Claude Code and Codex inspects a project alongside Claude Code settings. It checks for exposed secrets, dependency flaws, injection risks, and hook issues, then returns a score and remediation plan. CX Codex +1 ★ 6,529repo stars supabase-security-audit davila7 Runs a Supabase security audit: RLS policies, permissions, auth setup, and API key handling. Point it at a project and it returns a report with vulnerabilities and fixes. CX Codex +1 1,020installs api-security-audit davila7 api-security-audit — a subagent that hunts for holes in REST API authentication, authorization and data handling. Handy before a release or after an incident. CX Codex 3,202installs convex-security-audit waynesutton convex-security-audit — a skill that walks through a Convex app's security and writes up what it finds. Useful before a launch or after an incident. CX Codex +1 1,600installs mcp-security-audit official github mcp-security-audit scans .mcp.json files for hardcoded secrets, shell injection patterns, and unpinned package dependencies. Runs before commits or when onboarding new MCP servers to a repository. CX Codex +1 1,100installs wxmini-security-audit reason-machines The wxmini-security-audit skill inspects decompiled wxapkg bundles for leaked secrets, API endpoints, weak crypto and vulnerabilities. Run it before shipping a mini-program. CX Codex +1 1,100installs audit-xcode-security-settings superagents-lab audit-xcode-security-settings runs a security pass over an Xcode project's build settings and switches on Clang warnings, analyzer checkers and Enhanced Security in stages. Useful when you need to harden a project. CX Codex +1 769installs

From the same set35

The whole set →
03_code_review 03_code_review — a prompt for reviewing Python diffs. It forces Claude to return exactly three concrete issues as a bulleted list without conversational filler. GP ChatGPT ★ 2,744repo stars ccusage-daily This command runs ccusage daily -b and turns Claude Code usage figures into a Markdown report. Use it to review costs, token totals, and daily spending. CX Codex +1 ★ 2,744repo stars create-readme-section The create-readme-section command for Claude Code generates README sections based on project files. Create installation instructions, API references, or contribution guides. CX Codex +1 ★ 2,744repo stars 01_claudemd_summarise 01_claudemd_summarise — a Claude Code prompt that compresses CLAUDE.md documentation into exactly 120 words in a single paragraph, without headings or lists. Use it to standardize project architecture summaries for AI coding context. GP ChatGPT ★ 2,744repo stars check-best-practices The check-best-practices command reviews code against language-specific standards, conventions, and best practices. It spots issues from critical bugs to style violations and suggests concrete improvements. CX Codex +1 ★ 2,744repo stars claude-docs-consultant claude-docs-consultant pulls official Claude Code documentation directly from code.claude.com on demand. Fetches only the markdown files needed for the active task. CX Codex +1 ★ 2,744repo stars explain-architecture-pattern The explain-architecture-pattern command identifies architecture and design patterns in a codebase, then explains the structure behind them. Use it when the project’s organization needs a clear rationale. CX Codex +1 ★ 2,744repo stars convert-to-test-driven-prompt convert-to-test-driven-prompt turns a plain request into a TDD-style prompt with test cases, expected outcomes, and success criteria. Useful when behavior needs to be pinned down before code exists. CX Codex +1 ★ 2,744repo stars

Project sponsors

Companies that keep this analytics open