Back to skill

Security audit

Pilot Chunk Transfer

Security checks for vulnerabilities and agentic risk

Overview

This file-transfer skill has a coherent purpose, but its documented receive commands can let incoming messages write or delete files outside the intended folder and its promised verification is not actually implemented.

Review carefully before installing. Do not use this skill as written with untrusted senders or important local files; it should validate filenames, use private temporary directories, avoid rm -rf on remote-derived paths, and implement real checksum and resume handling first.

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

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:78
Finding

Receiver-Controlled Path Traversal Enables Arbitrary File Write and Recursive Deletion

Content
View full analysis
"$RECV_DIR/$FILENAME" rm -rf "$RECV_DIR/$FILENAME.chunks" echo "Reassembled: $RECV_DIR/$FILENAME" ``` ### Technical Analysis The `filename` field is read directly from an inbox message and incorporated into filesystem paths without validation or canonicalization. Shell quoting prevents word splitting and wildcard expansion of the variable itself, but it does not prevent path traversal sequences such as `../`. The vulnerable value is used in three security-sensitive operations: 1. `mkdir -p` creates a chunk directory. 2. Output redirection writes the assembled file. 3. `rm -rf` recursively removes the derived chunk directory. The completion message independently supplies its own filename, and the code does not bind it to a previously validated transfer record. Consequently, an attacker who can deliver a crafted inbox message can select paths outside `$RECV_DIR`, subject to the receiving process's filesystem permissions. ### Attack Path 1. An attacker sends a `chunk_transfer_start` message whose `filename` contains traversal components, such as `../../target`. 2. The receiver evaluates: ```bash mkdir -p "$RECV_DIR/../../target.chunks" ``` creating a directory outside the intended receiving directory. 3. The attacker arranges for chunk files to be present in the selected chunk directory through ...[truncated 778 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:54
Finding

Predictable Shared Temporary Files Permit Symlink-Based File Overwrite

Content
View full analysis
/dev/null > "/tmp/chunk_$i.dat" CHUNK_HASH=$(md5sum "/tmp/chunk_$i.dat" | cut -d' ' -f1) pilotctl --json send-message "$DEST" \ --data "{\"type\":\"chunk_metadata\",\"chunk_id\":$i,\"hash\":\"$CHUNK_HASH\"}" pilotctl --json send-file "$DEST" "/tmp/chunk_$i.dat" rm "/tmp/chunk_$i.dat" done ``` A second predictable shared path is also declared at line 101: ```bash STATE_FILE="/tmp/transfer_state.json" ``` ### Technical Analysis Chunk files are written under globally predictable names such as `/tmp/chunk_0.dat`. In a shared temporary directory, another local user or process can pre-create one of these names as a symbolic link. Shell output redirection follows symbolic links. Therefore, the following operation can truncate and overwrite the symlink target using data from the source file: ```bash dd ... > "/tmp/chunk_$i.dat" ``` The fixed names also allow concurrent transfers to overwrite, hash, transmit, or delete one another's chunks. The predictable state-file path creates a similar collision risk if the incomplete resume implementation later writes to it without secure creation. ### Attack Path 1. A local attacker predicts that the transfer starts with `/tmp/chunk_0.dat`. 2. Before the transfer begins, the attacker creates a symbolic link: ```bash ln -s /path/to/user-writable-victim /tmp/chunk_0.dat ``` 3. The victim invokes the documented chunk-transfer procedure. 4. Output redirection follows the symbolic link and truncates or overwrites the target with the first chunk of the selected source file. 5. The subsequent hash and send operations read from the linked target, potentially transmitting unintended target content if a race or targ ...[truncated 562 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:58
Finding

Chunk Integrity Verification Is Advertised but Not Implemented

Content
View full analysis
"$RECV_DIR/$FILENAME" rm -rf "$RECV_DIR/$FILENAME.chunks" echo "Reassembled: $RECV_DIR/$FILENAME" ;; ``` ### Technical Analysis The receiver stores the expected hash only in transient shell variables and never computes the digest of a received chunk or compares it with the expected value. It also does not verify: - That every expected chunk is present. - That chunk indexes are within the declared range. - That chunks are unique. - That the completion message corresponds to the established transfer. - That the final file matches a whole-file digest. - That metadata originated from an authenticated sender. MD5 is collision-weak and should not be used as the integrity primitive for a new transfer design. In addition, sending the digest through the same unauthenticated channel as the data does not establish authenticity. The `chunk_*` glob is ordered lexicographically by the shell. Without zero-padded indexes, a name such as `chunk_10` can be concatenated before `chunk_2`, corrupting transfers containing at least 11 chunks. ### Attack Path 1. A transfer is initiated with metadata declar ...[truncated 937 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (6)

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill claims per-chunk integrity verification, but the receive path never checks the received chunk contents against the advertised hash before reassembly. An attacker or corrupted transport can therefore inject or alter chunks and still produce a reassembled file that appears successful, defeating the core security property promised by the skill.

Content

No source excerpt is available for this finding.

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
85% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

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

md
--data "{\"type\":\"chunk_metadata\",\"chunk_id\":$i,\"hash\":\"$CHUNK_HASH\"}"

  pilotctl --json send-file "$DEST" "/tmp/chunk_$i.dat"
  rm "/tmp/chunk_$i.dat"
done

# Send completion

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The inline comment explicitly states that chunk hashes are verified after receipt, but no such logic exists. This creates a misleading safety signal that may cause operators to trust transferred files that were never authenticated for integrity.

Content

No source excerpt is available for this finding.

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
97% confidence
Finding

The code builds a deletion path from FILENAME received from messages and then runs rm -rf on "$RECV_DIR/$FILENAME.chunks" without sanitizing or constraining that value. A malicious sender can supply path traversal sequences or crafted names so cleanup deletes directories outside the intended receive area, making this a dangerous arbitrary path deletion issue.

Content

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

md
chunk_transfer_complete)
      FILENAME=$(echo "$msg" | jq -r '.filename')
      cat "$RECV_DIR/$FILENAME.chunks"/chunk_* > "$RECV_DIR/$FILENAME"
      rm -rf "$RECV_DIR/$FILENAME.chunks"
      echo "Reassembled: $RECV_DIR/$FILENAME"
      ;;
  esac

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill advertises resume capability, but only shows a placeholder state-file snippet and does not update transfer state after each chunk or integrate resume into the send loop. This can mislead users into relying on fault tolerance that does not exist, causing incomplete or inconsistent transfers and possible data corruption when interrupted operations are assumed resumable.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

This markdown file documents sending files and metadata to a destination via pilotctl send-message and send-file, writes received data under $HOME/.pilot/chunk-recv, and deletes temporary or chunk directories. While these actions are central to the skill, the description does not include a clear user-facing warning about transmitting file contents/metadata off-system or about local reassembly and cleanup operations that affect user data and system state.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.