Token导航 LogoToken导航

Agent Skill · 研究检索

code-review-security(代码审查安全)

用于辅助安全审计、权限检查、凭据风险、认证流程和常见漏洞排查。它适合让 Agent 梳理敏感配置、检查依赖风险、分析鉴权逻辑或生成安全复核清单。使用时不能把工具输出直接当最终结论,涉及密钥、令牌、用户数据或生产系统时,应先确认最小权限、脱敏方式和操作边界。

code-review-security 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为接触敏感数据;许可证信息还不明确,第三方扫描有未通过项,按安装量在研究检索类的 73,675 个 Skill 里排第 17,901。

总安装 6,360周安装 265GitHub Stars 8下载 2,120核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:code-review-security(代码审查安全)
来源仓库:https://github.com/hieutrtr/ai1-skills
仓库路径:skills/code-review-security
安装命令:
npx skills add https://github.com/hieutrtr/ai1-skills --skill code-review-security
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/hieutrtr/ai1-skills --skill code-review-security

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

Code Review Security 专注于安全漏洞检测,覆盖认证授权、输入处理和依赖风险等关键领域。适用于敏感数据处理模块或外部接口变更的安全复核,可识别 OWASP Top 10 威胁。输出写入 security-review.md 文件,包含严重等级、位置描述和改进建议。

不得用于部署配置或生产环境操作,仅限开发阶段代码分析用途。code-review-security 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/code-review-security

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/hieutrtr/ai1-skills --skill code-review-securi…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要接触敏感数据,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

code-review-security 怎么安装?

在终端执行 npx skills add https://github.com/hieutrtr/ai1-skills --skill code-review-security。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

code-review-security 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

code-review-security 需要什么权限?

权限级别是接触敏感数据。该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

code-review-security 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

code-review-security 用的人多吗?

公开数据是累计安装 6,360 次,近一周安装 265 次,下载 2,120 次,GitHub 8 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

code-review-security 安全吗?

第三方扫描有未通过项,风险较高。除非你确认过源码,否则不建议直接安装到常用环境。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。

先想清楚的地方

  • 需要接触敏感数据,装到常用环境前要先评估影响面。
  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 环境里有大量密钥、凭证,不方便给第三方 Skill 读取的人。
  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
code-review-security

代码审查安全 · 本页

6,3608接触敏感数据未明确未通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Code Review Security

When to Use

Activate this skill when:

  • Reviewing pull requests for security vulnerabilities
  • Auditing authentication or authorization code changes
  • Reviewing code that handles user input, file uploads, or external data
  • Checking for OWASP Top 10 vulnerabilities in new features
  • Validating that secrets are not committed to the repository
  • Scanning dependencies for known vulnerabilities
  • Reviewing API endpoints that expose sensitive data

Output: Write findings to security-review.md with severity, file:line, description, and recommendations.

Do NOT use this skill for:

  • Deployment infrastructure security (use docker-best-practices)
  • Incident response procedures (use incident-response)
  • General code quality review without security focus (use pre-merge-checklist)
  • Writing implementation code (use python-backend-expert or react-frontend-expert)

Instructions

OWASP Top 10 Checklist

Review every PR against the OWASP Top 10 (2021 edition). Each category below includes specific checks for Python/FastAPI and React codebases.


A01: Broken Access Control

What to look for:

  • Missing authorization checks on endpoints
  • Direct object reference without ownership verification
  • Endpoints that expose data without role-based filtering
  • Missing Depends() for auth on new routes

Python/FastAPI checks:

# BAD: No authorization check -- any authenticated user can access any user
@router.get("/users/{user_id}")
async def get_user(user_id: int, db: Session = Depends(get_db)):
    return await user_repo.get(user_id)

# GOOD: Verify the requesting user owns the resource or is admin
@router.get("/users/{user_id}")
async def get_user(
    user_id: int,
    current_user: User = Depends(get_current_user),
    db: Session = Depends(get_db),
):
    if current_user.id != user_id and current_user.role != "admin":
        raise HTTPException(status_code=403, detail="Forbidden")
    return await user_repo.get(user_id)

Review checklist:

  • Every route has authentication (Depends(get_current_user))
  • Resource access is verified against the requesting user
  • Admin-only endpoints check role == "admin"
  • List endpoints filter by user ownership (unless admin)
  • No IDOR (Insecure Direct Object Reference) vulnerabilities

A02: Cryptographic Failures

What to look for:

  • Passwords stored in plaintext or with weak hashing
  • Sensitive data in logs or error messages
  • Hardcoded secrets, API keys, or tokens
  • Weak JWT configuration

Python checks:

# BAD: Weak password hashing
import hashlib
password_hash = hashlib.md5(password.encode()).hexdigest()

# GOOD: Use bcrypt via passlib
from passlib.context import CryptContext
pwd_context = CryptContext(schemes=["bcrypt"], deprecated="auto")
password_hash = pwd_context.hash(password)

# BAD: Secret in code
SECRET_KEY = "my-super-secret-key-123"

# GOOD: Secret from environment
SECRET_KEY = os.environ["SECRET_KEY"]

Review checklist:

  • Passwords hashed with bcrypt (never MD5, SHA1, or plaintext)
  • JWT secret loaded from environment, not hardcoded
  • Sensitive data excluded from logs (passwords, tokens, PII)
  • HTTPS enforced for all external communication
  • No secrets in source code (check .env.example has placeholders only)

A03: Injection

What to look for:

  • Raw SQL queries with string interpolation
  • eval(), exec(), compile() with user input
  • subprocess calls with shell=True
  • Template injection

Python checks:

# BAD: SQL injection via string formatting
query = f"SELECT * FROM users WHERE email = '{email}'"
db.execute(text(query))

# GOOD: Parameterized query
db.execute(text("SELECT * FROM users WHERE email = :email"), {"email": email})

# GOOD: SQLAlchemy ORM (always parameterized)
user = db.query(User).filter(User.email == email).first()

# BAD: Command injection
subprocess.run(f"convert {filename}", shell=True)

# GOOD: Pass arguments as a list
subprocess.run(["convert", filename], shell=False)

# BAD: Code execution with user input
result = eval(user_input)

# GOOD: Never eval user input. Use ast.literal_eval for safe parsing.
result = ast.literal_eval(user_input)  # Only for literal structures

Review checklist:

  • No raw SQL with string interpolation (use ORM or parameterized queries)
  • No eval(), exec(), or compile() with external input
  • No subprocess.run(..., shell=True) with dynamic arguments
  • No pickle.loads() on untrusted data
  • All user input validated by Pydantic schemas before use

A04: Insecure Design

What to look for:

  • Missing rate limiting on authentication endpoints
  • No account lockout after failed login attempts
  • Missing CAPTCHA on public-facing forms
  • Business logic flaws (e.g., negative amounts, self-privilege-escalation)

Review checklist:

  • Rate limiting on login, registration, and password reset
  • Account lockout or exponential backoff after 5+ failed attempts
  • Business logic validates constraints (positive amounts, valid transitions)
  • Sensitive operations require re-authentication

A05: Security Misconfiguration

What to look for:

  • Debug mode enabled in production
  • CORS configured with wildcard * origins
  • Default credentials or admin accounts
  • Verbose error messages exposing stack traces

Python/FastAPI checks:

# BAD: Wide-open CORS
app.add_middleware(CORSMiddleware, allow_origins=["*"])

# GOOD: Explicit allowed origins
app.add_middleware(
    CORSMiddleware,
    allow_origins=["https://app.example.com"],
    allow_methods=["GET", "POST", "PUT", "DELETE"],
    allow_headers=["Authorization", "Content-Type"],
)

# BAD: Debug mode in production
app = FastAPI(debug=True)

# GOOD: Debug only in development
app = FastAPI(debug=settings.DEBUG)  # DEBUG=False in production

Review checklist:

  • CORS origins are explicit (no wildcard in production)
  • Debug mode disabled in production configuration
  • Error responses do not expose stack traces or internal details
  • Default admin credentials are changed or removed
  • Security headers set (X-Content-Type-Options, X-Frame-Options, etc.)

A06: Vulnerable and Outdated Components

Review checklist:

  • No known CVEs in Python dependencies (pip-audit or safety check)
  • No known CVEs in npm dependencies (npm audit)
  • Dependencies pinned to specific versions in lock files
  • No deprecated packages still in use

A07: Identification and Authentication Failures

What to look for:

  • Weak password policies
  • Session tokens that do not expire
  • Missing multi-factor authentication for admin actions
  • JWT tokens without expiration

Python checks:

# BAD: JWT without expiration
token = jwt.encode({"sub": user_id}, SECRET_KEY, algorithm="HS256")

# GOOD: JWT with expiration
token = jwt.encode(
    {"sub": user_id, "exp": datetime.utcnow() + timedelta(minutes=30)},
    SECRET_KEY,
    algorithm="HS256",
)

Review checklist:

  • JWT tokens have expiration (exp claim)
  • Refresh tokens are stored securely and can be revoked
  • Password policy enforces minimum length (12+) and complexity
  • Session invalidation on password change or logout
  • No user enumeration via login error messages

A08: Software and Data Integrity Failures

Review checklist:

  • CI/CD pipeline validates artifact integrity
  • No unsigned or unverified packages
  • Deserialization of untrusted data uses safe methods (no pickle.loads)
  • Database migrations are reviewed before execution

A09: Security Logging and Monitoring Failures

Review checklist:

  • Authentication events are logged (login, logout, failed attempts)
  • Authorization failures are logged with context
  • Sensitive data is NOT included in logs (passwords, tokens, PII)
  • Log entries include timestamp, user ID, IP address, action
  • Alerting configured for suspicious patterns (brute force, unusual access)

A10: Server-Side Request Forgery (SSRF)

What to look for:

  • User-supplied URLs used in server-side requests
  • Redirect endpoints that accept arbitrary URLs

Python checks:

# BAD: Fetch arbitrary URL from user input
url = request.query_params["url"]
response = httpx.get(url)  # SSRF: can access internal services

# GOOD: Validate URL against allowlist
ALLOWED_HOSTS = {"api.example.com", "cdn.example.com"}
parsed = urlparse(url)
if parsed.hostname not in ALLOWED_HOSTS:
    raise HTTPException(400, "URL not allowed")
response = httpx.get(url)

Review checklist:

  • No server-side requests to user-controlled URLs without validation
  • URL allowlists used for external integrations
  • Internal service URLs not exposed in error messages

Python-Specific Security Checks

Beyond OWASP, review Python code for these patterns:

PatternRiskFix
eval(user_input)Remote code executionRemove or use ast.literal_eval
pickle.loads(data)Arbitrary code executionUse JSON or msgpack
subprocess.run(cmd, shell=True)Command injectionPass args as list, shell=False
yaml.load(data)Code executionUse yaml.safe_load(data)
os.system(cmd)Command injectionUse subprocess.run([...])
Raw SQL stringsSQL injectionUse ORM or parameterized queries
hashlib.md5(password)Weak hashingUse bcrypt via passlib
jwt.decode(token, options={"verify_signature": False})Auth bypassAlways verify signature
open(user_path)Path traversalValidate path, use pathlib.resolve()
tempfile.mktemp()Race conditionUse tempfile.mkstemp()

React-Specific Security Checks

PatternRiskFix
dangerouslySetInnerHTMLXSSUse text content or sanitize with DOMPurify
javascript: in hrefXSSValidate URLs, allow only https:
window.location = userInputOpen redirectValidate against allowlist
Storing tokens in localStorageToken theft via XSSUse httpOnly cookies
Inline event handlers from dataXSSUse React event handlers
eval() or Function()Code executionRemove entirely
Rendering user HTMLXSSUse a sanitization library

React code review:

// BAD: XSS via dangerouslySetInnerHTML
<div dangerouslySetInnerHTML={{ __html: userBio }} />

// GOOD: Sanitize first, or use text content
import DOMPurify from "dompurify";
<div dangerouslySetInnerHTML={{ __html: DOMPurify.sanitize(userBio) }} />

// BETTER: Use text content when HTML is not needed
<p>{userBio}</p>

// BAD: javascript: URL
<a href={userLink}>Click</a>  // userLink could be "javascript:alert(1)"

// GOOD: Validate protocol
const safeHref = /^https?:\/\//.test(userLink) ? userLink : "#";
<a href={safeHref}>Click</a>

Severity Classification

Classify each finding by severity for prioritization:

SeverityDescriptionExamplesSLA
CriticalExploitable remotely, no auth needed, data breachSQL injection, RCE, auth bypassBlock merge, fix immediately
HighExploitable with auth, privilege escalationIDOR, broken access control, XSS (stored)Block merge, fix before release
MediumRequires specific conditions to exploitCSRF, XSS (reflected), open redirectFix within sprint
LowDefense-in-depth, informationalMissing headers, verbose errorsFix when convenient
InfoBest practice recommendationsDependency updates, code styleTrack in backlog

Finding Report Format

When reporting security findings, use this format for consistency:

## Security Finding: [Title]

**Severity:** Critical | High | Medium | Low | Info
**Category:** OWASP A01-A10 or custom category
**File:** path/to/file.py:42
**CWE:** CWE-89 (if applicable)

### Description
Brief description of the vulnerability and its impact.

### Vulnerable Code

The problematic code

vulnerable_function(user_input)


### Recommended Fix

The secure alternative

safe_function(sanitize(user_input))


### Impact

What an attacker could achieve by exploiting this vulnerability.

### References

- Link to relevant OWASP page
- Link to relevant CWE entry

Automated Scanning

Use scripts/security-scan.py to perform AST-based scanning for common vulnerability patterns in Python code. The script scans for:

  • eval() / exec() / compile() calls
  • subprocess with shell=True
  • pickle.loads() on potentially untrusted data
  • Raw SQL string construction
  • yaml.load() without Loader=SafeLoader
  • Hardcoded secret patterns (API keys, passwords)
  • Weak hash functions (MD5, SHA1 for passwords)

Run: python scripts/security-scan.py --path ./app --output-dir ./security-results

Dependency scanning (run separately):

# Python dependencies
pip-audit --requirement requirements.txt --output json > dep-audit.json

# npm dependencies
npm audit --json > npm-audit.json

Examples

Example Review Comment (Critical)

SECURITY: SQL Injection (Critical, OWASP A03) File: app/repositories/user_repository.py:47 ``python query = f"SELECT * FROM users WHERE name LIKE '%{search_term}%'" ` This constructs a raw SQL query with string interpolation, allowing SQL injection. An attacker could input '; DROP TABLE users; -- to destroy data. **Fix:** Use SQLAlchemy ORM filtering: `python users = db.query(User).filter(User.name.ilike(f"%{search_term}%")).all() ``

Example Review Comment (Medium)

SECURITY: Missing Rate Limiting (Medium, OWASP A04) File: app/routes/auth.py:12 The /auth/login endpoint has no rate limiting. An attacker could perform brute-force password attacks at unlimited speed. Fix: Add rate limiting middleware: ``python from slowapi import Limiter limiter = Limiter(key_func=get_remote_address) @router.post("/login") @limiter.limit("5/minute") async def login(request: Request, ...): ``

Output File

Write security findings to security-review.md:

# Security Review: [Feature/PR Name]

## Summary
- Critical: 0 | High: 1 | Medium: 2 | Low: 1

## Findings

### [CRITICAL] SQL Injection in user search
- **File:** app/routes/users.py:45
- **OWASP:** A03 Injection
- **Description:** Raw SQL with string interpolation
- **Recommendation:** Use SQLAlchemy ORM filtering

### [HIGH] Missing authorization check
...

## Passed Checks
- No hardcoded secrets found
- Dependencies up to date

平台分布

Codex

37.31%
按下载量换算791

Claude

29.58%
按下载量换算627

Cursor

19.06%
按下载量换算404

Gemini CLI

10.36%
按下载量换算220

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

未通过

权限和风险

接触敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills