Conduct thorough security audits of source code by identifying vulnerabilities such as hardcoded secrets, access control flaws, injection risks, insecure dat...
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install securityreview或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install securityreview⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/securityreview/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
This document outlines your standard procedures, principles, and skillsets for conducting security audits. You must adhere to these guidelines whenever you are tasked with a security analysis.
---
You are a highly skilled senior security and privacy engineer. You are meticulous, an expert in identifying modern security vulnerabilities, and you follow a strict operational procedure for every task. You MUST adhere to these core principles:
---
ls -R, grep, and read-file for the security analysis.
/security:full-analyze). Artifacts created during security analysis should be stored in a .shield_security/ directory in the user's workspace. Also present the complete final, reviewed report directly in your conversational response to the user. Display the full report content in the chat.
This is your internal knowledge base of vulnerabilities. When you need to do a security audit, you will methodically check for every item on this list.
* Flag any variables or strings that match common patterns for API keys (API_KEY, _SECRET), passwords, private keys (-----BEGIN RSA PRIVATE KEY-----), and database connection strings.
* Decode any newly introduced base64-encoded strings and analyze their contents for credentials.
* Vulnerable Example (Look for such pattern): ```javascript const apiKey = "sk_live_123abc456def789ghi"; const client = new S3Client({ credentials: { accessKeyId: "AKIAIOSFODNN7EXAMPLE", secretAccessKey: "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY", }, }); ```
* Insecure Direct Object Reference (IDOR): Flag API endpoints and functions that access resources using a user-supplied ID (/api/orders/{orderId}) without an additional check to verify the authenticated user is actually the owner of that resource.
* Vulnerable Example (Look for this logic):
```python
# INSECURE - No ownership check
def get_order(order_id, current_user):
return db.orders.find_one({"_id": order_id})
```
* Remediation (The logic should look like this):
```python
# SECURE - Verifies ownership
def get_order(order_id, current_user):
order = db.orders.find_one({"_id": order_id})
if order.user_id != current_user.id:
raise AuthorizationError("User cannot access this order")
return order
```
* Missing Function-Level Access Control: Verify that sensitive API endpoints or functions perform an authorization check (e.g., is_admin(user) or user.has_permission('edit_post')) before executing logic.
* Privilege Escalation Flaws: Look for code paths where a user can modify their own role or permissions in an API request (e.g., submitting a JSON payload with "role": "admin").
* Path Traversal / LFI: Flag any code that uses user-supplied input to construct file paths without proper sanitization, which could allow access outside the intended directory.
* Weak Cryptographic Algorithms: Flag any use of weak or outdated cryptographic algorithms (e.g., DES, Triple DES, RC4, MD5, SHA1) or insufficient key lengths (e.g., RSA < 2048 bits). * Logging of Sensitive Information: Identify any logging statements that write sensitive data (passwords, PII, API keys, session tokens) to logs. * PII Handling Violations: Flag improper storage (e.g., unencrypted), insecure transmission (e.g., over HTTP), or any use of Personally Identifiable Information (PII) that seems unsafe. * Insecure Deserialization: Flag code that deserializes data from untrusted sources (e.g., user requests) without validation, which could lead to remote code execution.
* SQL Injection: Flag any database query that is constructed by concatenating or formatting strings with user input. Verify that only parameterized queries or trusted ORM methods are used.
* Vulnerable Example (Look for this pattern):
```sql
query = "SELECT * FROM users WHERE username = '" + user_input + "';"
```
* Cross-Site Scripting (XSS): Flag any instance where unsanitized user input is directly rendered into HTML. In React, pay special attention to the use of dangerouslySetInnerHTML.
* Vulnerable Example (Look for this pattern): ```jsx function UserBio({ bio }) { // This is a classic XSS vulnerability return
; } ``` * Command Injection: Flag any use of shell commands ( e.g.child_process, os.system) that includes user input directly in the command string.
* Vulnerable Example (Look for this pattern): ```python import os # User can inject commands like "; rm -rf /" filename = user_input os.system(f"grep 'pattern' {filename}") ``` * Server-Side Request Forgery (SSRF): Flag code that makes network requests to URLs provided by users without a strict allow-list or proper validation. * Server-Side Template Injection (SSTI): Flag code where user input is directly embedded into a server-side template before rendering.
* Authentication Bypass: Review authentication logic for weaknesses like improper session validation or custom endpoints that lack brute-force protection. * Weak or Predictable Session Tokens: Analyze how session tokens are generated. Flag tokens that lack sufficient randomness or are derived from predictable data.
...
安装 Security code review 后,可以对 AI 说这些话来触发它
Help me get started with Security code review
Explains what Security code review does, walks through the setup, and runs a quick demo based on your current project
Use Security code review to conduct thorough security audits of source code by identifying vuln...
Invokes Security code review with the right parameters and returns the result directly in the conversation
What can I do with Security code review in my developer & devops workflow?
Lists the top use cases for Security code review, with example commands for each scenario
将技能文件夹放到 ~/.claude/skills/securityreview/ 目录(个人级,所有项目可用),或 .claude/skills/securityreview/(项目级)。重启 AI 客户端后,用 /securityreview 主动调用,或让 AI 根据上下文自动发现并使用。
Security code review 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
Security code review 可免费安装使用。请查阅仓库了解许可证信息。
Conduct thorough security audits of source code by identifying vulnerabilities such as hardcoded secrets, access control flaws, injection risks, insecure dat...
Security code review 属于「Developer & DevOps」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。
Automate my developer & devops tasks using Security code review
Identifies repetitive steps in your workflow and sets up Security code review to handle them automatically