9thlevelsoftware/legion/security-review
- community
- ext:[{"type":"config","description":"Configuration overrides"}]
Checking that the SKILL.md file is still in the repository.
OWASP Top 10 and STRIDE threat modeling security review for code and architecture
Install
npx vskill@latest install 9thlevelsoftware/legion/security-reviewSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
Security Review
Structured security review skill for Legion. Provides OWASP Top 10 checklist evaluation and STRIDE threat modeling for code and architecture review. Activates automatically when security-sensitive files are modified, or explicitly via the --security / --just-security intent flag.
Agent: engineering-security-engineer
Section 1: Activation
This skill activates when ANY of these conditions are met. All filename globs reference the canonical registry in .planning/config/intent-teams.yaml under teams.security.file_patterns[] — do not inline divergent lists in consumers.
Explicit Activation
--securityor--just-securityintent flag on/legion:review/legion:plan --autoincludes security scan (and--skip-securityis NOT set)
Automatic Activation — file-pattern globs
Authoritative glob list: .planning/config/intent-teams.yaml → teams.security.file_patterns[]. Canonical set (mirror; edit the YAML first when adding):
**/*auth*,**/*login*,**/*session*,**/*token*,**/*jwt***/*password*,**/*credential*,**/*secret*,**/*encrypt*,**/*crypto***/*permission*,**/*rbac*,**/*acl*,**/*role***/*middleware*,**/*guard*,**/*policy*
Word-boundary rule: a file qualifies only if the glob matches the filename AND the matched token is separated by [._/\-] from alphabetic characters on both sides (so authorized_users_export.md → matches auth token; token_generator_template.md → matches token token). If your runtime's glob engine cannot enforce word boundaries, fall back to substring match but flag the finding as confidence: medium rather than high.
Restricted to source-file extensions: .py, .js, .jsx, .ts, .tsx, .rb, .go, .rs, .java, .cs, .php, .swift, .kt, .scala, .cpp, .c, .h.
Configuration files qualify ONLY when the extension is .env, .env.*, .yaml, .yml, .toml, .ini, or .json AND the file content matches the secret-token grep in Section 6.1.
Automatic Activation — authentication-decorator detection
Activate when a diff-modified file contains any of these authentication decorators/middleware markers. This list is enumerated — no generic "authentication decorators" prose trigger:
| Framework | Markers (word-boundary regex) | |
|---|---|---|
| Flask | @login_required, @fresh_login_required, @roles_required, @permissions_required, current_user\.is_authenticated | |
| FastAPI | Depends\(get_current_user\), Depends\(get_current_active_user\), OAuth2PasswordBearer, APIKeyHeader, HTTPBearer | |
| Django | @login_required, @permission_required, @user_passes_test, LoginRequiredMixin, PermissionRequiredMixin | |
| Django REST Framework | permission_classes, authentication_classes, IsAuthenticated, IsAdminUser, DjangoModelPermissions | |
| Express (Node) | passport\.authenticate, ensureAuthenticated, requireAuth, requireRole, jwt\(\{ | |
| NestJS | @UseGuards\(, @Roles\(, @PermissionGuard, AuthGuard, JwtAuthGuard | |
| Spring (Java) | @PreAuthorize, @PostAuthorize, @Secured, @RolesAllowed, SecurityContextHolder | |
| Rails (Ruby) | before_action :authenticate, authenticate_user!, authorize!, cancan, pundit | |
| ASP.NET | \[Authorize\], \[AllowAnonymous\], ClaimsPrincipal, RoleManager, UserManager | |
| Go (Gin/Echo/Chi) | jwtauth\.Verifier, middleware\.Auth, AuthMiddleware, RequireAuth |
Codebase-Aware Activation
- When
.planning/CODEBASE.mdexists and its Risk Areas section identifies security-critical files - When the phase type is
apiorsecurityin CONTEXT.md frontmatter
Secret-token grep catalog (used by configuration-file activation)
See Section 6.1 for the authoritative grep patterns used to decide whether a configuration file with a generic extension qualifies as security-sensitive. Non-matching configs MUST NOT trigger activation by filename alone.
When NOT to activate
- Non-code phases (documentation, design, marketing)
- Phases that only modify test files or configuration comments
- When
--skip-securityis explicitly set
Section 2: OWASP Top 10 Checklist
Structured pass/fail evaluation for each OWASP category. The engineering-security-engineer agent evaluates each category against the code under review.
2.1: Checklist
| # | Category | Severity | Check Items | |
|---|---|---|---|---|
| 1 | Injection | CRITICAL | SQL queries use parameterized statements (not string concatenation). NoSQL queries use typed operators. OS commands use allowlists, not user input. LDAP queries are escaped. Template engines auto-escape output. | |
| 2 | Broken Authentication | CRITICAL | Passwords hashed with bcrypt/scrypt/argon2 (not MD5/SHA1). Session tokens are cryptographically random. Session invalidation on logout. MFA available for sensitive operations. Rate limiting on login attempts. Account lockout after N failures. | |
| 3 | Sensitive Data Exposure | HIGH | Data encrypted in transit (TLS 1.2+). Sensitive data encrypted at rest. No secrets in source code or logs. API responses don't leak internal details. PII handling follows minimum necessary principle. Proper key management (no hardcoded keys). | |
| 4 | XML External Entities (XXE) | HIGH | XML parsers disable external entity processing. DTD processing disabled. If XML not used: N/A (mark as PASS). | |
| 5 | Broken Access Control | CRITICAL | Resource-level authorization enforced (not just route-level). RBAC/ABAC consistently applied. No IDOR vulnerabilities (direct object references validated). Admin endpoints require elevated privileges. CORS configured restrictively. | |
| 6 | Security Misconfiguration | MEDIUM | No default credentials in production. Unnecessary features/endpoints disabled. Error messages don't expose stack traces or internal paths. Security headers set (CSP, X-Frame-Options, HSTS). Debug mode disabled in production. | |
| 7 | Cross-Site Scripting (XSS) | HIGH | Output encoding applied in templates. Content Security Policy (CSP) headers configured. User input sanitized before rendering. DOM manipulation uses safe APIs (textContent, not innerHTML). | |
| 8 | Insecure Deserialization | HIGH | Untrusted data is not deserialized without validation. Type checking enforced on deserialized objects. Integrity checks (signatures/HMACs) on serialized data. | |
| 9 | Known Vulnerabilities | MEDIUM | Dependencies scanned for known CVEs. No critically vulnerable packages. Patch currency: dependencies updated within reasonable timeframe. Lock files committed (package-lock.json, yarn.lock). See Section 5 (Dependency Vulnerability Scan) for automated scanning procedure and Section 7 (Supply Chain Security Checks) for integrity verification. | |
| 10 | Insufficient Logging | MEDIUM | Authentication events logged (login, logout, failed attempts). Authorization failures logged. Input validation failures logged. Logs don't contain sensitive data (passwords, tokens, PII). Alerting configured for suspicious patterns. |
2.2: Evaluation Process
Section 3: STRIDE Threat Model
Apply STRIDE threat categories to each system boundary identified in the code under review.
3.1: Threat Categories
| Category | Question | Mitigation Pattern | |
|---|---|---|---|
| Spoofing | Can an attacker impersonate a legitimate user or system? | Strong authentication, token validation, certificate pinning | |
| Tampering | Can data be modified in transit or at rest without detection? | Integrity checks (HMAC, signatures), input validation, checksums | |
| Repudiation | Can a user deny performing an action? | Audit logging, non-repudiation signatures, timestamps | |
| Information Disclosure | Can sensitive data be accessed by unauthorized parties? | Encryption, access control, data minimization, secure error handling | |
| Denial of Service | Can the system be made unavailable? | Rate limiting, resource quotas, input size limits, circuit breakers | |
| Elevation of Privilege | Can a user gain unauthorized capabilities? | Least privilege, RBAC enforcement, input validation, sandboxing |
3.2: Threat Modeling Process
Section 4: Attack Surface Mapping
Read from .planning/CODEBASE.md (if exists) to identify security-relevant surfaces.
4.1: Surface Categories
| Surface | What to Look For | Risk Level | |
|---|---|---|---|
| API Endpoints | Authentication requirements, input validation, rate limiting | HIGH | |
| Authentication Boundaries | Login flows, token generation, session management | CRITICAL | |
| Data Storage | Encryption at rest, access controls, backup security | HIGH | |
| External Integrations | API keys, webhook validation, trust boundaries | MEDIUM | |
| File Upload Handlers | Type validation, size limits, storage location, execution prevention | HIGH | |
| Admin Interfaces | Elevated privilege paths, access controls, audit logging | CRITICAL | |
| Client-Side Storage | localStorage/sessionStorage usage, cookie security flags | MEDIUM | |
| Error Handling | Information leakage in error messages, stack trace exposure | MEDIUM |
4.2: Mapping Process
Section 5: Dependency Vulnerability Scan
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/security-review/SKILL.md
Popularity
- Repository stars
- 62
- Repository forks
- 7
- 7-day trend score
- 21
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Extension points
configConfiguration overrides
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/9thlevelsoftware/legion/security-review)