T09 · Insecure Skill Coding Practices
- Location
scripts/sync.py:54- Finding
Overlapping Synchronization Paths Can Delete Source Data
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This file-management skill is not clearly malicious, but it can perform broad file moves, overwrites, and permanent deletions with weaker safeguards than its documentation promises.
Install only if you are comfortable reviewing every planned file operation first. Avoid running it on broad directories such as a home folder, do not use mirror/delete or scheduled examples until you have backups, and treat --execute, --delete, --move, and --no-confirm as high-risk options.
scripts/sync.py:54Overlapping Synchronization Paths Can Delete Source Data
scripts/batch_rename.py:83Generated Rename Paths Permit Directory Escape and Destination Collisions
scripts/organize.py:84Recursive Organization Can Overwrite Same-Named Files and Reprocess Output
SKILL.md:126Documented Confirmation and Audit Logging Controls Are Not Implemented
references/best_practices.md:66Optional Scheduled Organization Guidance Enables Unattended Risky File Mutation
requirements.txt:1Unused Dependencies Are Installed Without Reproducible Version Pinning
代码的实际功能较窄,核心且几乎唯一的能力是批量重命名文件。虽然“文件重命名”属于声明描述中的一个子项,因此并非完全不相关,但声明将技能表述为覆盖多种文件管理任务的综合助手,而代码没有实现智能分类、重复文件检测/清理、目录同步或其他文件管理能力。这属于描述范围明显大于实际行为、主用途被夸大的情况。未发现与文件重命名无关的隐藏行为,也未见网络访问、外部资源访问或其他未声明的敏感能力。
The supplied code is narrowly focused on directory synchronization. It calculates file hashes, compares source and target trees, previews copy/update/delete actions, and executes one-way mirror sync when requested. This partially overlaps with the declared description because directory synchronization is explicitly mentioned. However, the broader declared purpose presents the skill as a comprehensive file-management assistant handling bulk operations, intelligent classification, duplicate cleanup, renaming, and sync workflows. None of the classification, duplicate-cleaning, or renaming capabilities appear in this code chunk. Additionally, the code advertises a --bidirectional mode but the actual function only prints that the feature is under development, so true bidirectional synchronization is not implemented. Because the actual behavior is materially narrower than the declared description and one mentioned sync mode is unimplemented, this should be flagged as a mismatch.
Referenced artifact was not completely inspected
python scripts/sync.py <source> <target> --mirror
Referenced artifact was not completely inspected
python scripts/sync.py <source> <target> --mirror
Referenced artifact was not completely inspected
python scripts/sync.py <source> <target> --mirror
Referenced artifact was not completely inspected
python scripts/sync.py <source> <target> --mirror
The documented watch mode can execute arbitrary commands on file changes via an interpolated command string. That creates a command-execution surface far beyond ordinary file management, and if file paths or watched content can influence arguments, it can lead to arbitrary code execution or dangerous chained actions.
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
help='转换为大写')
parser.add_argument('--execute', action='store_true',
help='执行重命名 (默认仅预览)')
parser.add_argument('--no-confirm', action='store_true',
help='跳过确认')
args = parser.parse_args()
The skill documents file-modifying capabilities such as organize, rename, deduplicate, sync, and watch-triggered actions, but does not declare any tool scope or permission boundaries. In an agent ecosystem, missing explicit file-write restrictions increases the risk of unintended or overbroad filesystem access and makes review and enforcement harder.
The activation language is broad enough to match many ordinary file-related requests, which can cause the skill to trigger in situations where users did not intend destructive automation. In a high-impact domain like filesystem operations, overbroad routing increases the chance of unsafe invocation and excessive privilege use.
The documentation includes deletion and movement of files without prominent, repeated warnings about permanence, scope, and backup expectations. For a batch file-management skill, understated risk messaging can directly contribute to accidental data loss when users copy examples verbatim.
The skill claims modification operations default to dry-run, but the examples show direct modifying and destructive commands without an explicit preview or confirmation step. This inconsistency can cause operators or agents to execute irreversible file changes under false safety assumptions.
The safety section says deletion should prefer quarantine, yet the deduplication examples normalize direct deletion. In a file-management context this increases the chance of permanent data loss, especially because deduplication mistakes can affect irreplaceable user files at scale.
The markdown provides backup commands using --mirror --execute, which can delete files in the destination to match the source, but it does not warn users about destructive synchronization behavior or the need to test first. In a file-management skill, users are more likely to copy these commands directly, increasing the chance of accidental data loss from routine automation.
The scheduled organization example runs automatically and includes --execute --move, which can relocate files every hour without any notice about workflow disruption, misclassification, or loss of expected file locations. Because this skill is specifically for automating file operations, such an example can cause unintended user-impact at scale if adopted without safeguards.
This backup example again recommends --mirror --execute for daily synchronization without any safety disclosure, despite mirror operations potentially propagating mistakes or deleting files from the backup target. In the context of a file-manager skill, the omission is more dangerous because users may trust the example as a best practice and deploy it unattended.
This code file contains natural-language descriptions, help text, and prompts that force a specific language/locale for all users. The policy only permits such constraints when the skill offers user opt-in or clearly documents a justified region-specific limitation, which is not present here.
Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.
help='转换为大写')
parser.add_argument('--execute', action='store_true',
help='执行重命名 (默认仅预览)')
parser.add_argument('--no-confirm', action='store_true',
help='跳过确认')
args = parser.parse_args()
This code file contains natural-language descriptions and user-facing messages entirely in Chinese, including the module docstring and CLI help/output text. Under the policy rule, forcing a specific language without user opt-in is a locale-policy violation unless the restriction is clearly justified, which is not documented here.
This code file contains user-facing natural-language documentation that assumes a specific language, which can violate language/locale policy when no user opt-in or justification is provided. The same pattern continues in user-facing CLI messages, but the module docstring is sufficient to establish the issue.
The module docstring states '支持单向镜像同步和双向同步', which communicates that both one-way mirror sync and bidirectional sync are implemented. However, the sync_bidirectional function later only prints placeholder messages indicating the feature is not available, so the documentation materially overstates the tool's actual behavior.
The file’s natural-language interface and documentation are entirely in Chinese, beginning with the module docstring and continuing through user-facing output. Under the stated policy, forcing a specific language without opt-in is a locale-policy violation unless the constraint is explicitly justified or alternatives are offered.
The --bidirectional argument help text presents bidirectional sync as an available mode. In practice, selecting that mode only triggers informational messages from sync_bidirectional that the feature is still under development, which contradicts the user-facing documentation embedded in the code.
The file's descriptive and instructional natural-language content is presented in Chinese throughout, with no indication that users can choose another language or that the locale restriction is intentional for a region-specific skill. This may violate language or locale policy where user-facing skills should not force a specific language without opt-in.
The dependency is specified with a lower-bound only (tqdm>=4.60.0), which allows any newer release to be installed. This creates supply-chain risk because builds are not reproducible and a future compromised or breaking version could be pulled in without review; in a file-management skill, that dependency may run in environments with broad filesystem access, increasing the blast radius.
# File Manager Skill Dependencies
# 进度条显示
tqdm>=4.60.0
# Windows 彩色输出支持
colorama>=0.4.4
No suspicious patterns detected.