Skip to content
Back to skills

Review Code Security

ASecurity

Codex-primary security review of implemented code across three axes; security-scanner fallback.

  • 3 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 7, 2026
securityrustgoshellbashsqlnodeawsgitapisecurity

Works with

  • api
  • mcp

Security analysis

A100/100

Pro scans all 3 files and shows the line behind each finding

Scanned November 25, 2026

npx -y skills add nirecom/agents --skill review-code-security --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Review Code Security?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Review Code Security
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/nirecom-review-code-security/badge)](https://www.skillsdirectory.com/skills/nirecom-review-code-security)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: review-code-security
description: Codex-primary security review of implemented code across three axes; security-scanner fallback.
model: sonnet
---

Scan implemented code for security anti-patterns across the same three axes as `/review-plan-security`, via Codex through the shared review loop (round-continuing under the 2+1 cap: fix concerns and re-run). Use after implementation to verify the plan's security goals hold in the actual code.

## When to Use

Use when the implementation touches external input, secrets handling, or third-party integrations.

## Rules

- Report each finding with: file/location, pattern category, and recommended fix.
- Note context for potential false positives (test fixtures, comments, examples).
- For commit-time auto-scanning of hard secrets (AWS/LLM API keys, PEM keys, GitHub/Slack tokens, `.env` commits), see `docs/scan-outbound.md` — those are covered automatically.
- Sibling sweep: enumerate functions, logic, or patterns the change touches that belong to a class; flag siblings as MUST / OPTIONAL / NA for same treatment.

## Procedure

RCS-1. Resolve `<PLANS_DIR>` via `skills/_shared/resolve-plans-dir.md`. Initialize `EXTENSIONS_USED=0`.
RCS-2. Invoke `"$AGENTS_MAIN_ROOT/skills/review-code-security/scripts/run-codex-review-loop.sh"` (Bash), exporting `AGENTS_MAIN_ROOT`, `SESSION_ID`, `PLANS_DIR`, `EXTENSIONS_USED`. Pass `CTX_SURVEY_CODE`, `CTX_SURVEY_HISTORY` when available. `CTX_CONCERNS_LOG` is auto-generated by the wrapper from the ledger (`concern-ledger render-concerns-log`, format `review-security-shared`) and auto-exported when non-empty — do not set it manually (#2185). Exit-code handling SSOT: `skills/_shared/codex-review-loop.md`. On exit 3 (codex unavailable): load prior concerns via `bash "$AGENTS_MAIN_ROOT/bin/concern-ledger" render-prior --plans-dir <PLANS_DIR> --session-id <session-id> --format review-security-shared`; also render the carrier via `bash "$AGENTS_MAIN_ROOT/bin/concern-ledger" render-concerns-log --plans-dir <PLANS_DIR> --session-id <session-id> --format review-security-shared` and, if the returned path is non-empty and non-zero-size, export it as `CTX_CONCERNS_LOG` in the security-scanner subagent's environment so rejected concerns are not re-raised. Launch the `security-scanner` subagent with `model:` = the `model=` line of `node "$AGENTS_MAIN_ROOT/bin/resolve-role-model" --role reviewer`, then re-run the wrapper with `--prestaged-report <artifact_path> --prestaged-producer security-scanner --prestaged-exec <COMPLETE|PARTIAL|ABSENT>` (mapping scanner `status:` complete→COMPLETE / partial→PARTIAL / failed→ABSENT); on `failed` still re-run with `--prestaged-exec ABSENT` so the round is recorded.
  The security-scanner JSON prompt sets its `dispatch_directive` key to the canonical line of the `rules/shell-commands.md` Subagent Dispatch Prompts section, and its `boundary_version_echo` key to `true`.
RCS-3. Triage — per `skills/_shared/priority-hierarchy.md`, reject a concern only when it directly contradicts a decision already settled in the approved intent.md / outline.md (including the merged Accepted Tradeoffs file `bin/resolve-accepted-tradeoffs-file` builds — in fallback, the path passed in the prompt). Raising a topic the code does not address is never grounds to reject; a reject must cite the specific governing decision.
For each rejected concern, record the verdict durably so it does not re-surface next round: `bash "$AGENTS_MAIN_ROOT/bin/concern-ledger" reject --plans-dir <PLANS_DIR> --session-id <session-id> --format review-security-shared --id C<N> --reason "<cited decision>"` (#2185).
Per `skills/_shared/glossary-drift-check.md`: count a concern whose text holds `[glossary-drift ` as unresolved whatever `concern-ledger reject` returns (never on the all-rejected path), and run its `--record` with `--step review_security`.

## Completion

Run `bash "$AGENTS_MAIN_ROOT/skills/review-code-security/scripts/run-quality-gates.sh"` — advisory lint gates only; non-zero per gate is a warning. Append `(N gates NOT FOUND)` when any `## <gate>: NOT FOUND` line appears. Report findings (APPROVED: no RISK items; NEEDS_REVISION: summarize mitigations). On exit 0 (APPROVED) the loop deletes the ledger — skip `check-finalized`. On any other exit: confirm finalized via `bash "$AGENTS_MAIN_ROOT/bin/concern-ledger" check-finalized`; if unfinalized, or wrapper returned exit 1 or exit 7, do not emit the sentinel. On the APPROVED / all-rejected path emit (as a standalone Bash call): `echo "<<WORKFLOW_MARK_STEP_review_security_complete>>"`.

On exit 6 (HIGH_UNRESOLVED) or exit 9: HALT; accept residual HIGH per `skills/_shared/codex-review-loop/exit-codes.md` "Escalation by format" (terminate if rejected), then re-run.

## Patterns by Axis

Scope every axis by the `## Threat boundary` section of `skills/_shared/review-criteria.md`: a threat outside it, or with no input path, is a `[NOT-CONCERN]` marker line, not a finding.

### Axis 1: Information Leakage
*Axis scope: OWASP ASVS V8 (Data Protection), V6 (Stored Cryptography)*

**Automated coverage**: AWS/LLM API keys, PEM private keys, GitHub/Slack tokens, and `.env` file commits are auto-detected by `scan-outbound.sh` at pre-commit. Source integrity is also covered: zero-width chars (U+200B/C/D, U+FEFF) and Bidi override chars (U+202D/E, U+2066–2069) are detected as `[zero-width]` / `[bidi-override]` (Trojan Source, CVE-2021-42574). This axis focuses on context-dependent leaks automation cannot catch.

| Pattern | What to look for | Risk |
|---|---|---|
| Generic secret hardcoded | `(?i)(secret\|password\|token)\s*=\s*["'][^"']{8,}["']` in source | Leaked credential |
| Logging sensitive data | `log.*password`, `print.*token`, stack traces with secrets | Exposure via logs |
| `.env` not gitignored | `.env` absent from `.gitignore` | Secret leak on push |
| Temp files with secrets | Scripts writing secrets to `/tmp/` or similar | Filesystem exposure |

### Axis 2: Third-Party Access
*Axis scope: OWASP MCP Top 10 (MCP03 Excessive Permissions, MCP04 Tool Poisoning), LLM Top 10 (LLM03 Supply Chain)*

| Pattern | What to look for | Risk |
|---|---|---|
| Unpinned dependency | `"latest"` in package.json, bare package name in requirements.txt | Supply chain (LLM03) |
| Unvalidated LLM/MCP output | Agent output used directly in `eval`, shell call, or DB query | Prompt injection → RCE |
| Excessive MCP permissions | Tool requesting file system / network beyond task scope | MCP03 |
| Tool Poisoning | MCP tool descriptions containing instruction overrides (`ignore previous`, system commands) | MCP04 |
| Rug Pull | MCP server behavior changes after approval — use trusted, auditable publishers only | MCP09 |
| Return Value Injection | Tool return value fed directly into a prompt or `eval` without validation | MCP05 / LLM01 |

### Axis 3: External Access
*Axis scope: OWASP WSTG (Input Validation), CWE Top 25 #2 (CWE-79 XSS), #3 (CWE-89 SQL Injection)*

| Pattern | Regex hint | CWE |
|---|---|---|
| Shell injection | `eval.*\$`, unquoted `$VAR` in command position | CWE-78 |
| Path traversal | `../` combined with user-controlled variable | CWE-22 |
| SQL injection | String concatenation in SQL (`"SELECT " + var`) | CWE-89 |
| Open redirect | Redirect to URL from user input without allowlist | CWE-601 |
| XSS | Unsanitized user input rendered as HTML | CWE-79 |
| Instruction override in input | Untrusted input containing `ignore previous`, `you are now`, `system:` forwarded to LLM as context | LLM01 |
| Base64 obfuscation | Base64 string from untrusted input decoded and passed to LLM/shell | LLM01 |

## Relationship to Other Tools

- `/review-plan-security` — architecture-level checklist (run before implementation begins)
- `scan-outbound.sh` — auto-detects hard secrets and private info at pre-commit (see `docs/scan-outbound.md`)

Files in this skill

  • SKILL.md7.4 KB
  • scripts/run-codex-review-loop.sh5.6 KB
  • scripts/run-quality-gates.sh8.2 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in security →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.