Security review

From mbwsims/claude-universe · View interactive version

Security review is an AI agent skill from the GitHub repository mbwsims/claude-universe. Use when the user wants a security-focused review of specific files or changes: "security review this code", "check for exploits", "find security bugs", "pen test this", or "/security-review". This is for exploitability review of targeted code, not a broad whole-project scan or a general-purpose cod

How to use this skill

Skill file

Security Review

Perform a security-focused code review. Unlike a general code review (style, correctness,

performance), this review asks one question: can this code be exploited?

Reads the code with an attacker's mindset. Traces data from untrusted sources through

processing to storage/output. Identifies where validation is missing, where authorization

is incomplete, and where assumptions can be broken.

Workflow

0. Baseline Scan (if available)

Call shieldkit_scan with the target file. If available, use the structured findings

(SQL injection, missing auth, hardcoded secrets, dangerous functions) as a starting point.

Then go deeper with semantic analysis below.

If unavailable, proceed directly to manual analysis.

1. Read with Attacker's Eyes

Read the target code. For each function or handler, ask:

2. Trace Data Flow

For each piece of untrusted input (request params, body, headers, URL, cookies, uploaded

files, webhook payloads), trace it through the code:

Input source → Validation → Processing → Storage/Output

At each step, check:

3. Check Authorization Completeness

For every operation that modifies data or accesses resources:

Ownership verification methodology:

  1. Find every resource-loading operation (e.g., findById(req.params.id))
  2. Check if the query filters by the authenticated user's ID
  3. If not, check if there is a separate ownership check before the response
  4. Flag as IDOR if a user can access another user's resource by changing the ID

Example of MISSING ownership:

const order = await Order.findById(req.params.orderId); // Anyone can access any order

Example of CORRECT ownership:

const order = await Order.findOne({ _id: req.params.orderId, userId: req.user.id });

4. Check Error Handling

Errors are a common source of information disclosure:

"wrong password" enables user enumeration)?

longer for valid usernames because it checks the password hash, but returns immediately

for invalid usernames -- this enables username enumeration via timing side-channel)

and ensure login flows take the same time regardless of whether the user exists

5. Present Findings

Report format:

## Security Review — {file}

**Risk Level: {Critical / High / Medium / Low / Clean}**

### Findings

1. **{Vulnerability type}** — Line {n}
   **Severity:** {Critical/High/Medium/Low}
   **Data flow:** {untrusted source} → {processing step} → {vulnerable operation}
   **Attack:** {How an attacker would exploit this}
   **Fix:** {Specific code change}

2. ...

### Secure Patterns Found
{Acknowledge what's done well — auth checks, parameterized queries, etc.}

### Recommendations
{Prioritized list of changes to make}

Guidelines

vulnerability. Focus on what a real attacker would try first.

enters, how it moves through the code, and where it becomes dangerous.

flag internal RPC calls for "missing rate limiting."

good session management. A review that only lists problems is discouraging and incomplete.

for the request body before line 42" is actionable.

Related Skills

Additional Resources

organized by code area (routes, auth, database, file handling, etc.)

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.