Back to skill

Security audit

Downloads Folder Organizer

Security checks for vulnerabilities and agentic risk

Overview

This Downloads organizer is review-worthy because it can move files using unvalidated plan paths and stores a persistent index of the target directory tree.

Review carefully before installing. Use only on a narrow Downloads and target directory, avoid enabling watch mode unless you want automatic moves, and do not pass edited or untrusted plan JSON to --execute. The publisher should add path containment checks, safer plan handling, and make indexing explicitly opt-in or narrower.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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)

T09 · Insecure Skill Coding Practices

Error
Location
organizer.py:210
Finding

Unvalidated Execution Plan Allows Arbitrary Filesystem Moves

Content
View full analysis
Dict: results = {"moved": [], "errors": []} log_lines = [f"# Organize log {datetime.now().strftime('%Y-%m-%d %H:%M:%S')}", ""] for item in plan: source = Path(item["source"]) target = Path(item["final_target"]) try: target.parent.mkdir(parents=True, exist_ok=True) shutil.move(str(source), str(target)) results["moved"].append({"from": str(source), "to": str(target)}) ``` The command-line handler passes decoded, caller-controlled JSON directly to this function: ```python if args.execute: plan = json.loads(args.execute) results = execute_plan(plan) update_index(config) print(json.dumps(results, ensure_ascii=False, indent=2)) return ``` The documented workflow explicitly permits modification of destination-related plan fields before execution: ```markdown - If the user requests **changes**: adjust the plan (modify `target_subdir` and `final_target` fields accordingly), show the updated table, and ask again Pass the (possibly modified) plan JSON back to the script: ```bash python3 ~/.claude/skills/organize/organizer.py --execute '' ``` ``` ### Technical Analysis `execute_plan()` treats the `source` and `final_target` fields in supplied JSON as trusted filesystem paths. It does not verify that: - The source is a regular file located directly inside the configured `downloads_dir`. - The destination is contained within the configured `target_root`. - The source and destination are free of symbolic-link redirection. - The destination does not already exist at execution time. - The plan was produced by the current invocation of `--scan`. - The d ...[truncated 2226 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Note
Location
SKILL.md:69
Finding

Watch Mode Uses an Unpinned Third-Party Dependency

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • 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
Findings (6)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The declared purpose is simple file organization, but the documented behavior expands into persistent directory monitoring, logging, full target-root indexing, and content inspection via file reads and external utilities. This mismatch is dangerous because users may consent to a narrow housekeeping task without realizing the skill also performs broader surveillance-like collection and persistence that exposes file metadata and possibly content.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill invokes a local Python script with shell commands and can read from Downloads, move files into other directories, and update logs/indexes, but it declares no explicit tool scope or permission boundaries. That omission increases the chance the agent executes broad file-system and shell actions without adequate user awareness or enforcement, which is a real security issue for a skill that performs writes and command execution.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

For a local file organizer, spawning an external command is not an obvious or necessary capability, especially since the manifest only describes organizing files into directories. This adds execution capability beyond straightforward file inspection and increases the skill's operational scope.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · organizer.py (reported line 101)May include surrounding context.

python
# Use `strings` for binary/PDF files
        import subprocess
        result = subprocess.run(
            ['strings', str(filepath)],
            capture_output=True, text=True, timeout=5
        )

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill exceeds its stated purpose by recursively indexing the entire configured target directory tree and writing that inventory into the skill directory. This creates a persistent catalog of filenames and folder structure that may expose sensitive local information unrelated to simply organizing Downloads files.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

Watch mode automatically moves newly created files from Downloads after a fixed delay without explicit confirmation or a startup safety acknowledgement. This can cause unintended relocation of files, interfere with user workflows or other software, and may move sensitive files immediately upon arrival before the user can review them.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.