Back to skill

Security audit

Task Automator

Security checks for vulnerabilities and agentic risk

Overview

This automation skill is broadly disclosed, but it needs review because its file organizer can move files outside the intended destination and its recurring automation guidance lacks guardrails.

Review this skill before installing. Only run it with trusted configuration files, use --dry-run first, avoid configs with absolute paths or .. in folder/output values, and do not create recurring jobs unless you have a clear way to audit and disable them.

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

Error
Location
scripts/run_task.py:78
Finding

Configuration-Controlled Path Traversal Enables File Movement Outside the Intended Destination

Content
View full analysis

Vulnerability Details

File Location: scripts/run_task.py, lines 78-96
Vulnerability Type: Unvalidated destination path / path traversal
Risk Level: High

Vulnerable Code

python
for file in source.iterdir():
    if file.is_file():
        ext = file.suffix.lower()
        target_folder = None
        
        for rule in rules:
            if rule.get('extension', '').lower() == ext:
                target_folder = rule.get('folder', 'Other')
                break
        
        if target_folder is None:
            target_folder = 'Other'
        
        target_path = destination / target_folder
        
        if self.dry_run:
            self.log(f"Would move: {file.name} -> {target_folder}/")
        else:
            target_path.mkdir(parents=True, exist_ok=True)
            shutil.move(str(file), str(target_path / file.name))

Technical Analysis

The folder property is read directly from task configuration and appended to the configured destination without validation or containment checking. Python path composition does not guarantee that the resulting path remains under destination.

A value containing parent-directory components, such as ../../target, traverses outside the intended destination. An absolute folder path can replace the destination entirely when the paths are combined. The code then creates the attacker-selected directory and moves every matching regular file from the source directory into it.

This violates least privilege because a file-organization task should only modify files within its explicitly configured source and destination boundaries. The implementation instead allows configuration authors to select any filesystem destination writable by the process.

Attack Path

  1. An attacker supplies or modifies a file-organizer configuration accessible to the user or automation system.
  2. The attacker adds a matching rule conta ...[truncated 1839 chars]
Remediation
View remediation

Remediation Suggestions

Treat all paths and folder names from configuration as untrusted input.

  1. Reject absolute values for target_folder.
  2. Resolve both the destination root and candidate target path before performing any filesystem operation.
  3. Require the resolved candidate path to remain strictly beneath the resolved destination root.
  4. Reject .., empty folder names, and unexpected path separators if each rule is intended to specify only one directory name.
  5. Define an explicit collision policy rather than allowing platform-dependent overwrites.
  6. Validate the source and destination against an approved workspace boundary when the skill runs in an agent environment.
  7. Perform validation in dry-run mode as well, so unsafe configurations are reported before live execution.

Example hardening:

python
destination_root = destination.resolve()
folder_value = rule.get("folder", "Other")

if not isinstance(folder_value, str) or not folder_value.strip():
    raise ValueError("Rule folder must be a non-empty string")

folder_path = Path(folder_value)

if folder_path.is_absolute() or ".." in folder_path.parts:
    raise ValueError(f"Unsafe target folder: {folder_value}")

target_path = (destination_root / folder_path).resolve()

if not target_path.is_relative_to(destination_root):
    raise ValueError(f"Target escapes destination: {folder_value}")

target_file = target_path / file.name
if target_file.exists():
    raise FileExistsError(f"Refusing to overwrite: {target_file}")

target_path.mkdir(parents=True, exist_ok=True)
shutil.move(str(file), str(target_file))

For Python versions without Path.is_relative_to(), use os.path.commonpath() with resolved paths and verify that the common path equals the approved destination root.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (8)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill advertises file operations and includes commands/scripts that imply file read/write capability, but it declares no explicit tool scope or permission boundaries. This can lead to overbroad execution in an agent environment, increasing the chance of unintended file access or modification beyond what the user expects.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
90% confidence
Finding

The skill explicitly supports recurring tasks, which introduces persistence beyond the current session and can cause continued file operations, network activity, or other side effects after initial invocation. Persistence is especially sensitive in an automation skill because it can amplify mistakes or abuse over time without renewed user awareness.

Content

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

md
---
name: task-automator
description: Automate repetitive computer tasks including file operations, data processing, web scraping, and API integrations. Use when you need to batch process files, sync data, schedule recurring tasks, or create custom automation workflows.
---

# Task Automator

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The description is extremely broad and can match many generic requests about automation, files, APIs, or web tasks, causing the skill to be invoked in situations broader than intended. Overbroad routing increases exposure to risky actions like file changes, scraping, or external calls without sufficient contextual review.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The markdown promotes file operations, web scraping, API integrations, and scheduling, all of which can affect local data, third-party systems, and privacy, but it does not prominently warn about those consequences before use. In an automation skill, missing user-facing cautions makes unintended destructive actions or unauthorized data handling more likely.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
92% confidence
Finding

The quick-start example directly instructs users to schedule a recurring task via cron-like syntax, but does not pair that guidance with strong warnings about persistence, scope, or how to stop the task. That makes durable execution easier to enable than to govern, which is risky for skills that can touch files and external services.

Content

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

python scripts/run_task.py --task file_organizer --config tasks/organize.json

text

### Schedule a Recurring Task

```bash
python scripts/schedule_task.py --task data_backup --cron "0 2 * * *"

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

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

md
{
  "source": {
    "type": "api",
    "url": "https://api.source.com/data",
    "auth": "bearer_token"
  },
  "destination": {

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

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

md
},
  "destination": {
    "type": "api",
    "url": "https://api.dest.com/items",
    "auth": "api_key"
  },
  "mapping": {

Session Persistence

Medium
Category
Rogue Agent
Confidence
89% confidence
Finding

The dedicated scheduling section normalizes recurring execution without describing guardrails such as user consent, bounded scope, auditability, or cancellation. In context, this increases the danger because the same skill also covers file operations, scraping, and API integrations that could repeatedly act on local or external systems.

Content

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

md
### schedule_task.py

Schedule recurring tasks.

**Arguments:**
- `--task` - Task name

Static analysis

No suspicious patterns detected.