Back to skill

Security audit

Farm Task Manager

Security checks for vulnerabilities and agentic risk

Overview

This farm task skill is mostly coherent, but its export command can overwrite arbitrary writable files in the user's home directory despite claiming strong path safety.

Review this skill before installing. It does not show credential theft, network exfiltration, or hidden persistence, but use caution with the export command: only export to a dedicated task export folder and avoid pointing it at existing files until the path validation and overwrite behavior are fixed.

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 (1)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/farm_task_manager.py:39
Finding

Insufficient path validation permits file overwrite outside the intended workspace

Content
View full analysis
bool: """Validate a file path is safe for writing. Blocks system paths and sensitive dotfiles. Allows workspace and home directories. """ path = Path(filepath).expanduser().resolve() # Allow workspace and home allowed_paths = [ WORKSPACE, Path.home(), ] # Block system paths blocked_paths = [ Path("/etc"), Path("/usr"), Path("/var"), Path("/root"), Path("/bin"), Path("/sbin"), Path("/boot"), Path("/lib"), Path("/opt"), ] # Block sensitive dotfiles sensitive_patterns = [ ".ssh", ".bashrc", ".zshrc", ".bash_profile", ".zprofile", ".bash_history", ".zsh_history", ".aws", ".env", ".secret", ".token", ".key", ] # Check if path is allowed is_allowed = any(str(path).startswith(str(allowed)) for allowed in allowed_paths) # Check if path is blocked is_blocked = any(str(path).startswith(str(blocked)) for blocked in blocked_paths) # Check for sensitive dotfiles in path has_sensitive = any(f"/{s}/" in str(path) or f"/{s}" in str(path) for s in sensitive_patterns) return is_allowed and not is_blocked and not has_sensitive ``` The validated path is subsequently opened in truncating write mode: ```python if not is_safe_path(args.file): print(f"Error: Unsafe path {args.file}") return try: args.file.parent.mkdir(parents=True, exist_ok=True) if format_type == "json": with open(args.file, 'w') as f: json.dump(tasks, f, indent=2) ``` # ...[truncated 3146 chars]
Remediation
View remediation
bool: export_root = EXPORT_DIR.resolve() candidate = Path(filepath).expanduser().resolve(strict=False) try: candidate.relative_to(export_root) except ValueError: return False return candidate != export_root ``` On supported Python versions, `candidate.is_relative_to(export_root)` may be used instead. 3. Do not rely on a sensitive-file denylist as the primary authorization control. Use a narrowly scoped allowlist root. 4. Avoid silently truncating existing files. Use exclusive creation mode (`x`) by default, or require an explicit overwrite option and confirmation. 5. Mitigate validation-to-open race conditions and symlink attacks. Where practical, open files relative to a trusted directory descriptor and use platform protections such as `O_NOFOLLOW`. 6. Write to a temporary file inside the approved export directory, flush and synchronize it, and atomically replace the final destination only after all validation succeeds. 7. Add regression tests covering: - Paths within the dedicated export directory. - `..` traversal attempts. - Prefix-collision paths such as `/home/user-other/file`. - Unapproved home files such as `~/.profile`. - Existing-file overwrite attempts. - Symlinks pointing outside the approved export directory. ]]>
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (4)

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/farm_task_manager.py (reported line 63)May include surrounding context.

python
".bash_history",
        ".zsh_history",
        ".aws",
        ".env",
        ".secret",
        ".token",
        ".key",

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · SKILL.md (reported line 31)May include surrounding context.

md
- **Task Management**: Add tasks with name, description, priority, due date, category, and assignee
- **Task Filtering**: List tasks by status, priority, category, due date, assignee
- **Task Updates**: Update task status (pending, in-progress, completed) and add notes
- **Recurring Tasks**: Create daily, weekly, monthly, or seasonal recurring tasks
- **Search**: Search across all tasks by name, description, or category
- **Export**: Export to markdown or JSON for sharing and backup

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill documents a destructive delete command with no warning, confirmation step, or recovery guidance. In a task-management context this can lead to accidental loss of task data, especially because tasks are stored persistently in a JSON file and the documentation presents deletion as a simple one-step action.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The delete_task function removes a task from the stored task list and persists that change immediately, but there is no confirmation prompt or prior warning that the action is destructive. For a code file, irreversible data-modifying operations should include some form of user disclosure unless the risk is clearly communicated.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.