用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/mikailustuner/OmniRule --skill security-review命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Bun runtime: HTTP server, file I/O, SQLite, test runner, package manager, bundler — all-in-one JS toolchain.
Clerk: Drop-in auth UI, Organizations, User management, JWT templates, webhooks, Next.js middleware integration.
Gelişmiş masaüstü, tarayıcı ve işletim sistemi kontrol yeteneği. Görsel (koordinat tabanlı) fare/klavye otomasyonu, DOM manipülasyonu, pencere yönetimi, gelişmiş dosya, ağ ve süreç yönetimini kapsar.
基于 SOC 职业分类
正在显示 SKILL.md
| name | security-review |
| description | Security: Threat modeling, Validation strategy, Auth patterns, When to use what. |
| triggers | {"keywords":["security","vulnerability","OWASP","injection","XSS","CSRF","auth","sanitize","encrypt"]} |
| auto_load_when | Security review or implementing security measures |
| agent | security-officer |
| tools | ["Read","Write","Bash"] |
Focus: OWASP Top 10, threat patterns, best practices
What to validate:
├── ALL user input (never trust client)
├── API parameters (even from "internal" sources)
├── File uploads (type, size, name)
└── Third-party webhooks (verify signature)
Where to validate:
├── Schema validation: at API boundary (Zod)
├── Business logic: in domain/service layer
└── Database: constraints (unique, foreign key)
Pattern:
1. Validate schema at boundary (early failure)
2. Validate business rules in service
3. Let DB enforce constraints
How to handle auth?
├── Session-based: server stores session, cookie on client
│ └── Good for: server-rendered apps, simple
│
├── JWT: self-contained tokens
│ └── Good for: APIs, SPAs, mobile
│ └── Store in httpOnly cookie or Authorization header
│
└── OAuth/SSO: third-party identity
└── Good for: social login, enterprise
Password handling:
Authorization levels:
├── Authentication: WHO is this? (logged in?)
├── Authorization: WHAT can they do? (permissions)
└── Resource ownership: CAN they access THIS? (ownership)
Implementation:
├── Role-based (RBAC): simple, fixed roles
│ └── user, admin, moderator
│
├── Permission-based: granular
│ └── user.can('read') .can('write') .can('delete')
│
└── Resource-based: ownership check
└── userId === resource.ownerId
When to worry:
├── Any raw SQL query
├── Any string concatenated into SQL
└── User input in database queries
Pattern:
├── Parameterized queries (Prisma does this automatically)
├── ORM for most queries
├── Raw SQL only when ORM insufficient
└── NEVER: string interpolation into SQL
When to worry:
├── User input rendered as HTML
├── User input in JavaScript
└── User input in URLs
Defense layers:
├── 1. Escape all output (React does this by default)
├── 2. Sanitize HTML if needed (DOMPurify for rich text)
├── 3. Content Security Policy (CSP headers)
├── 4. httpOnly cookies (no XSS access to tokens)
└── 5. Input validation (reject known bad)
What is a secret:
├── API keys, tokens, passwords
├── Database connection strings
├── Encryption keys
└── Third-party credentials
Pattern:
├── NEVER commit secrets to git
├── Use environment variables (or secret manager)
├── Validate at startup (fail fast if missing)
├── Different secrets per environment
└── Rotate secrets regularly
When to implement:
├── Public APIs
├── Login/registration endpoints
├── Search/exensive operations
└── Any resource-limited operation
How to implement:
├── IP-based for general limits
├── User-based for authenticated endpoints
├── Exponential backoff for retry
└── Return proper status (429) + Retry-After
❌ Trust user input inside SQL/shell strings
✅ Parameterized queries always; never string-concatenate SQL
❌ Sensitive data in URL query parameters
✅ POST body for sensitive data; never tokens/passwords in URLs
❌ JWT with alg: none or HS256 with weak secret
✅ RS256/ES256 for JWTs; rotate keys; verify signature server-side
❌ Storing plaintext passwords
✅ bcrypt (cost 12+) or Argon2id — never reversible encryption
❌ CORS * in production
✅ Explicit allowlist of origins; never wildcard with credentials
| Threat | Mitigation | Priority |
|---|---|---|
| SQLi | Parameterized queries | Critical |
| XSS | CSP + sanitize output | Critical |
| Auth bypass | Verify JWT server-side | Critical |
| CSRF | SameSite=Strict cookie | High |
| Path traversal | Validate + normalize paths | High |
| Rate limiting | Redis sliding window | High |
| Secrets exposure | Vault / env injection | Critical |