Back to skill

Security audit

Dandan File Organizer

Security checks for vulnerabilities and agentic risk

Overview

This is a disclosed file organizer skill whose local file listing and moving are purpose-aligned, but users should confirm the plan and collision-safe moves before allowing changes.

Install only if you want a Chinese-language desktop or folder organizer with local file access. Before approving any move plan, review the source and destination folders, make sure the agent uses collision-safe moves or auto-renaming, and avoid running it on folders containing irreplaceable or sensitive files without a backup.

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
SKILL.md:65
Finding

Unsafe File Move Can Overwrite Existing Destination Files

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 65–66
Vulnerability Type: Unsafe file operation resulting in unintended overwrite
Risk Level: Medium

bash
# Move file to category folder
mv ~/Desktop/report.pdf ~/Documents/报告/

Technical Analysis

The documented Unix mv command moves the source into an existing directory without enabling no-clobber behavior or checking for a filename collision. If the destination directory already contains report.pdf, standard mv behavior can replace that file without prompting.

This implementation conflicts with the Skill's stated no-overwrite guarantee, which promises automatic collision-safe renaming such as filename_1.pdf. The document does not provide logic that checks destination existence, generates a unique filename, or preserves the prior destination file.

Although the Skill proposes an operation log and rollback capability, recording the source and destination paths cannot recover the original contents of a destination file after those contents have been overwritten.

Attack Path

  1. The destination category directory already contains a file named report.pdf. This may occur naturally or may be deliberately arranged by a local user able to write to that directory.
  2. A different report.pdf exists in the source directory.
  3. The user approves the proposed organization operation.
  4. The agent follows the documented command:
    bash
    mv ~/Desktop/report.pdf ~/Documents/报告/
    
  5. The existing destination file is replaced by the source file.
  6. A later rollback can move the new file back, but it cannot restore the overwritten destination file because its original contents were not preserved.

Impact Assessment

Successful exploitation or accidental triggering can cause irreversible loss of an existing destination file. The impact is limited to files writable under the permissions of the account executing the Skill; this issue does not independently provide pri ...[truncated 350 chars]

Remediation
View remediation

Remediation Suggestions

Implement collision-safe moves rather than invoking plain mv:

  1. Resolve and validate the source and destination paths.
  2. Quote every path to prevent whitespace or shell metacharacters from changing command interpretation.
  3. Check whether the intended destination filename already exists.
  4. If a collision exists, generate a unique name such as report_1.pdf, incrementing the suffix until an unused path is found.
  5. Use no-clobber semantics such as mv -n -- "$source" "$destination" as a final defense against race-related replacement.
  6. Verify that the move succeeded before recording a done status.
  7. Record both the selected unique path and operation status in the rollback log.
  8. For stronger rollback guarantees, preserve destination files in a backup area before replacement; preferably, never replace them at all.
  9. Add tests covering duplicate filenames, hidden files, names with spaces, names beginning with hyphens, and concurrent destination creation.

A collision-safe shell pattern could use an existence loop followed by a no-clobber move:

bash
source="$HOME/Desktop/report.pdf"
directory="$HOME/Documents/报告"
name="report"
extension=".pdf"
destination="$directory/$name$extension"
counter=1

while [ -e "$destination" ]; do
  destination="$directory/${name}_${counter}${extension}"
  counter=$((counter + 1))
done

mv -n -- "$source" "$destination"
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (4)

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest description is entirely in Chinese and the skill examples, folder names, workflow, and output format all assume Chinese-language operation. There is no indication that users may choose another language or that the locale restriction is intentional and documented, which creates a language/locale policy concern.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The trigger phrases include broad, everyday expressions like '桌面太乱了' and '文件太多了', which can cause the skill to activate when the user is only complaining or speaking casually rather than explicitly requesting file operations. Because this skill can enumerate and reorganize local files, unintended activation increases the risk of privacy-impacting scans or confusing, unwanted file moves after follow-up prompts.

Content

No source excerpt is available for this finding.

File System Enumeration

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code scans file system directories looking for sensitive files. This could be reconnaissance for credential theft.

Content

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

macOS

bash
# 列出桌面文件
ls -la ~/Desktop/

# 移动文件到分类文件夹
mv ~/Desktop/report.pdf ~/Documents/报告/

File System Enumeration

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code scans file system directories looking for sensitive files. This could be reconnaissance for credential theft.

Content

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

macOS

bash
# 列出桌面文件
ls -la ~/Desktop/

# 移动文件到分类文件夹
mv ~/Desktop/report.pdf ~/Documents/报告/

Static analysis

No suspicious patterns detected.