Trigger Conditions
Activate this skill when the user requests a security check, vulnerability scan, security audit, or dependency security check.
Workflow
- Determine audit scope — Analyze based on the directory/files/code snippet specified by the user
- Static security scan — Check item by item according to the checklist
- Dependency security check — Check dependency files such as package.json / requirements.txt / go.mod
- Generate audit report — Output classified by severity
Checklist
🔴 High Risk
- Hardcoded keys/passwords/API Keys
- SQL injection risk (string-concatenated SQL)
- Command injection (unfiltered shell commands)
- Path traversal (unvalidated file paths)
- Deserialization vulnerabilities
- Unvalidated JWT/Token verification
🟡 Medium Risk
- XSS risk (unescaped user input)
- Missing CSRF protection
- Insecure random number generation
- Sensitive information leakage in logs
- Overly broad permission settings
- Missing Rate Limiting
🟢 Low Risk
- Missing input validation
- Outdated dependency versions
- Missing security headers (CSP, HSTS, X-Frame-Options)
- Error messages leaking internal details
- Missing HTTPS enforcement
Output Format
## 🔒 安全审计报告
### 审计概览
- 审计范围:xxx
- 发现问题:🔴 高危 X 个 / 🟡 中危 X 个 / 🟢 低危 X 个
### 🔴 高危问题
#### 1. [文件路径:行号]
- **漏洞类型**:xxx
- **风险描述**:xxx
- **攻击场景**:攻击者可以通过 xxx 方式...
- **修复方案**:
```code
// 修复前
// 修复后
🟡 Medium-Risk Issues
...
🟢 Low-Risk Issues
...
Dependency Security
| Dependency Name | Current Version | Recommended Version | Risk |
|---|
Remediation Priority Recommendations
- Fix immediately: ...
- Fix this week: ...
- Long-term improvements: ...
## 注意事项
- 提供修复前后的代码对比
- 对于每条漏洞,说明具体的攻击向量
- 优先级基于可利用性和影响范围判断