Security Review
When to Use
- The user wants a security audit of their application, infrastructure, or specific feature
- They need a threat model before launching or a penetration test preparation review
- They have a dependency vulnerability alert and need remediation guidance
- They are handling sensitive data (PII, payment, health) and need verification
- Code audit, secrets detection, or compliance assessment is requested
Context Required
From startup-context: tech stack, deployment environment, compliance requirements, data types. Also ask:
- Scope — Full app, feature, auth system, single PR, infrastructure, or cloud environment
- Data types — PII, payment, health, credentials, or other sensitive data handled
- Compliance requirements — SOC 2, HIPAA, PCI-DSS, GDPR, ISO 27001
- Authorization — Confirm written authorization exists before any active testing
Workflow
Follow a five-phase methodology. Automated scanning precedes manual review. Authorization verification is mandatory before active testing.
- Scope definition — Establish attack surface boundaries. Identify all components, data flows, and trust boundaries. Confirm authorization. Define in-scope and out-of-scope.
- Automated scanning — Execute tooling before manual review:
- SAST:
semgrep --config=auto across the codebase
- Dependency audit:
npm audit / pip-audit / govulncheck / trivy fs .
- Secrets detection: Scan for hardcoded credentials, API keys, tokens in source
- Container scanning:
trivy image for containerized deployments
- Record all automated findings for validation in the next phase.
- Manual code review — Conduct contextual analysis that automated tools miss:
- Authentication and authorization flow tracing end-to-end
- Business logic vulnerabilities (price manipulation, race conditions, privilege escalation)
- Data flow analysis for sensitive information (where does PII enter, transit, and persist?)
- STRIDE threat modeling against each component and data flow
- Validation and classification — Test findings and assign severity:
- Validate automated findings to eliminate false positives
- Assign CVSS v3.1 scores; assess exploitability in context
- Classify by business impact, not just technical severity
- Reporting — Document vulnerabilities with precise locations, business impact, and corrective actions. Deliver a prioritized remediation roadmap.
Output Format
# Security Review: [Scope Description]
## Executive Summary
Overall risk posture (Critical / High / Medium / Low), top findings count, and business impact summary.
## Threat Model (STRIDE)
| Threat | Category | Asset | Impact | Likelihood | Risk |
## Findings
### Critical / High / Medium / Low
- **[SEC-N] Title** — CVSS X.X — file:line — description, business impact, remediation with code example
## Auth Flow Assessment
End-to-end trace of authentication and authorization with findings.
## Dependency Vulnerabilities
| Package | Current Version | CVSS | Fix Version | Exploitable in Context? |
## Remediation Roadmap
Prioritized action list with timelines.
Frameworks & Best Practices
STRIDE Threat Modeling
Apply to every component and data flow:
- Spoofing — Can attackers forge tokens or impersonate users? Are API keys rotatable?
- Tampering — Can requests be modified in transit? Are webhooks signed? Is data integrity verified?
- Repudiation — Are critical actions logged? Are logs tamper-evident?
- Information Disclosure — Stack traces in error responses? PII encrypted at rest and in transit?
- Denial of Service — Rate limits in place? Can one user exhaust resources for all?
- Elevation of Privilege — Can regular users access admin functions? Are role checks server-side?
OWASP Top 10 Checks
- Injection — Parameterize SQL/NoSQL; check OS commands, SSTI, LDAP
- Broken Auth — argon2id/bcrypt, session timeout, rate limiting on login
- Data Exposure — TLS 1.2+, PII encrypted at rest, HSTS headers
- XXE — Disable DTD processing, prefer JSON over XML
- Access Control — Server-side authz on every endpoint, no IDOR, CORS whitelist
- Misconfig — Debug mode off, default credentials removed, security headers present
- XSS — Output encoding, Content Security Policy, HTTP-only cookies
- Deserialization — Validate schema, prefer JSON, reject untrusted serialized objects
- Vulnerable Deps —
npm audit, pip-audit, trivy, govulncheck
- Logging — Auth events, admin actions, access violations logged with alerts
CVSS v3.1 Scoring Guide
- Critical (9.0-10.0): RCE, auth bypass, full data breach, complete system compromise
- High (7.0-8.9): Privilege escalation, significant data exposure, SSRF to internal services
- Medium (4.0-6.9): Stored XSS, CSRF, limited IDOR, information disclosure
- Low (0.1-3.9): Missing security headers, minor info disclosure, verbose errors
Auth Flow Checklist
Scanning Tools
- SAST:
semgrep --config=auto (all stacks), bandit (Python), gosec (Go), eslint-plugin-security (Node)
- Dependencies:
npm audit / pip-audit / govulncheck / trivy fs .
- Containers:
trivy image
Mandatory Constraints
- Never test production without explicit written authorization
- Never exploit beyond proof-of-concept demonstration
- Always sequence automated scanning before manual review
Remediation Priority
- Actively exploitable + critical data — immediately
- Auth/authz bypass — 24 hours
- Injection — 48 hours
- Data exposure / critical CVEs — 1 week
- Config hardening — 2 weeks
- Defense-in-depth — next sprint
Related Skills
code-review — chain when findings require code-level fixes and review
architecture-design — chain when findings reveal architectural security flaws
soc2-prep — chain when review is part of compliance preparation
Examples
Example prompt: "Review the security of our user authentication system. We use JWT with Express."
Good output snippet:
# Security Review: JWT Authentication System
## Executive Summary
Risk posture: **Critical**. Hardcoded JWT secret and non-expiring tokens.
## Findings
### Critical (CVSS 9.8)
- **[SEC-1] Hardcoded JWT secret** — auth/config.js:3 — Secret is
"supersecret123". Attacker can forge any token.
**Fix:** Move to env var, generate with `openssl rand -base64 64`.
### Critical (CVSS 9.1)
- **[SEC-2] Tokens never expire** — auth/jwt.js:12 — No `expiresIn`.
**Fix:** Set `expiresIn: '15m'`, implement refresh token rotation.
1---2name: security-review3description: When the user needs a security assessment — threat modeling, vulnerability review, auth flow audit, dependency scanning, or says "is this secure", "review for vulnerabilities", "threat model", "security audit", "pen test prep".4related: [code-review, architecture-design, soc2-prep]5reads: [startup-context]6origin: "startup"7metadata:8 source: https://skillmd.com/skills/yanacuti1121/security-review9---1011# Security Review1213## When to Use14- The user wants a security audit of their application, infrastructure, or specific feature15- They need a threat model before launching or a penetration test preparation review16- They have a dependency vulnerability alert and need remediation guidance17- They are handling sensitive data (PII, payment, health) and need verification18- Code audit, secrets detection, or compliance assessment is requested1920## Context Required21From `startup-context`: tech stack, deployment environment, compliance requirements, data types. Also ask:22- **Scope** — Full app, feature, auth system, single PR, infrastructure, or cloud environment23- **Data types** — PII, payment, health, credentials, or other sensitive data handled24- **Compliance requirements** — SOC 2, HIPAA, PCI-DSS, GDPR, ISO 2700125- **Authorization** — Confirm written authorization exists before any active testing2627## Workflow28Follow a five-phase methodology. Automated scanning precedes manual review. Authorization verification is mandatory before active testing.29301. **Scope definition** — Establish attack surface boundaries. Identify all components, data flows, and trust boundaries. Confirm authorization. Define in-scope and out-of-scope.312. **Automated scanning** — Execute tooling before manual review:32 - **SAST:** `semgrep --config=auto` across the codebase33 - **Dependency audit:** `npm audit` / `pip-audit` / `govulncheck` / `trivy fs .`34 - **Secrets detection:** Scan for hardcoded credentials, API keys, tokens in source35 - **Container scanning:** `trivy image` for containerized deployments36 - Record all automated findings for validation in the next phase.373. **Manual code review** — Conduct contextual analysis that automated tools miss:38 - Authentication and authorization flow tracing end-to-end39 - Business logic vulnerabilities (price manipulation, race conditions, privilege escalation)40 - Data flow analysis for sensitive information (where does PII enter, transit, and persist?)41 - STRIDE threat modeling against each component and data flow424. **Validation and classification** — Test findings and assign severity:43 - Validate automated findings to eliminate false positives44 - Assign CVSS v3.1 scores; assess exploitability in context45 - Classify by business impact, not just technical severity465. **Reporting** — Document vulnerabilities with precise locations, business impact, and corrective actions. Deliver a prioritized remediation roadmap.4748## Output Format4950```markdown51# Security Review: [Scope Description]5253## Executive Summary54Overall risk posture (Critical / High / Medium / Low), top findings count, and business impact summary.5556## Threat Model (STRIDE)57| Threat | Category | Asset | Impact | Likelihood | Risk |5859## Findings60### Critical / High / Medium / Low61- **[SEC-N] Title** — CVSS X.X — file:line — description, business impact, remediation with code example6263## Auth Flow Assessment64End-to-end trace of authentication and authorization with findings.6566## Dependency Vulnerabilities67| Package | Current Version | CVSS | Fix Version | Exploitable in Context? |6869## Remediation Roadmap70Prioritized action list with timelines.71```7273## Frameworks & Best Practices7475### STRIDE Threat Modeling76Apply to every component and data flow:77- **Spoofing** — Can attackers forge tokens or impersonate users? Are API keys rotatable?78- **Tampering** — Can requests be modified in transit? Are webhooks signed? Is data integrity verified?79- **Repudiation** — Are critical actions logged? Are logs tamper-evident?80- **Information Disclosure** — Stack traces in error responses? PII encrypted at rest and in transit?81- **Denial of Service** — Rate limits in place? Can one user exhaust resources for all?82- **Elevation of Privilege** — Can regular users access admin functions? Are role checks server-side?8384### OWASP Top 10 Checks851. **Injection** — Parameterize SQL/NoSQL; check OS commands, SSTI, LDAP862. **Broken Auth** — argon2id/bcrypt, session timeout, rate limiting on login873. **Data Exposure** — TLS 1.2+, PII encrypted at rest, HSTS headers884. **XXE** — Disable DTD processing, prefer JSON over XML895. **Access Control** — Server-side authz on every endpoint, no IDOR, CORS whitelist906. **Misconfig** — Debug mode off, default credentials removed, security headers present917. **XSS** — Output encoding, Content Security Policy, HTTP-only cookies928. **Deserialization** — Validate schema, prefer JSON, reject untrusted serialized objects939. **Vulnerable Deps** — `npm audit`, `pip-audit`, `trivy`, `govulncheck`9410. **Logging** — Auth events, admin actions, access violations logged with alerts9596### CVSS v3.1 Scoring Guide97- **Critical (9.0-10.0):** RCE, auth bypass, full data breach, complete system compromise98- **High (7.0-8.9):** Privilege escalation, significant data exposure, SSRF to internal services99- **Medium (4.0-6.9):** Stored XSS, CSRF, limited IDOR, information disclosure100- **Low (0.1-3.9):** Missing security headers, minor info disclosure, verbose errors101102### Auth Flow Checklist103- [ ] Passwords: argon2id or bcrypt (cost >= 10)104- [ ] JWT: 15-min access tokens, 7-day refresh tokens rotated on use105- [ ] Rate limiting: 5 attempts / 15 min on auth endpoints106- [ ] Sessions invalidated on password change107- [ ] OAuth state parameter validated, scoped API keys108- [ ] MFA enforced for admin accounts109- [ ] Password reset tokens are single-use and time-limited110111### Scanning Tools112- **SAST:** `semgrep --config=auto` (all stacks), `bandit` (Python), `gosec` (Go), `eslint-plugin-security` (Node)113- **Dependencies:** `npm audit` / `pip-audit` / `govulncheck` / `trivy fs .`114- **Containers:** `trivy image`115116### Mandatory Constraints117- Never test production without explicit written authorization118- Never exploit beyond proof-of-concept demonstration119- Always sequence automated scanning before manual review120121### Remediation Priority1221. Actively exploitable + critical data — immediately1232. Auth/authz bypass — 24 hours1243. Injection — 48 hours1254. Data exposure / critical CVEs — 1 week1265. Config hardening — 2 weeks1276. Defense-in-depth — next sprint128129## Related Skills130- `code-review` — chain when findings require code-level fixes and review131- `architecture-design` — chain when findings reveal architectural security flaws132- `soc2-prep` — chain when review is part of compliance preparation133134## Examples135136**Example prompt:** "Review the security of our user authentication system. We use JWT with Express."137138**Good output snippet:**139```140# Security Review: JWT Authentication System141142## Executive Summary143Risk posture: **Critical**. Hardcoded JWT secret and non-expiring tokens.144145## Findings146### Critical (CVSS 9.8)147- **[SEC-1] Hardcoded JWT secret** — auth/config.js:3 — Secret is148 "supersecret123". Attacker can forge any token.149 **Fix:** Move to env var, generate with `openssl rand -base64 64`.150151### Critical (CVSS 9.1)152- **[SEC-2] Tokens never expire** — auth/jwt.js:12 — No `expiresIn`.153 **Fix:** Set `expiresIn: '15m'`, implement refresh token rotation.154```