Back to skill

Security audit

Task Dispatcher

Security checks for vulnerabilities and agentic risk

Overview

This skill looks like an incomplete or under-scoped task dispatcher: it writes system dispatch records and reports tasks as dispatched without actually sending them to workers.

Install only if you understand that this skill does not actually dispatch work to worker nodes as written. It should be treated as a local dispatch-log writer until real delivery verification is added, and it should run under a least-privileged account with a tightly owned log directory or a safer application-owned path.

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/dispatch.py:35
Finding

Predictable Symlink-Following Audit Log Writes

Content
View full analysis

Vulnerability Details

File Location: scripts/dispatch.py, lines 35–37
Vulnerability Type: Symlink-following file overwrite and non-atomic audit-log creation
Risk Level: Medium

python
        record_path = os.path.join(DISPATCH_DIR, "{}.json".format(task_name))
        with open(record_path, "w") as f:
            json.dump(dispatch_record, f, indent=2)

Technical Analysis

The code constructs a predictable output filename from the validated task name and opens it using Python's "w" mode. Although task-name validation prevents path traversal, open(record_path, "w") follows symbolic links and truncates existing files. The implementation does not:

  • Reject symbolic links with O_NOFOLLOW.
  • Use exclusive creation with O_EXCL.
  • Verify the ownership and permissions of /var/log/compute/dispatched.
  • Create records atomically.
  • Preserve earlier records for repeated task names.

The fixed destination is under /var/log, so the script may be run with elevated privileges. If an attacker can modify the dispatch directory, a malicious symlink named after a valid task can redirect the write to another file accessible to the script's runtime account.

Attack Path

  1. The attacker obtains write access to /var/log/compute/dispatched, such as through unsafe ownership or group permissions in the deployment.
  2. The attacker creates a symbolic link such as valid-task.json in that directory, pointing to a target file.
  3. A schedule containing the valid task name valid-task is submitted or processed.
  4. The script opens the predictable path in "w" mode.
  5. The operating system follows the symbolic link and truncates or replaces the target's contents with the dispatch JSON record.

Exploitation therefore depends on the attacker being able to modify the dispatch directory and on the runtime account having write permission to the selected target.

Impact Assessment

A successful ...[truncated 525 chars]

Remediation
View remediation

Remediation Suggestions

  • Ensure /var/log/compute/dispatched is owned by the intended service account and is not writable by untrusted users or groups.
  • Open new records with os.open() using O_CREAT | O_EXCL | O_NOFOLLOW and a restrictive mode such as 0o600, then wrap the descriptor with os.fdopen().
  • Verify with lstat() or descriptor-based checks that the destination is a regular file and not a symbolic link.
  • Prefer unique, append-only record names containing a securely generated identifier or high-resolution timestamp so repeated task names cannot erase earlier audit evidence.
  • If records must be replaced, create a secure temporary file in the same trusted directory, flush and synchronize it, and perform an atomic replacement only after validating the destination policy.
  • Run the Skill under a dedicated least-privileged account whose filesystem permissions are limited to the dispatch-log directory.
  • Treat directory permission validation as a deployment requirement and fail closed if ownership or mode is unsafe.
Vulnerability Patterns
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (5)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The documented behavior claims task dispatch to worker nodes, but the described implementation appears limited to local log creation and marking tasks as dispatched. This mismatch can create integrity and operational security issues: operators may believe jobs were actually executed or sent to workers when only local records were written, enabling silent task loss, false audit trails, or workflow manipulation.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill indicates file-writing behavior but does not declare any tool scope or permissions boundaries. In an agent environment, undocumented write capability can lead to unauthorized filesystem changes, especially because the skill describes writing logs under a system path and changing task state.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The user-facing title and instructions are entirely in Chinese, while the file provides no indication that language selection is optional or that the skill is intentionally restricted to a Chinese-speaking context. This can violate language/locale policy where users are not given an explicit choice or opt-in.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

The skill omits a warning that it writes dispatch records to a system log directory and changes task state. Missing disclosure reduces informed consent and can cause unintended persistence or state mutation, which matters in administrative contexts where audit logs and task status are security-relevant artifacts.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

This code creates a directory and writes JSON dispatch records to disk, but it provides no confirmation prompt, log message, comment, or docstring disclosing that it modifies the filesystem. For a code file, silent file creation and writes are safety-relevant operations that should be surfaced to the user unless clearly disclosed elsewhere in the skill.

Content

No source excerpt is available for this finding.