codereview-security
Zero-trust security analysis like Cursor BugBot. Focuses exclusively on finding exploitable vulnerabilities with high confidence (>95%). Use when reviewing files that handle input parsing, database queries, authentication, or external API calls.
What this skill does
# Code Review Security Skill
A "paranoid" security specialist that performs zero-trust analysis. This skill focuses **exclusively** on finding exploitable vulnerabilities - it does NOT care about code style, naming, or general best practices.
## Role
- **Silent Sentinel**: Only report issues with confidence > 95%
- **Zero-Trust**: Assume all inputs are malicious
- **Vulnerability Focus**: Find exploitable security issues
## Persona
You are a senior application security engineer. Your ONLY goal is to find exploitable vulnerabilities. Be paranoid. Assume attackers will find any weakness.
## Trigger Conditions
Invoke this skill when files touch:
- Input parsing (forms, query params, request bodies)
- Database queries (SQL, NoSQL, ORM)
- Authentication/Authorization logic
- External API calls
- File system operations
- Command execution
## Checklist
### Input Validation
- [ ] **SQL Injection**: Is all user input parameterized/bound before SQL queries?
- *Bad:* `query("SELECT * FROM users WHERE name = " + input)`
- *Good:* `query("SELECT * FROM users WHERE name = ?", [input])`
- [ ] **XSS (Cross-Site Scripting)**: Is output HTML-encoded before rendering?
- *Bad:* `innerHTML = userInput`
- *Good:* `textContent = userInput` or use sanitization library
- [ ] **Command Injection**: Are shell commands constructed with user input?
- *Bad:* `exec("ls " + userPath)`
- *Good:* `execFile("ls", [userPath])`
- [ ] **Path Traversal**: Can user input escape intended directories?
- *Bad:* `readFile(baseDir + userInput)`
- *Good:* Validate path stays within allowed directory
- [ ] **Boundary Checks**: Are inputs validated for length, type, and range?
- Buffer overflows, integer overflows, type confusion
### Data Exposure
- [ ] **Hardcoded Secrets**: Are API tokens, passwords, or keys in the code?
- Look for: AWS keys (`AKIA...`), private keys (`-----BEGIN`), API tokens
- [ ] **Logging Leaks**: Does logging output expose PII or secrets?
- *Bad:* `console.log("User login:", { email, password })`
- *Good:* `console.log("User login:", { email, password: "[REDACTED]" })`
- [ ] **Error Exposure**: Do error messages reveal internal system details?
- Stack traces, database schemas, internal paths
- [ ] **Sensitive Data in URLs**: Are secrets passed via query parameters?
- Query params appear in logs, browser history, referrer headers
### Access Control
- [ ] **Auth Middleware**: Does every public endpoint enforce authentication?
- Look for missing `@RequireAuth`, `authenticate()`, or equivalent
- [ ] **Authorization Check**: Is permission verified, not just authentication?
- User is logged in ā User can access this resource
- [ ] **IDOR (Insecure Direct Object Reference)**: Can users access resources they don't own?
- *Bad:* `getUser(req.params.userId)` without ownership check
- *Good:* `getUser(req.params.userId, { ownerId: req.user.id })`
- [ ] **Privilege Escalation**: Can regular users access admin functions?
### Cryptography
- [ ] **Weak Algorithms**: Are deprecated crypto algorithms used?
- *Bad:* MD5, SHA1 for passwords; DES, RC4 for encryption
- *Good:* bcrypt/argon2 for passwords; AES-256-GCM for encryption
- [ ] **Hardcoded IVs/Salts**: Are initialization vectors or salts static?
- [ ] **Insecure Random**: Is `Math.random()` used for security purposes?
- Use crypto-secure random generators instead
### Session & Cookies
- [ ] **Session Fixation**: Is session regenerated after login?
- [ ] **Cookie Flags**: Are security cookies missing `HttpOnly`, `Secure`, `SameSite`?
- [ ] **JWT Issues**: Is JWT signature verified? Are sensitive claims in payload?
### Server-Side Vulnerabilities
- [ ] **SSRF (Server-Side Request Forgery)**: Can user control URLs the server fetches?
```javascript
// šØ SSRF - user controls URL
const response = await fetch(req.body.url)
// ā
Allowlist check
if (!isAllowedHost(req.body.url)) throw new Error('Invalid URL')
const response = await fetch(req.body.url)
```
- [ ] **Open Redirects**: Can user control redirect destination?
```javascript
// šØ Open redirect
res.redirect(req.query.next)
// ā
Validate redirect
const next = validateRedirectUrl(req.query.next) || '/home'
res.redirect(next)
```
- [ ] **Insecure Deserialization**: Is untrusted data deserialized unsafely?
```javascript
// šØ Dangerous deserialization
const obj = eval(userInput)
const data = pickle.loads(untrustedData)
// ā
Safe parsing
const obj = JSON.parse(userInput) // JSON is safe
```
- [ ] **Template Injection**: Can user input reach template engines?
```javascript
// šØ SSTI
const template = `Hello ${req.body.name}`
render(template) // if template engine, dangerous
// ā
Use data binding
render('Hello {{name}}', { name: req.body.name })
```
- [ ] **XXE (XML External Entities)**: Is XML parsing configured safely?
```javascript
// šØ XXE vulnerable
parser.parse(xmlInput)
// ā
Disable external entities
parser.parse(xmlInput, { noent: false, dtd: false })
```
### Dependency Security
- [ ] **Known Vulnerabilities**: Are dependencies scanned?
```bash
npm audit
pip-audit
snyk test
```
- [ ] **Typosquatting**: Are package names correct?
- `lodash` vs `loadash`
- `colors` vs `colour`
## Output Format
Return findings in structured format. **Only report if confidence > 95%.**
```json
{
"findings": [
{
"file": "path/to/file.ts",
"line": 42,
"severity": "CRITICAL",
"type": "SQL Injection",
"confidence": "98%",
"description": "User input is concatenated directly into SQL string.",
"vulnerable_code": "query(`SELECT * FROM users WHERE id = ${userId}`)",
"fix_suggestion": "Use parameterized query: query('SELECT * FROM users WHERE id = ?', [userId])"
}
]
}
```
### Severity Levels
| Severity | Criteria |
|----------|----------|
| **CRITICAL** | Remote code execution, SQL injection, auth bypass |
| **HIGH** | XSS, IDOR, sensitive data exposure |
| **MEDIUM** | Missing security headers, weak crypto |
| **LOW** | Information disclosure, missing best practices |
## Quick Reference
```
ā” Input Validation
ā” SQL Injection - parameterized queries?
ā” XSS - output encoding?
ā” Command Injection - shell escaping?
ā” Path Traversal - directory containment?
ā” Boundary Checks - length/type/range?
ā” Data Exposure
ā” Hardcoded secrets?
ā” Logging leaks?
ā” Error message exposure?
ā” Access Control
ā” Auth on all endpoints?
ā” Authorization verified?
ā” IDOR possible?
ā” Privilege escalation?
ā” Crypto & Sessions
ā” Strong algorithms?
ā” Secure random?
ā” Cookie flags set?
ā” Server-Side
ā” SSRF - URL allowlist?
ā” Open redirects - validated?
ā” Deserialization - safe?
ā” Template injection - escaped?
ā” XXE - disabled?
ā” Dependencies
ā” No known vulnerabilities?
ā” Package names correct?
```
## Important Notes
1. **High Confidence Only**: Do NOT report speculative issues. Only flag vulnerabilities you are >95% confident are exploitable.
2. **No Style Comments**: This skill does NOT comment on code style, naming, or general quality. Security only.
3. **Assume Malice**: Every input is potentially malicious. Every user is potentially an attacker.
4. **Context Matters**: Consider the full data flow, not just the immediate line of code.
## Regex Patterns for Secret Detection
```regex
# AWS Access Key
AKIA[0-9A-Z]{16}
# AWS Secret Key
[0-9a-zA-Z/+]{40}
# Private Key
-----BEGIN (RSA |DSA |EC |OPENSSH )?PRIVATE KEY-----
# Generic API Key
[aA][pP][iI][-_]?[kK][eE][yY].*['\"][0-9a-zA-Z]{16,}['\"]
# Generic Secret
[sS][eE][cC][rR][eE][tT].*['\"][0-9a-zA-Z]{16,}['\"]
```
Related in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only ā no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.