9thlevelsoftware/legion/security-review

Trust tier 3
  • community
  • ext:[{"type":"config","description":"Configuration overrides"}]
Source check pending

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-review

Semi-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
  • --security or --just-security intent flag on /legion:review
  • /legion:plan --auto includes security scan (and --skip-security is 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:

FrameworkMarkers (word-boundary regex)
Flask@login_required, @fresh_login_required, @roles_required, @permissions_required, current_user\.is_authenticated
FastAPIDepends\(get_current_user\), Depends\(get_current_active_user\), OAuth2PasswordBearer, APIKeyHeader, HTTPBearer
Django@login_required, @permission_required, @user_passes_test, LoginRequiredMixin, PermissionRequiredMixin
Django REST Frameworkpermission_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.md exists and its Risk Areas section identifies security-critical files
  • When the phase type is api or security in 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-security is 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
#CategorySeverityCheck Items
1InjectionCRITICALSQL 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.
2Broken AuthenticationCRITICALPasswords 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.
3Sensitive Data ExposureHIGHData 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).
4XML External Entities (XXE)HIGHXML parsers disable external entity processing. DTD processing disabled. If XML not used: N/A (mark as PASS).
5Broken Access ControlCRITICALResource-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.
6Security MisconfigurationMEDIUMNo 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.
7Cross-Site Scripting (XSS)HIGHOutput encoding applied in templates. Content Security Policy (CSP) headers configured. User input sanitized before rendering. DOM manipulation uses safe APIs (textContent, not innerHTML).
8Insecure DeserializationHIGHUntrusted data is not deserialized without validation. Type checking enforced on deserialized objects. Integrity checks (signatures/HMACs) on serialized data.
9Known VulnerabilitiesMEDIUMDependencies 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.
10Insufficient LoggingMEDIUMAuthentication 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
For each OWASP category:
Step 1: Determine applicability
- Is this category relevant to the files under review?
- If not applicable (e.g., no XML parsing → XXE is N/A): mark PASS with note "N/A"
Step 2: Check each item
- For each check item in the category:
- Search the codebase for relevant patterns
- Evaluate against the check criteria
- Mark as PASS, FAIL, or WARN (partial compliance)
Step 3: Produce category verdict
- All items PASS → Category: PASS
- Any item FAIL with CRITICAL severity → Category: FAIL (blocker)
- Any item FAIL with HIGH severity → Category: FAIL (must fix before ship)
- Any item WARN → Category: WARN (recommend fixing)
Step 4: Record findings
- For each FAIL or WARN: produce a structured finding (Section 8)

Section 3: STRIDE Threat Model

Apply STRIDE threat categories to each system boundary identified in the code under review.

3.1: Threat Categories
CategoryQuestionMitigation Pattern
SpoofingCan an attacker impersonate a legitimate user or system?Strong authentication, token validation, certificate pinning
TamperingCan data be modified in transit or at rest without detection?Integrity checks (HMAC, signatures), input validation, checksums
RepudiationCan a user deny performing an action?Audit logging, non-repudiation signatures, timestamps
Information DisclosureCan sensitive data be accessed by unauthorized parties?Encryption, access control, data minimization, secure error handling
Denial of ServiceCan the system be made unavailable?Rate limiting, resource quotas, input size limits, circuit breakers
Elevation of PrivilegeCan a user gain unauthorized capabilities?Least privilege, RBAC enforcement, input validation, sandboxing
3.2: Threat Modeling Process
For each system boundary (API endpoint, data store, external integration):
Step 1: Identify the boundary
- What enters and exits this boundary?
- Who/what are the actors?
- What data flows through?
Step 2: Apply STRIDE
- For each of the 6 threat categories:
- Is this threat applicable to this boundary?
- What specific attack vectors exist?
- What mitigations are in place?
- Are mitigations sufficient?
Step 3: Produce threat table
| Boundary | Threat | Category | Attack Vector | Mitigation | Status |
|----------|--------|----------|---------------|------------|--------|
| /api/auth/login | Brute force | DoS | Repeated login attempts | Rate limiting at 5/min | MITIGATED |
| /api/auth/login | Credential stuffing | Spoofing | Leaked credentials | MFA + breach detection | PARTIAL |
Step 4: Flag gaps
- MITIGATED: threat has adequate countermeasure
- PARTIAL: countermeasure exists but incomplete
- UNMITIGATED: no countermeasure — produce finding

Section 4: Attack Surface Mapping

Read from .planning/CODEBASE.md (if exists) to identify security-relevant surfaces.

4.1: Surface Categories
SurfaceWhat to Look ForRisk Level
API EndpointsAuthentication requirements, input validation, rate limitingHIGH
Authentication BoundariesLogin flows, token generation, session managementCRITICAL
Data StorageEncryption at rest, access controls, backup securityHIGH
External IntegrationsAPI keys, webhook validation, trust boundariesMEDIUM
File Upload HandlersType validation, size limits, storage location, execution preventionHIGH
Admin InterfacesElevated privilege paths, access controls, audit loggingCRITICAL
Client-Side StoragelocalStorage/sessionStorage usage, cookie security flagsMEDIUM
Error HandlingInformation leakage in error messages, stack trace exposureMEDIUM
4.2: Mapping Process
Step 1: Read codebase context
- If .planning/CODEBASE.md exists: extract Risk Areas, Detected Stack, Conventions
- If not: scan project files for security-relevant patterns
Step 2: Enumerate surfaces
- List all API endpoints (from route files, controller files)
- Identify authentication entry points
- Find data storage access patterns (database queries, file I/O)
- Map external integrations (HTTP clients, webhook handlers)
Step 3: Classify risk
- For each surface: assign risk level from the table above
- CRITICAL surfaces get full OWASP + STRIDE treatment
- HIGH surfaces get OWASP checklist
- MEDIUM surfaces get targeted checks based on surface type
Step 4: Produce attack surface map
Structured output showing all identified surfaces with risk levels

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

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
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/9thlevelsoftware/legion/security-review/badge)](https://verified-skill.com/skills/9thlevelsoftware/legion/security-review)

Something wrong with this skill or its page? Tell us.