Back to skill

Security audit

Security Analyst

Security checks for vulnerabilities and agentic risk

Overview

This appears to be a legitimate security-audit skill, but it needs review because it can read secrets, write exploit details, and includes an unsafe user-supplied git command template.

Run this only in an isolated copy of code you control, with real credentials removed where possible. Add docs/security/runs/ to .gitignore or use a private output directory, review generated artifacts for raw secrets before sharing, and validate or quote commit hashes before using variant-hunt. Expect dependency and CVE checks may contact external services despite the local-only wording.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (2)

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
references/prompts/recon-agent.md:118
Finding
Overly Broad Access to Raw Environment and Credential Files## Vulnerability Details **File Location**: `references/prompts/recon-agent.md:118-124` and `references/prompts/recon-agent.md:148-151` **Vulnerability Type**: Excessive access to sensitive project files **Risk Level**: Medium ### Vulnerable Code ```text ### Step 8: Encryption & Secrets - Grep for: encrypt, decrypt, hash, hmac, crypto, kms, key_ring, cipher - Glob for: .env*, *.env, secrets*, credentials*, *config*.json, *config*.yaml - Check .gitignore for secret files - Search for hardcoded secrets: Grep for patterns like API_KEY=, SECRET=, PASSWORD=, token strings - Check secret management: Secret Manager, Vault, env vars, config files ``` Related instructions expand this access further: ```text ### Step 11: Configuration - Read hosting/server config for security headers (CSP, HSTS, X-Frame-Options) - Grep for CORS configuration: cors, Access-Control, origin - Read all .env* files (note which are gitignored) - Check for security-relevant config: rate limiting, request size limits, timeouts ``` ### Technical Analysis The reconnaissance agent is explicitly instructed to discover and read all `.env` files and broadly search files named `credentials*` and `secrets*`. These files commonly contain production API keys, database passwords, signing keys, cloud credentials, and other authentication material. Reading repository configuration is legitimate for a security audit, but reading every raw value is not always the minimum privilege necessary to determine whether sensitive files exist, whether they are tracked by Git, and what classes of secrets they contain. A local scanner could instead return only the file location, secret type, line number, and a non-reversible fingerprint. The Skill mandates redaction in `references/prompts/config-infrastructure.md`, but the reconnaissance instructions do not impose an equivalent explicit prohibition on copying raw values into recon files or summaries. Recon resul ...[truncated 1947 chars]
Remediation
## Remediation Suggestions 1. Do not read complete secret files during initial reconnaissance. Inspect filenames, Git tracking status, permissions, and redacted scanner output first. 2. Use a local secret scanner that returns only: - File path and line number. - Detected secret type. - Redacted prefix or suffix. - Non-reversible fingerprint for duplicate detection. 3. Add a mandatory rule to every agent prompt stating that raw passwords, tokens, private keys, connection strings, and credential values must never be included in responses, summaries, findings, or artifacts. 4. Require explicit user consent before opening files likely to contain live credentials. 5. Exclude `.env`, credential, key, and secret files by default, with a documented opt-in mode for deeper secret analysis. 6. Prevent raw recon content from being inserted into downstream prompts. Pass only redacted structured summaries. 7. Add an automated post-processing step that scans generated reports for secret patterns before they are saved or displayed. 8. Store security-run artifacts outside tracked source directories by default and create them with restrictive filesystem permissions. 9. Automatically recommend or configure a `.gitignore` rule for `docs/security/runs/`. 10. Clearly distinguish test/example credentials from potentially live values without reproducing either value.

T09 · Insecure Skill Coding Practices

Warning
Location
references/commands/variant-hunt.md:22
Finding
Unvalidated User-Supplied Commit Identifier in Shell Command Template## Vulnerability Details **File Location**: `references/commands/variant-hunt.md:22-25` **Vulnerability Type**: Potential command and argument injection **Risk Level**: Medium ### Vulnerable Code ```text 2. **Understand the original**: - If commit hash: `git show {hash}` to understand what was fixed - If vulnerability type: search git history and recon step files for related patterns - If CVE: look up the CVE details and find the affected code ``` ### Technical Analysis The variant-hunt command accepts a user-provided vulnerability description or commit hash. The instructions then show direct substitution of the supplied hash into a shell command: ```text git show {hash} ``` No requirement validates that the value is a hexadecimal Git object identifier. The template also lacks safe argument-array execution, an end-of-options delimiter, and shell-metacharacter rejection. If an agent implements the instruction by constructing a shell command string, a malicious value could be interpreted as additional Git options or shell syntax. Git option injection may cause unintended repository operations or file reads, while shell metacharacters may allow arbitrary commands to run with the agent's workspace permissions. Exploitation depends on how the hosting agent performs interpolation and invokes Bash. The Markdown file is not independently executable, but it directs an agent with Bash access to construct the unsafe command. ### Attack Path 1. An attacker or untrusted user invokes `/security-analyst:variant-hunt` with a crafted value presented as a commit hash. 2. The orchestrator treats the value as the `{hash}` placeholder without enforcing a hexadecimal allowlist. 3. An agent constructs `git show {hash}` as a shell command. 4. The shell or Git command-line parser interprets attacker-controlled options or metacharacters. 5. The injected operation executes with the same filesystem and process privileges gr ...[truncated 873 chars]
Remediation
## Remediation Suggestions 1. Validate commit identifiers with a strict allowlist before executing Git: ```text ^[0-9a-fA-F]{7,64}$ ``` 2. Resolve and validate the object as a commit before displaying it: ```bash git rev-parse --verify "${hash}^{commit}" ``` 3. Invoke Git through a structured argument-array API rather than assembling a shell command string. 4. If a shell is unavoidable, quote the validated value and use an end-of-options delimiter where supported. 5. Reject values containing whitespace, leading hyphens, command substitutions, redirection operators, separators, or control characters. 6. Keep vulnerability descriptions and CVE identifiers on separate handling paths; never interpret free-form descriptions as command arguments. 7. Require confirmation if input is ambiguous and report invalid commit identifiers without attempting fallback shell commands. 8. Add regression tests covering leading Git options, semicolons, pipes, command substitution, newlines, and malformed object identifiers. 9. Restrict Bash permissions for the variant-hunt agent to the minimum set of read-only Git operations required.
Vulnerability Patterns
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (119)

Direct Prompt Extraction

High
Category
System Prompt Leakage
Content
# Shared Agent Output Instructions

## Finding Output (LOD Architecture)
Confidence
85% confidence
Finding
Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Direct Prompt Extraction

High
Category
System Prompt Leakage
Content
# Shared Agent Output Instructions

## Finding Output (LOD Architecture)
Confidence
85% confidence
Finding
Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Direct Prompt Extraction

High
Category
System Prompt Leakage
Content
content: "Phase 2a: Update templates/finding.md with LOD-0, LOD-1, LOD-2 format definitions"
    status: pending
  - id: phase-2-agent-common
    content: "Phase 2b: Create templates/agent-common.md with shared output instructions (LOD writing + incidental findings)"
    status: pending
  - id: phase-2-orchestrator
    content: "Phase 2c: Update orchestrator: add FINDINGS_DIR constant, LOD-aware spawning pattern, index builder, LOD-0 passing between groups"
Confidence
85% confidence
Finding
Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Direct Prompt Extraction

High
Category
System Prompt Leakage
Content
content: "Phase 2a: Update templates/finding.md with LOD-0, LOD-1, LOD-2 format definitions"
    status: pending
  - id: phase-2-agent-common
    content: "Phase 2b: Create templates/agent-common.md with shared output instructions (LOD writing + incidental findings)"
    status: pending
  - id: phase-2-orchestrator
    content: "Phase 2c: Update orchestrator: add FINDINGS_DIR constant, LOD-aware spawning pattern, index builder, LOD-0 passing between groups"
Confidence
85% confidence
Finding
Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Direct Prompt Extraction

High
Category
System Prompt Leakage
Content
content: "Phase 2a: Update templates/finding.md with LOD-0, LOD-1, LOD-2 format definitions"
    status: pending
  - id: phase-2-agent-common
    content: "Phase 2b: Create templates/agent-common.md with shared output instructions (LOD writing + incidental findings)"
    status: pending
  - id: phase-2-orchestrator
    content: "Phase 2c: Update orchestrator: add FINDINGS_DIR constant, LOD-aware spawning pattern, index builder, LOD-0 passing between groups"
Confidence
85% confidence
Finding
Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Direct Prompt Extraction

High
Category
System Prompt Leakage
Content
content: "Phase 2a: Update templates/finding.md with LOD-0, LOD-1, LOD-2 format definitions"
    status: pending
  - id: phase-2-agent-common
    content: "Phase 2b: Create templates/agent-common.md with shared output instructions (LOD writing + incidental findings)"
    status: pending
  - id: phase-2-orchestrator
    content: "Phase 2c: Update orchestrator: add FINDINGS_DIR constant, LOD-aware spawning pattern, index builder, LOD-0 passing between groups"
Confidence
85% confidence
Finding
Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Direct Prompt Extraction

High
Category
System Prompt Leakage
Content
content: "Phase 2a: Update templates/finding.md with LOD-0, LOD-1, LOD-2 format definitions"
    status: pending
  - id: phase-2-agent-common
    content: "Phase 2b: Create templates/agent-common.md with shared output instructions (LOD writing + incidental findings)"
    status: pending
  - id: phase-2-orchestrator
    content: "Phase 2c: Update orchestrator: add FINDINGS_DIR constant, LOD-aware spawning pattern, index builder, LOD-0 passing between groups"
Confidence
85% confidence
Finding
Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Direct Prompt Extraction

High
Category
System Prompt Leakage
Content
content: "Phase 2a: Update templates/finding.md with LOD-0, LOD-1, LOD-2 format definitions"
    status: pending
  - id: phase-2-agent-common
    content: "Phase 2b: Create templates/agent-common.md with shared output instructions (LOD writing + incidental findings)"
    status: pending
  - id: phase-2-orchestrator
    content: "Phase 2c: Update orchestrator: add FINDINGS_DIR constant, LOD-aware spawning pattern, index builder, LOD-0 passing between groups"
Confidence
85% confidence
Finding
Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Direct Prompt Extraction

High
Category
System Prompt Leakage
Content
content: "Phase 2a: Update templates/finding.md with LOD-0, LOD-1, LOD-2 format definitions"
    status: pending
  - id: phase-2-agent-common
    content: "Phase 2b: Create templates/agent-common.md with shared output instructions (LOD writing + incidental findings)"
    status: pending
  - id: phase-2-orchestrator
    content: "Phase 2c: Update orchestrator: add FINDINGS_DIR constant, LOD-aware spawning pattern, index builder, LOD-0 passing between groups"
Confidence
85% confidence
Finding
Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Direct Prompt Extraction

High
Category
System Prompt Leakage
Content
content: "Phase 2a: Update templates/finding.md with LOD-0, LOD-1, LOD-2 format definitions"
    status: pending
  - id: phase-2-agent-common
    content: "Phase 2b: Create templates/agent-common.md with shared output instructions (LOD writing + incidental findings)"
    status: pending
  - id: phase-2-orchestrator
    content: "Phase 2c: Update orchestrator: add FINDINGS_DIR constant, LOD-aware spawning pattern, index builder, LOD-0 passing between groups"
Confidence
85% confidence
Finding
Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Direct Prompt Extraction

High
Category
System Prompt Leakage
Content
content: "Phase 2a: Update templates/finding.md with LOD-0, LOD-1, LOD-2 format definitions"
    status: pending
  - id: phase-2-agent-common
    content: "Phase 2b: Create templates/agent-common.md with shared output instructions (LOD writing + incidental findings)"
    status: pending
  - id: phase-2-orchestrator
    content: "Phase 2c: Update orchestrator: add FINDINGS_DIR constant, LOD-aware spawning pattern, index builder, LOD-0 passing between groups"
Confidence
85% confidence
Finding
Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Direct Prompt Extraction

High
Category
System Prompt Leakage
Content
content: "Phase 2a: Update templates/finding.md with LOD-0, LOD-1, LOD-2 format definitions"
    status: pending
  - id: phase-2-agent-common
    content: "Phase 2b: Create templates/agent-common.md with shared output instructions (LOD writing + incidental findings)"
    status: pending
  - id: phase-2-orchestrator
    content: "Phase 2c: Update orchestrator: add FINDINGS_DIR constant, LOD-aware spawning pattern, index builder, LOD-0 passing between groups"
Confidence
85% confidence
Finding
Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Direct Prompt Extraction

High
Category
System Prompt Leakage
Content
content: "Phase 2a: Update templates/finding.md with LOD-0, LOD-1, LOD-2 format definitions"
    status: pending
  - id: phase-2-agent-common
    content: "Phase 2b: Create templates/agent-common.md with shared output instructions (LOD writing + incidental findings)"
    status: pending
  - id: phase-2-orchestrator
    content: "Phase 2c: Update orchestrator: add FINDINGS_DIR constant, LOD-aware spawning pattern, index builder, LOD-0 passing between groups"
Confidence
85% confidence
Finding
Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Direct Prompt Extraction

High
Category
System Prompt Leakage
Content
content: "Phase 2a: Update templates/finding.md with LOD-0, LOD-1, LOD-2 format definitions"
    status: pending
  - id: phase-2-agent-common
    content: "Phase 2b: Create templates/agent-common.md with shared output instructions (LOD writing + incidental findings)"
    status: pending
  - id: phase-2-orchestrator
    content: "Phase 2c: Update orchestrator: add FINDINGS_DIR constant, LOD-aware spawning pattern, index builder, LOD-0 passing between groups"
Confidence
85% confidence
Finding
Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Direct Prompt Extraction

High
Category
System Prompt Leakage
Content
content: "Phase 2a: Update templates/finding.md with LOD-0, LOD-1, LOD-2 format definitions"
    status: pending
  - id: phase-2-agent-common
    content: "Phase 2b: Create templates/agent-common.md with shared output instructions (LOD writing + incidental findings)"
    status: pending
  - id: phase-2-orchestrator
    content: "Phase 2c: Update orchestrator: add FINDINGS_DIR constant, LOD-aware spawning pattern, index builder, LOD-0 passing between groups"
Confidence
85% confidence
Finding
Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Direct Prompt Extraction

High
Category
System Prompt Leakage
Content
content: "Phase 2a: Update templates/finding.md with LOD-0, LOD-1, LOD-2 format definitions"
    status: pending
  - id: phase-2-agent-common
    content: "Phase 2b: Create templates/agent-common.md with shared output instructions (LOD writing + incidental findings)"
    status: pending
  - id: phase-2-orchestrator
    content: "Phase 2c: Update orchestrator: add FINDINGS_DIR constant, LOD-aware spawning pattern, index builder, LOD-0 passing between groups"
Confidence
85% confidence
Finding
Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Direct Prompt Extraction

High
Category
System Prompt Leakage
Content
content: "Phase 2a: Update templates/finding.md with LOD-0, LOD-1, LOD-2 format definitions"
    status: pending
  - id: phase-2-agent-common
    content: "Phase 2b: Create templates/agent-common.md with shared output instructions (LOD writing + incidental findings)"
    status: pending
  - id: phase-2-orchestrator
    content: "Phase 2c: Update orchestrator: add FINDINGS_DIR constant, LOD-aware spawning pattern, index builder, LOD-0 passing between groups"
Confidence
85% confidence
Finding
Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Direct Prompt Extraction

High
Category
System Prompt Leakage
Content
content: "Phase 2a: Update templates/finding.md with LOD-0, LOD-1, LOD-2 format definitions"
    status: pending
  - id: phase-2-agent-common
    content: "Phase 2b: Create templates/agent-common.md with shared output instructions (LOD writing + incidental findings)"
    status: pending
  - id: phase-2-orchestrator
    content: "Phase 2c: Update orchestrator: add FINDINGS_DIR constant, LOD-aware spawning pattern, index builder, LOD-0 passing between groups"
Confidence
85% confidence
Finding
Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Direct Prompt Extraction

High
Category
System Prompt Leakage
Content
content: "Phase 2a: Update templates/finding.md with LOD-0, LOD-1, LOD-2 format definitions"
    status: pending
  - id: phase-2-agent-common
    content: "Phase 2b: Create templates/agent-common.md with shared output instructions (LOD writing + incidental findings)"
    status: pending
  - id: phase-2-orchestrator
    content: "Phase 2c: Update orchestrator: add FINDINGS_DIR constant, LOD-aware spawning pattern, index builder, LOD-0 passing between groups"
Confidence
85% confidence
Finding
Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Direct Prompt Extraction

High
Category
System Prompt Leakage
Content
content: "Phase 2a: Update templates/finding.md with LOD-0, LOD-1, LOD-2 format definitions"
    status: pending
  - id: phase-2-agent-common
    content: "Phase 2b: Create templates/agent-common.md with shared output instructions (LOD writing + incidental findings)"
    status: pending
  - id: phase-2-orchestrator
    content: "Phase 2c: Update orchestrator: add FINDINGS_DIR constant, LOD-aware spawning pattern, index builder, LOD-0 passing between groups"
Confidence
85% confidence
Finding
Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Direct Prompt Extraction

High
Category
System Prompt Leakage
Content
content: "Phase 2a: Update templates/finding.md with LOD-0, LOD-1, LOD-2 format definitions"
    status: pending
  - id: phase-2-agent-common
    content: "Phase 2b: Create templates/agent-common.md with shared output instructions (LOD writing + incidental findings)"
    status: pending
  - id: phase-2-orchestrator
    content: "Phase 2c: Update orchestrator: add FINDINGS_DIR constant, LOD-aware spawning pattern, index builder, LOD-0 passing between groups"
Confidence
85% confidence
Finding
Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Direct Prompt Extraction

High
Category
System Prompt Leakage
Content
content: "Phase 2a: Update templates/finding.md with LOD-0, LOD-1, LOD-2 format definitions"
    status: pending
  - id: phase-2-agent-common
    content: "Phase 2b: Create templates/agent-common.md with shared output instructions (LOD writing + incidental findings)"
    status: pending
  - id: phase-2-orchestrator
    content: "Phase 2c: Update orchestrator: add FINDINGS_DIR constant, LOD-aware spawning pattern, index builder, LOD-0 passing between groups"
Confidence
85% confidence
Finding
Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Direct Prompt Extraction

High
Category
System Prompt Leakage
Content
content: "Phase 2a: Update templates/finding.md with LOD-0, LOD-1, LOD-2 format definitions"
    status: pending
  - id: phase-2-agent-common
    content: "Phase 2b: Create templates/agent-common.md with shared output instructions (LOD writing + incidental findings)"
    status: pending
  - id: phase-2-orchestrator
    content: "Phase 2c: Update orchestrator: add FINDINGS_DIR constant, LOD-aware spawning pattern, index builder, LOD-0 passing between groups"
Confidence
85% confidence
Finding
Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Direct Prompt Extraction

High
Category
System Prompt Leakage
Content
content: "Phase 2a: Update templates/finding.md with LOD-0, LOD-1, LOD-2 format definitions"
    status: pending
  - id: phase-2-agent-common
    content: "Phase 2b: Create templates/agent-common.md with shared output instructions (LOD writing + incidental findings)"
    status: pending
  - id: phase-2-orchestrator
    content: "Phase 2c: Update orchestrator: add FINDINGS_DIR constant, LOD-aware spawning pattern, index builder, LOD-0 passing between groups"
Confidence
85% confidence
Finding
Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Direct Prompt Extraction

High
Category
System Prompt Leakage
Content
content: "Phase 2a: Update templates/finding.md with LOD-0, LOD-1, LOD-2 format definitions"
    status: pending
  - id: phase-2-agent-common
    content: "Phase 2b: Create templates/agent-common.md with shared output instructions (LOD writing + incidental findings)"
    status: pending
  - id: phase-2-orchestrator
    content: "Phase 2c: Update orchestrator: add FINDINGS_DIR constant, LOD-aware spawning pattern, index builder, LOD-0 passing between groups"
Confidence
85% confidence
Finding
Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.