T09 · Insecure Skill Coding Practices
- Location
SKILL.md:94- Finding
Peer-Controlled Path Traversal Enables Arbitrary File Deletion
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 94–98
Vulnerability Type: Path traversal leading to arbitrary file deletion
Risk Level: Highbash file_removed) FILENAME=$(echo "$event" | jq -r '.filename') rm -f "$DROPBOX_DIR/$FILENAME" ;;Technical Analysis
The
filenamevalue is extracted from a remotely received pub/sub event and appended directly toDROPBOX_DIR. Although the resulting shell argument is quoted, quoting only prevents shell word splitting and wildcard expansion; it does not prevent filesystem path traversal.A malicious peer can provide a filename containing parent-directory components, such as
../../.ssh/authorized_keys. The resulting path may resolve outside the intended shared directory:text $HOME/pilot-dropbox/../../.ssh/authorized_keysThe implementation does not reject absolute paths, directory separators,
..components, or filenames that resolve outside the canonical shared-folder path. It also does not demonstrate authentication or authorization checks that restrict which publishers may issue deletion events.Attack Path
- The victim starts the documented shared-folder daemon and subscribes to a topic through
pilotctl. - An attacker who can publish events to that topic sends a
file_removedevent. - The attacker sets the event's
filenamefield to a traversal path such as../../target-file. - The daemon concatenates that value with
DROPBOX_DIRwithout validating the resolved path. rm -fdeletes the selected file if it is writable by the daemon's operating-system account.
Impact Assessment
A malicious peer may delete files outside the synchronized folder. The accessible scope is limited to files writable by the user account running the daemon, but may include user configuration, SSH authorization data, application state, Agent data, and other important files.
Successful exploitation can cause ...[truncated 191 chars]
- The victim starts the documented shared-folder daemon and subscribes to a topic through
- Remediation
View remediation
Remediation Suggestions
- Treat every filename received from a peer as untrusted.
- Reject empty names, absolute paths,
.and..components, directory separators, and any value that differs from its basename. - Canonicalize both the shared-folder root and candidate path, then verify that the candidate remains strictly beneath the canonical shared-folder root before deletion.
- Perform validation immediately before the filesystem operation to minimize validation/use inconsistencies.
- Maintain an allowlist or synchronization manifest of files that remote peers are permitted to delete.
- Authenticate event publishers and authorize deletion operations on a per-peer and per-folder basis.
- Consider moving deleted files to a controlled quarantine or trash directory rather than permanently deleting them immediately.
- Record the authenticated peer identity, validated path, and deletion result in an audit log.
