Back to skill

Security audit

dir-organizer

Security checks for vulnerabilities and agentic risk

Overview

This is a local directory organizer, but its install instructions and file-moving behavior create review-worthy risk before use.

Review the script before installing globally. Prefer a pinned commit or local manual install, run dry-run first, back up important folders, and do not use --apply on directories where category subfolders may already contain files with the same names.

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

Warning
Location
scripts/dir_organizer.py:40
Finding
Destination Collision Can Cause Existing Files to Be Overwritten## Vulnerability Details **File Location**: `scripts/dir_organizer.py:40-43` **Vulnerability Type**: Unsafe file move without collision protection **Risk Level**: Medium **Vulnerable Code**: ```python if a.apply: for src, dst in plan: os.makedirs(os.path.dirname(dst), exist_ok=True) shutil.move(src, dst); moved += 1 ``` ### Technical Analysis The destination path is derived from the source filename and category, but the implementation does not test whether that path already exists before calling `shutil.move`. On platforms where the underlying rename operation replaces an existing destination file, such as typical same-filesystem POSIX behavior, the existing categorized file may be silently overwritten. Other platforms may reject the operation, but because exceptions are not handled, such a failure can terminate execution after some earlier files have already been moved. The dry-run output also does not identify collisions, so users cannot reliably detect this condition before applying the plan. ### Attack Path 1. A directory contains a root-level file named `report.pdf`. 2. Its generated destination is `<target>/文档/report.pdf`. 3. A file already exists at that destination. 4. The user reviews the dry-run, which reports the intended category but does not warn about the collision. 5. The user executes the organizer with `--apply`. 6. On a platform permitting replacement, the root-level file replaces the existing destination file. On a platform rejecting replacement, execution may stop after partially applying the organization plan. ### Impact Assessment Exploitation requires the ability to create or influence filenames in the selected directory, or an accidental preexisting filename collision. No additional system privileges are obtained. The impact is confined to files writable by the user running the Skill, but it can include permanent loss of existing local data and a partially compl ...[truncated 30 chars]
Remediation
## Remediation Suggestions - Check `os.path.lexists(dst)` before every move. - Treat collisions as findings during dry-run and display the conflicting source and destination paths. - Refuse to overwrite existing files by default. - If collision handling is required, provide explicit policies such as `--on-conflict skip`, `--on-conflict rename`, or `--on-conflict overwrite`. - Require a separate, explicit confirmation flag for destructive overwrite behavior. - Catch filesystem exceptions per file and return a nonzero exit status with a structured error report. - Consider validating the complete plan before moving any files to reduce partial execution. - Add tests covering collisions, symbolic links, cross-filesystem moves, and platform-specific destination behavior.

T08 · Insecure Dependencies

Warning
Location
SKILL.md:77
Finding
Installation Instructions Execute Unpinned Third-Party Content## Vulnerability Details **File Location**: `SKILL.md:77-79` **Vulnerability Type**: Unpinned package and repository installation **Risk Level**: Medium **Vulnerable Code**: ```bash # One-command installation using the skills CLI npx skills add zhaoxinghua09-cell/agent-skills -g ``` ### Technical Analysis The documented installation command invokes `npx` without pinning the `skills` package to a reviewed version. Depending on the local npm configuration and cache state, `npx` may retrieve and execute the current package release from the package registry. The repository argument is also not pinned to a commit or immutable release identifier. Consequently, both the installer implementation and installed Skill content may differ from the versions reviewed during this audit. The global installation option increases the persistence and scope of any compromised content placed in the user's Agent Skill directories. ### Attack Path 1. An attacker compromises the package registry account, the `skills` package, the referenced repository, or an associated release process. 2. The attacker publishes a malicious package version or modifies the repository content. 3. A user follows the documented `npx skills add ... -g` instruction. 4. `npx` retrieves and executes the unpinned installer package with the user's privileges. 5. The installer executes attacker-controlled package lifecycle or CLI code, or installs modified Skill files that are later trusted and loaded by supported Agents. ### Impact Assessment Successful exploitation can run code with the privileges of the user executing the installation command. Depending on the compromised component, this may expose user-readable files, modify local configuration, install persistent malicious Skill instructions, or affect all Agent environments targeted by the global installation. The attack does not inherently grant administrative privileges unless the user runs the command from an e ...[truncated 16 chars]
Remediation
## Remediation Suggestions - Pin the CLI to an audited version, for example by using an exact package version rather than the latest available release. - Pin the repository to a specific reviewed commit or signed immutable release. - Publish and verify cryptographic checksums for distributed Skill packages. - Prefer a lockfile-backed or otherwise reproducible installation process. - Avoid global installation unless it is required; document the exact files and directories the installer modifies. - Recommend reviewing downloaded content before enabling it in an Agent environment. - Use signed releases and protected publishing workflows for both the package and repository.
Vulnerability Patterns
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • 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)

Vague Triggers

Medium
Confidence
91% confidence
Finding
The phrase "One command for daily file/text chores" is very broad and does not clearly constrain what kinds of requests should activate this skill versus other utilities. Because it overlaps with common, generic user intents around files and text, it risks unintended invocation without explicit trigger boundaries or negative examples.

Lp3

Medium
Category
MCP Least Privilege
Confidence
81% confidence
Finding
The skill describes file-system operations and explicitly instructs copying the skill into agent skill directories, but it does not declare a scoped permissions or allowed-tools section. In an agent setting, missing tool-scope declarations can lead to broader-than-expected file access, making it harder to enforce least privilege and increasing the chance of unintended reads from local files.

Rp1

Medium
Category
MCP Rug Pull
Confidence
88% confidence
Finding
The installation instruction uses an unpinned 'npx skills' invocation, which can fetch and execute whatever version is currently published. This creates a supply-chain risk: a compromised or changed package could run unexpected code during installation or setup.

Natural-Language Policy Violations

Medium
Confidence
97% confidence
Finding
This file contains natural-language category names and CLI/help text in Chinese, which effectively forces a specific language for users. The policy allows locale constraints only when users are given a choice or the regional/language restriction is clearly justified, neither of which is present here.

Natural-Language Policy Violations

Low
Confidence
64% confidence
Finding
This file mixes Chinese and English throughout the user-facing instructions, but does not state whether the user can choose a preferred language or locale. That can be read as imposing a presentation language policy without explicit opt-in, which is the type of natural-language locale concern covered by this rule.

Description-Behavior Mismatch

Low
Confidence
79% confidence
Finding
The manifest describes a folder organizer that classifies files by extension into category subdirectories. README line L07 instead describes the tool as handling general 'file/text chores,' which materially broadens the implied behavior beyond directory organization and could mislead users about the skill's intended scope.

Static analysis

No suspicious patterns detected.