Threat model

From mbwsims/claude-universe · View interactive version

Threat model is an AI agent skill from the GitHub repository mbwsims/claude-universe. This skill should be used when the user asks to "threat model", "model threats", "what are the security risks", "attack surface analysis", "STRIDE analysis", "security risks of this feature", "who could attack this", mentions "/threat-model", or wants to understand the security threats to a feature,

How to use this skill

Skill file

Threat Model

Generate a structured threat model for a feature or module using the STRIDE methodology.

Identifies assets, threat actors, attack surfaces, potential attacks, and mitigations.

Threat modeling BEFORE building is cheaper than finding vulnerabilities AFTER shipping.

This skill provides the security thinking that most development skips.

Workflow

1. Identify the Target

Read the target feature or module. If a specific file/directory was provided, focus there.

Otherwise, ask what feature or system to model.

Understand:

2. Map the Attack Surface

With shieldkit-mcp (preferred): Call shieldkit_surface to get structured attack surface

mapping — all endpoints with auth status, env file coverage, and external boundaries.

Use this as the foundation for the attack surface map.

Without shieldkit-mcp: Discover manually by reading route files and handler directories.

Identify every point where external input enters the system:

For each entry point, note: what data comes in, who can send it, and what validation

exists.

3. Apply STRIDE

For each entry point, systematically check six threat categories:

| Threat | Question | Example |

|--------|----------|---------|

| Spoofing | Can someone pretend to be someone else? | Forged auth token, session hijack |

| Tampering | Can someone modify data they shouldn't? | SQL injection, parameter manipulation |

| Repudiation | Can someone deny they did something? | Missing audit logs, unsigned actions |

| Information Disclosure | Can someone access data they shouldn't? | IDOR, error messages, logs |

| Denial of Service | Can someone make this unavailable? | No rate limiting, resource exhaustion |

| Elevation of Privilege | Can someone gain unauthorized access? | Mass assignment, role escalation |

Not every threat applies to every entry point. Skip categories that genuinely don't apply

and note why.

4. Assess Risk

For each identified threat, assess:

Priority Matrix (Likelihood x Impact):

| | Impact: Critical | Impact: High | Impact: Medium | Impact: Low |

|---------------|-----------------|-------------|---------------|------------|

| Likelihood: High | P0 | P0 | P1 | P2 |

| Likelihood: Medium | P0 | P1 | P2 | P3 |

| Likelihood: Low | P1 | P2 | P3 | P3 |

Documenting skipped categories: For each STRIDE category that does NOT apply to a given

entry point, include a one-line note explaining why. Example:

| - | Repudiation | N/A -- read-only endpoint, no state mutations to log | /api/health | - | - | - |

This prevents reviewers from wondering whether a category was overlooked vs. intentionally skipped.

5. Recommend Mitigations

For each threat, provide a specific mitigation:

6. Present the Model

Report format:

## Threat Model — {feature/module name}

### Overview
{What this feature does and why it matters from a security perspective}

### Assets
{What data/resources need protecting}

### Trust Boundaries
{Where trusted meets untrusted — diagram if helpful}

### Attack Surface
{Entry points enumerated}

### Threats

| # | Category | Threat | Entry Point | Likelihood | Impact | Priority |
|---|----------|--------|-------------|------------|--------|----------|
| 1 | Tampering | SQL injection via search | /api/search?q= | High | Critical | P0 |
| 2 | Spoofing | Session fixation | /auth/login | Medium | High | P1 |
| ... |

### Mitigations

1. **T1: SQL injection** — Use parameterized queries for search endpoint.
   Status: NOT MITIGATED — current code uses string interpolation.

2. **T2: Session fixation** — Regenerate session after login.
   Status: MITIGATED — auth library handles this automatically.

### Summary
{n} threats identified: {critical} P0, {high} P1, {medium} P2, {low} P3
{n} already mitigated, {n} need implementation

Guidelines

is not useful for most applications.

query in search.ts:42" is actionable.

security auditor.

Related Skills

Additional Resources

category and common patterns by application type

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.