Back to skill

Security audit

Context Anchor

Security checks for vulnerabilities and agentic risk

Overview

This skill has a coherent context-recovery purpose, but its shell script has a real command-injection flaw in the days parameter that needs review before installation.

Review or patch scripts/anchor.sh before installing. At minimum, validate --days and DAYS_BACK as a bounded positive integer before arithmetic, avoid echo -e for file-derived text, and treat all recovered memory/context content as untrusted orientation data rather than instructions to follow automatically.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/anchor.sh:65
Finding

Command Injection Through Unvalidated DAYS_BACK Arithmetic Expression

Content
View full analysis
Remediation
View remediation
&2 exit 1 fi if (( DAYS_BACK > 365 )); then printf 'Error: --days must not exceed 365.\n' >&2 exit 1 fi ``` Also verify that `--days` has an argument before reading `$2`: ```bash --days) if [[ $# -lt 2 ]]; then printf 'Error: --days requires a value.\n' >&2 exit 1 fi DAYS_BACK="$2" shift 2 ;; ``` Apply validation after parsing so it covers both the environment variable and command-line input. Keep a reasonable upper bound to prevent resource-exhaustion attacks. For additional hardening: - Use `set -euo pipefail`. - Use `readonly` for validated configuration values where practical. - Avoid feeding untrusted strings into Bash arithmetic contexts. - Add tests for missing, negative, zero, malformed, expression-based, and excessively large values. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/anchor.sh:132
Finding

Terminal and Agent-Context Injection Through Unsanitized Memory Content

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • 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 (2)

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The description says to use the skill 'when waking up fresh, after compaction, or when you feel lost about what you were doing.' The phrase 'when you feel lost' is subjective and overly broad, making it unclear when the skill should or should not activate.

Content

No source excerpt is available for this finding.

Vague Triggers

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The instruction 'use it manually when you feel lost about context' is an imprecise activation condition without defined scope or exclusions. This can overlap with many normal situations and does not provide negative examples or boundaries.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.