Security Review 标志

Security Review

组织
LangConfig
security-review

Comprehensive security code review covering OWASP Top 10, authentication, authorization, and secure coding practices. Use when reviewing code for vulnerabilities or implementing security features.

Add to TypingMind

概览

发布者LangConfig
代码仓库langconfig
技能名称security-review
星标数
69
复刻数
19
附带文件
仅含指令
许可协议MIT
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 指令自成一体

    模型所需的一切都包含在指令中,无需同步额外文件。

  • 开源

    由 LangConfig 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Security Review AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/LangConfig/langconfig/tree/main/backend/skills/builtin/security-review
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/LangConfig/langconfig.git /tmp/langconfig
mkdir -p .claude/skills
cp -r /tmp/langconfig/backend/skills/builtin/security-review .claude/skills/security-review
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Security Review,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Security Review。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Security Review 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

Instructions

You are a security expert conducting code reviews. Focus on identifying vulnerabilities and recommending secure alternatives.

OWASP Top 10 Checklist (2021)

1. Broken Access Control (A01)

Look for:

  • Missing authorization checks on endpoints
  • Direct object references without validation
  • Privilege escalation paths
  • CORS misconfigurations

Bad:

python
@app.get("/users/{user_id}")
def get_user(user_id: int):
    return db.query(User).get(user_id)  # No auth check!

Good:

python
@app.get("/users/{user_id}")
def get_user(user_id: int, current_user: User = Depends(get_current_user)):
    if current_user.id != user_id and not current_user.is_admin:
        raise HTTPException(403, "Access denied")
    return db.query(User).get(user_id)
2. Cryptographic Failures (A02)

Look for:

  • Sensitive data in plaintext
  • Weak encryption algorithms (MD5, SHA1)
  • Hardcoded secrets
  • Missing HTTPS

Bad:

python
password_hash = hashlib.md5(password.encode()).hexdigest()
API_KEY = "sk-1234567890"  # Hardcoded!

Good:

python
from passlib.hash import bcrypt
password_hash = bcrypt.hash(password)
API_KEY = os.environ.get("API_KEY")
3. Injection (A03)

Look for:

  • SQL injection
  • Command injection
  • LDAP injection
  • Template injection

Bad:

python
query = f"SELECT * FROM users WHERE name = '{user_input}'"
os.system(f"convert {filename} output.png")

Good:

python
query = "SELECT * FROM users WHERE name = :name"
db.execute(query, {"name": user_input})

import subprocess
subprocess.run(["convert", filename, "output.png"], check=True)
4. Insecure Design (A04)

Look for:

  • Missing rate limiting
  • No account lockout
  • Predictable resource IDs
  • Missing security headers

Implement:

python
# Rate limiting
from slowapi import Limiter
limiter = Limiter(key_func=get_remote_address)

@app.post("/login")
@limiter.limit("5/minute")
def login(request: Request):
    ...

# Security headers
app.add_middleware(
    SecurityHeadersMiddleware,
    content_security_policy="default-src 'self'",
    x_frame_options="DENY"
)
5. Security Misconfiguration (A05)

Look for:

  • Debug mode in production
  • Default credentials
  • Unnecessary features enabled
  • Verbose error messages

Check:

python
# Bad
DEBUG = True
SECRET_KEY = "change-me"

# Good
DEBUG = os.getenv("DEBUG", "false").lower() == "true"
SECRET_KEY = os.getenv("SECRET_KEY")
if not SECRET_KEY:
    raise ValueError("SECRET_KEY must be set")
6. Vulnerable Components (A06)

Look for:

  • Outdated dependencies
  • Known vulnerable packages
  • Unmaintained libraries

Tools:

bash
# Python
pip-audit
safety check

# JavaScript
npm audit
snyk test

# General
dependabot alerts
7. Authentication Failures (A07)

Look for:

  • Weak password requirements
  • Missing MFA
  • Session fixation
  • Credential stuffing vulnerability

Implement:

python
# Strong password validation
import re

def validate_password(password: str) -> bool:
    if len(password) < 12:
        return False
    if not re.search(r'[A-Z]', password):
        return False
    if not re.search(r'[a-z]', password):
        return False
    if not re.search(r'\d', password):
        return False
    if not re.search(r'[!@#$%^&*]', password):
        return False
    return True

# Secure session configuration
app.config.update(
    SESSION_COOKIE_SECURE=True,
    SESSION_COOKIE_HTTPONLY=True,
    SESSION_COOKIE_SAMESITE='Strict',
    PERMANENT_SESSION_LIFETIME=timedelta(hours=1)
)
8. Software/Data Integrity Failures (A08)

Look for:

  • Missing integrity checks on updates
  • Insecure deserialization
  • Untrusted CI/CD pipelines

Bad:

python
import pickle
data = pickle.loads(user_input)  # Dangerous!

Good:

python
import json
data = json.loads(user_input)  # Safe for untrusted input
9. Security Logging Failures (A09)

Look for:

  • Missing audit logs
  • Sensitive data in logs
  • No alerting on failures

Implement:

python
import logging

# Configure secure logging
logger = logging.getLogger("security")
logger.setLevel(logging.INFO)

# Log security events
def login(username: str, password: str):
    user = authenticate(username, password)
    if user:
        logger.info(f"Successful login: user={username} ip={request.client.host}")
    else:
        logger.warning(f"Failed login attempt: user={username} ip={request.client.host}")
10. Server-Side Request Forgery (A10)

Look for:

  • User-controlled URLs in requests
  • Internal service access
  • Cloud metadata endpoints

Bad:

python
@app.get("/fetch")
def fetch_url(url: str):
    return requests.get(url).content  # SSRF!

Good:

python
from urllib.parse import urlparse

ALLOWED_HOSTS = ["api.example.com", "cdn.example.com"]

@app.get("/fetch")
def fetch_url(url: str):
    parsed = urlparse(url)
    if parsed.hostname not in ALLOWED_HOSTS:
        raise HTTPException(400, "URL not allowed")
    if parsed.scheme not in ["http", "https"]:
        raise HTTPException(400, "Invalid scheme")
    return requests.get(url).content

Security Review Checklist

Authentication
  • Passwords hashed with bcrypt/argon2
  • Session tokens are random and long enough
  • Session invalidation on logout
  • Account lockout after failed attempts
  • Secure password reset flow
Authorization
  • All endpoints have auth checks
  • Role-based access control implemented
  • No privilege escalation paths
  • API keys properly scoped
Input Validation
  • All user input validated
  • File upload restrictions (type, size)
  • URL parameters sanitized
  • JSON schema validation
Output Encoding
  • HTML output escaped
  • JSON responses properly formatted
  • No sensitive data in responses
  • Error messages don't leak info
Data Protection
  • Sensitive data encrypted at rest
  • TLS for data in transit
  • Secrets in environment variables
  • PII properly handled

Examples

User asks: "Review my authentication code for security issues"

Response approach:

  1. Check password hashing algorithm
  2. Review session management
  3. Look for timing attacks
  4. Check rate limiting
  5. Review token generation
  6. Verify secure cookie settings
  7. Check for credential exposure in logs

常见问题

Security Review AI 技能有什么作用?

Comprehensive security code review covering OWASP Top 10, authentication, authorization, and secure coding practices. Use when reviewing code for vulnerabilities or implementing security features.

为什么在 TypingMind 中使用 Security Review?

因为您只需安装一次,就能搭配任何模型使用。Security Review 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Security Review?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/LangConfig/langconfig/tree/main/backend/skills/builtin/security-review。TypingMind 会读取其中的 SKILL.md,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Security Review?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Security Review 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Security Review 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Security Review AI 技能免费吗?

是的。LangConfig 已在 GitHub 上根据 MIT 许可证发布了该技能。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇