Back to skill

Security audit

Smart File Organizer

Security checks for vulnerabilities and agentic risk

Overview

This file organizer is mostly coherent, but its custom pattern and undo features can move files outside the folder the user chose.

Review this skill before installing. Use --dry-run first, avoid running it on important folders without a backup, and do not use pattern rules containing absolute paths, '..', or nested path separators. Treat .organizer_log.json as sensitive because changing it can affect what --undo moves.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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
Findings (2)

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
main.py:27
Finding

Pattern Rules Permit File Moves Outside the Target Directory

Content
View full analysis
dict: if not s: return {} result = {} for part in s.split(","): if ":" in part: folder, pattern = part.split(":", 1) result[pattern.strip().lower()] = folder.strip() return result ``` ```python elif method == "pattern": name_lower = fp.stem.lower() folder = "Unmatched" for pat, fld in patterns.items(): if pat in name_lower: folder = fld break else: stats["errors"] += 1 continue dest_dir = target / folder dest_path = dest_dir / fp.name if dest_path.exists(): stem, suffix = fp.stem, fp.suffix c = 1 while dest_path.exists(): dest_path = dest_dir / f"{stem}_{c}{suffix}" c += 1 if dry_run: stats["details"].append(f"[DRY] {fp.name} -> {folder}/") else: dest_dir.mkdir(parents=True, exist_ok=True) shutil.move(str(fp), str(dest_path)) ``` ### Technical Analysis The folder parsed from the `--patterns` argument is used directly as part of the destination path. The implementation does not reject: - Absolute paths - `..` parent-directory components - Paths that resolve through symbolic links outside the selected directory - Other destination values that escape the intended organization root In `pathlib`, joining a base path with an absolute path discards the base path. Relative paths containing `..` can similarly resolve outside the target directory. Consequently, `dest_dir.mkdir()` and `shutil.move()` can operate anywhere writable by the current process. The parser also reverses the documented `keyword:folder` format. It treats the text before the colon as the destination folder and the text after it as the filename pattern. This inconsistency increases the likelihood of une ...[truncated 1482 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
main.py:90
Finding

Untrusted Undo Log Allows Filesystem Path Traversal

Content
View full analysis
") if len(parts) == 2: fname, folder = parts[0], parts[1].rstrip("/") moved = target / folder / fname original = target / fname if moved.exists(): shutil.move(str(moved), str(original)) undone += 1 print(f"Restored: {fname}") ``` ### Technical Analysis The undo operation treats `.organizer_log.json` as trusted input. It parses human-readable detail strings and uses the extracted `fname` and `folder` values to construct filesystem paths without validating their types or locations. Both values may contain absolute paths or parent-directory components. As a result, either `moved` or `original` can resolve outside `target`. A log file planted or modified by another local process can therefore cause `--undo` to move files that were not moved by the organizer. The log has no integrity protection, and its free-form display-string format is not a safe representation of security-sensitive source and destination paths. ### Attack Path 1. An attacker gains the ability to create or replace `.organizer_log.json` in a directory that a user will select as the target. 2. The attacker inserts a crafted successful-operation entry. For example: ```json { "details": [ "payload.txt -> ../../attacker-controlled/" ] } ``` 3. The attacker places `payload.txt` a ...[truncated 1248 chars]
Remediation
View remediation
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 (6)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The README provides copy-pasteable commands that operate on a real directory and states the tool will 'organize' folders, but it does not clearly warn that files and folders will be moved or renamed. Users may run the non-dry-run example first and unintentionally alter important data, increasing the risk of accidental data disruption or difficult recovery.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill documentation does not clearly warn users that normal operation will move files and alter folder hierarchy, which is a material side effect. Without an explicit warning, users may invoke the skill expecting analysis only and unintentionally permit destructive or difficult-to-reverse organization changes.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger phrases are broad enough to match ordinary file-management requests, which can cause the skill to activate in situations where the user did not explicitly intend bulk file reorganization. Because this skill moves files and changes directory structure, accidental invocation increases the risk of unintended filesystem modifications and user confusion.

Content

No source excerpt is available for this finding.

Ae4

Medium
Category
analysis-evasion
Confidence
80% confidence
Finding

Suspicious Unicode normalization or mixed-script content

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The user-facing documentation is entirely in Chinese, and there is no indication that the skill is region-specific or that other language options are available. This can violate language/locale policy when a specific language is imposed without user opt-in or justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

Most of the user-facing instructions and feature descriptions are presented only in Chinese, while the file metadata is partly in English. This creates a language policy issue because the skill does not offer users a choice of language or explain that it is intended only for a Chinese-speaking audience.

Content

No source excerpt is available for this finding.