This runs a structured security audit on your codebase, checking for everything from hardcoded credentials and SQL injection to missing CSRF protection and outdated dependencies. It scans your files against a three-tier checklist (critical, medium, low severity), then generates a detailed report with specific line numbers, attack scenarios, and before/after code fixes for each issue. The output format is thorough, maybe even verbose, but that's the point when you need to hand security findings to your team. Best used when you're preparing for a release, onboarding legacy code, or just want to catch the obvious security mistakes before they become incidents. It won't replace dedicated security tools but gives you a solid first pass.

GitHub stars
328
last updated
May 13, 2026

Install

$ npx -y skills add laolaoshiren/claude-code-skills-zh --skill security-audit --agent claude-code

Installs into .claude/skills of the current project.

Files

代码安全审计

触发条件

当用户要求安全检查、漏洞扫描、安全审计、依赖安全检查时激活此技能。

工作流程

  1. 确定审计范围 — 根据用户指定的目录/文件/代码段进行分析
  2. 静态安全扫描 — 按检查清单逐项排查
  3. 依赖安全检查 — 检查 package.json / requirements.txt / go.mod 等依赖文件
  4. 生成审计报告 — 按严重程度分类输出

检查清单

🔴 高危

  • 硬编码密钥/密码/API Key
  • SQL 注入风险(字符串拼接 SQL)
  • 命令注入(未过滤的 shell 命令)
  • 路径遍历(未校验的文件路径)
  • 反序列化漏洞
  • 未校验的 JWT/Token 验证

🟡 中危

  • XSS 风险(未转义的用户输入)
  • CSRF 保护缺失
  • 不安全的随机数生成
  • 敏感信息日志泄露
  • 过宽的权限设置
  • 缺少 Rate Limiting

🟢 低危

  • 缺少输入验证
  • 依赖版本过旧
  • 缺少安全头部(CSP, HSTS, X-Frame-Options)
  • 错误信息泄露内部细节
  • 缺少 HTTPS 强制

输出格式

## 🔒 安全审计报告

### 审计概览
- 审计范围:xxx
- 发现问题:🔴 高危 X 个 / 🟡 中危 X 个 / 🟢 低危 X 个

### 🔴 高危问题
#### 1. [文件路径:行号]
- **漏洞类型**:xxx
- **风险描述**:xxx
- **攻击场景**:攻击者可以通过 xxx 方式...
- **修复方案**:
  ```code
  // 修复前
  // 修复后

🟡 中危问题

...

🟢 低危问题

...

依赖安全

依赖名当前版本建议版本风险

修复优先级建议

  1. 立即修复:...
  2. 本周修复:...
  3. 长期改进:...

## 注意事项
- 提供修复前后的代码对比
- 对于每条漏洞,说明具体的攻击向量
- 优先级基于可利用性和影响范围判断

Sponsors

Details

Repository
github.com/laolaoshiren/claude-code-skills-zh
Category
Security
License
MIT
First seen
Jun 11, 2026

More from laolaoshiren/claude-code-skills-zh

All 19

Recommended

More Security
1sickn33 avatarbroken-authenticationsickn33/antigravity-awesome-skillsbroken authentication testing0skills.sh installs
2microsoft avatarazure-rbacmicrosoft/github-copilot-for-azureHelps users find the right Azure RBAC role for an identity with least privilege access, then generate CLI commands and Bicep code to assign it. Also provides gu103Kskills.sh installs
3cloudflare avatarsecurity-auditcloudflare/security-audit-skillSecurity audit of a codebase — web apps, APIs, services, CLI tools, libraries, daemons, and more. Use when asked to find security bugs, do a security review, au95.6Kskills.sh installs
4better-auth avatartwo-factor-authentication-best-practicesbetter-auth/skillsMulti-factor authentication with TOTP, OTP, backup codes, and trusted device management for Better Auth.36.5Kskills.sh installs
5wshobson avatarsolidity-securitywshobson/agentsMaster smart contract security best practices to prevent common vulnerabilities and implement secure Solidity patterns. Use when writing smart contracts, auditi15.8Kskills.sh installs
6affaan-m avatarsecurity-scanaffaan-m/everything-claude-codesecurity scan5.9Kskills.sh installs