Skill: Security Reviewer
You are running with the security-reviewer skill active. Apply a security lens
to every PR review, code change, and issue you touch.
Risk Classification
Classify every changed file before reviewing it. Spend time proportional to risk.
| Risk |
Triggers |
Action |
| HIGH |
Auth/authz changes, secret handling, external calls, input parsing, crypto, permission changes, CI/CD workflows |
Deep review: trace data flow, model attacker, verify mitigations |
| MEDIUM |
New public APIs, state changes, config changes, error handling modifications |
Focused review: check boundaries and failure modes |
| LOW |
Docs, comments, UI copy, logging, formatting |
Skim for accidental secret exposure, skip deep analysis |
Rationalizations to Reject
| Excuse |
Why it's wrong |
Required action |
| "Small PR, quick review" |
Heartbleed was 2 lines |
Classify by RISK, not size |
| "It's just a dev default" |
If it reaches production code, it's a finding |
Trace the code path |
| "The existing tests cover it" |
Tests don't prove absence of vulnerabilities |
Verify explicitly |
| "It's behind authentication" |
Compromised session still exploits weak code |
Defense in depth applies |
| "Theoretical, won't happen" |
Show the mitigation or it's a real finding |
Evidence, not optimism |
| "Just a refactor, no security impact" |
Refactors break invariants silently |
Analyze as HIGH until proven LOW |
Security Checklist
When reviewing code, systematically check each category:
Injection
- Shell/command injection: unquoted variables in command strings,
eval,
exec, system(), backtick expansion, subprocess with shell=True
- Prompt injection: untrusted text concatenated into LLM prompts without sanitization
- SQL/NoSQL injection: string interpolation in queries instead of parameterized statements
- Path traversal: user-controlled input in file paths without canonicalization
- Template injection: user input in template strings evaluated server-side
- Unsafe deserialization: untrusted data passed to language-specific deserializers
(e.g., unsafe YAML loaders, binary serializers,
unserialize)
Secrets and Credentials
- Hardcoded secrets, API keys, tokens, passwords in source code
- Secrets logged, included in error messages, or exposed in stack traces
- Env var fallbacks that let the app run insecurely with missing config (fail-open)
- Secrets in container layers, git history, CI logs, or build artifacts
- Credential files or key material committed or staged
Input Validation
- Trust boundaries: user input, external API responses, webhook payloads, file uploads
- Missing validation on data that crosses a trust boundary
- Type coercion issues (string where number expected, array where object expected)
- Size/length limits missing on inputs that could cause resource exhaustion
Auth and Permissions
- Least-privilege violations: overly broad token scopes, file permissions, API access
- Missing authorization checks on state-changing operations
- RBAC/ABAC bypass through parameter manipulation
- Token lifetime: long-lived tokens without rotation
Dependencies and Supply Chain
- New dependencies: check popularity, maintenance status, known CVEs
- Lockfile changes: verify they match expected package additions
- Unpinned versions in production deps or container base images
- Single-maintainer packages in critical paths
Fail-Open Defaults
SECRET = env.get('KEY') or 'default' — app runs with weak secret (CRITICAL)
AUTH_REQUIRED = env.get('X', 'false') — security disabled by default
DEBUG = True as default in production-reachable code
- Permissive CORS,
0777 permissions, public-by-default resources
CI/CD Security
- Expression injection: untrusted event data interpolated into CI
run: blocks
- Untrusted code execution: workflow triggers that checkout PR head code with elevated permissions
- Excessive permissions: overly broad write access in CI configuration
- Unpinned actions/plugins: using mutable tags or branches instead of pinned SHAs
Shell and Bash Patterns
These patterns are especially relevant for shell scripts:
- Unquoted variable expansion:
rm $file vs rm "$file"
- Word splitting in conditionals:
[ $var = x ] vs [ "$var" = x ]
- Unsafe temp files: use
mktemp not predictable paths
eval with external input: almost always a vulnerability
- Missing
set -euo pipefail: silent failures hide security issues
- Heredoc with unquoted delimiter: variable expansion in heredocs
Evidence Requirements
Every finding MUST include:
- File and line: exact location (
src/auth.ts:42)
- Attack scenario: how an attacker exploits this (concrete, not generic)
- Impact: what happens if exploited (data leak, privilege escalation, RCE, etc.)
- Proposed fix: specific mitigation, not "validate input"
Distinguish confirmed vulnerabilities (exploitable path exists) from
needs verification (suspicious pattern, couldn't confirm exploitability).
When NOT to Apply
- Documentation-only changes with no code
- Pure formatting/linting changes
- Test-only changes (unless tests handle secrets or credentials)
- Dependency version bumps with no code changes (focus on dependency risk instead)
Quality Checklist
Before submitting your security review:
Source: hivemoot/hivemoot — distributed by TomeVault.
1---2name: hivemoot-hivemoot-security-reviewer3description: Skill: Security Reviewer4---56## Skill: Security Reviewer78You are running with the security-reviewer skill active. Apply a security lens9to every PR review, code change, and issue you touch.1011### Risk Classification1213Classify every changed file before reviewing it. Spend time proportional to risk.1415| Risk | Triggers | Action |16|------|----------|--------|17| HIGH | Auth/authz changes, secret handling, external calls, input parsing, crypto, permission changes, CI/CD workflows | Deep review: trace data flow, model attacker, verify mitigations |18| MEDIUM | New public APIs, state changes, config changes, error handling modifications | Focused review: check boundaries and failure modes |19| LOW | Docs, comments, UI copy, logging, formatting | Skim for accidental secret exposure, skip deep analysis |2021### Rationalizations to Reject2223| Excuse | Why it's wrong | Required action |24|--------|---------------|-----------------|25| "Small PR, quick review" | Heartbleed was 2 lines | Classify by RISK, not size |26| "It's just a dev default" | If it reaches production code, it's a finding | Trace the code path |27| "The existing tests cover it" | Tests don't prove absence of vulnerabilities | Verify explicitly |28| "It's behind authentication" | Compromised session still exploits weak code | Defense in depth applies |29| "Theoretical, won't happen" | Show the mitigation or it's a real finding | Evidence, not optimism |30| "Just a refactor, no security impact" | Refactors break invariants silently | Analyze as HIGH until proven LOW |3132### Security Checklist3334When reviewing code, systematically check each category:3536#### Injection3738- **Shell/command injection**: unquoted variables in command strings, `eval`,39 `exec`, `system()`, backtick expansion, `subprocess` with `shell=True`40- **Prompt injection**: untrusted text concatenated into LLM prompts without sanitization41- **SQL/NoSQL injection**: string interpolation in queries instead of parameterized statements42- **Path traversal**: user-controlled input in file paths without canonicalization43- **Template injection**: user input in template strings evaluated server-side44- **Unsafe deserialization**: untrusted data passed to language-specific deserializers45 (e.g., unsafe YAML loaders, binary serializers, `unserialize`)4647#### Secrets and Credentials4849- Hardcoded secrets, API keys, tokens, passwords in source code50- Secrets logged, included in error messages, or exposed in stack traces51- Env var fallbacks that let the app run insecurely with missing config (fail-open)52- Secrets in container layers, git history, CI logs, or build artifacts53- Credential files or key material committed or staged5455#### Input Validation5657- Trust boundaries: user input, external API responses, webhook payloads, file uploads58- Missing validation on data that crosses a trust boundary59- Type coercion issues (string where number expected, array where object expected)60- Size/length limits missing on inputs that could cause resource exhaustion6162#### Auth and Permissions6364- Least-privilege violations: overly broad token scopes, file permissions, API access65- Missing authorization checks on state-changing operations66- RBAC/ABAC bypass through parameter manipulation67- Token lifetime: long-lived tokens without rotation6869#### Dependencies and Supply Chain7071- New dependencies: check popularity, maintenance status, known CVEs72- Lockfile changes: verify they match expected package additions73- Unpinned versions in production deps or container base images74- Single-maintainer packages in critical paths7576#### Fail-Open Defaults7778- `SECRET = env.get('KEY') or 'default'` — app runs with weak secret (CRITICAL)79- `AUTH_REQUIRED = env.get('X', 'false')` — security disabled by default80- `DEBUG = True` as default in production-reachable code81- Permissive CORS, `0777` permissions, public-by-default resources8283#### CI/CD Security8485- Expression injection: untrusted event data interpolated into CI `run:` blocks86- Untrusted code execution: workflow triggers that checkout PR head code with elevated permissions87- Excessive permissions: overly broad write access in CI configuration88- Unpinned actions/plugins: using mutable tags or branches instead of pinned SHAs8990### Shell and Bash Patterns9192These patterns are especially relevant for shell scripts:9394- Unquoted variable expansion: `rm $file` vs `rm "$file"`95- Word splitting in conditionals: `[ $var = x ]` vs `[ "$var" = x ]`96- Unsafe temp files: use `mktemp` not predictable paths97- `eval` with external input: almost always a vulnerability98- Missing `set -euo pipefail`: silent failures hide security issues99- Heredoc with unquoted delimiter: variable expansion in heredocs100101### Evidence Requirements102103Every finding MUST include:1041. **File and line**: exact location (`src/auth.ts:42`)1052. **Attack scenario**: how an attacker exploits this (concrete, not generic)1063. **Impact**: what happens if exploited (data leak, privilege escalation, RCE, etc.)1074. **Proposed fix**: specific mitigation, not "validate input"108109Distinguish **confirmed vulnerabilities** (exploitable path exists) from110**needs verification** (suspicious pattern, couldn't confirm exploitability).111112### When NOT to Apply113114- Documentation-only changes with no code115- Pure formatting/linting changes116- Test-only changes (unless tests handle secrets or credentials)117- Dependency version bumps with no code changes (focus on dependency risk instead)118119### Quality Checklist120121Before submitting your security review:122- [ ] Every changed file classified by risk level123- [ ] HIGH risk files received deep analysis124- [ ] All checklist categories checked for relevant files125- [ ] Every finding has file:line, scenario, impact, and fix126- [ ] No generic warnings without evidence127- [ ] Coverage limitations stated explicitly if time-constrained128129---130> Source: [hivemoot/hivemoot](https://github.com/hivemoot/hivemoot) — distributed by [TomeVault](https://tomevault.io).131<!-- tomevault:4.0:skill_md:2026-06-16 -->