T09 · Insecure Skill Coding Practices
- Location
scripts/install-ecc-bundle.py:106- Finding
Uninstall Recursively Deletes Unverified Skill Directories
- Content
View full analysis
Vulnerability Details
File Location:
scripts/install-ecc-bundle.py, lines 106-112
Vulnerability Type: Missing ownership validation before recursive deletion
Risk Level: HighVulnerable Code
python for skill_name in SKILLS: dst = target / skill_name / "SKILL.md" if dst.exists(): if not dry_run: # 删除整个目录 skill_dir = target / skill_name if skill_dir.exists(): shutil.rmtree(skill_dir)Technical Analysis
The uninstaller treats the existence of a file named
SKILL.mdas sufficient proof that the entire parent directory belongs to this bundle. It then passes that directory toshutil.rmtree, recursively deleting every file and subdirectory it contains.No installation manifest, ownership marker, content hash, or record of files created by the installer is checked. The user-controlled
--targetargument also allows the operation to be directed at a non-default directory tree. Consequently, a directory that existed before installation, was installed by a different package, or accumulated unrelated files after installation can be deleted in full.This violates safe uninstall principles: an uninstaller should remove only artifacts whose ownership it can establish.
Attack Path
-
A target directory contains one of the hardcoded skill names, such as
security-review. -
That directory contains a
SKILL.md, whether created by this bundle, another installer, or the user. -
The same directory also contains unrelated files, custom configuration, or additional skill resources.
-
The user or an automated Agent invokes:
bash python scripts/install-ecc-bundle.py --target /chosen/path --uninstall -
The script finds the matching
SKILL.mdand recursively deletes the entire/chosen/path/security-reviewdirectory. -
All unrelated content under that directory is permanently removed without an ...[truncated 532 chars]
-
- Remediation
View remediation
Remediation Suggestions
- Create an installation manifest recording every path created by the installer, along with a bundle identifier and optional file hash.
- During uninstall, remove only files explicitly listed in that manifest.
- Remove a skill directory only after verifying that it is empty.
- Add a bundle-specific ownership marker inside each installed directory and validate it before deletion.
- Resolve and validate the target path before use, ensuring every deletion remains under the intended target root.
- Refuse uninstall when ownership cannot be established and report the directory for manual review.
- Add a confirmation step that lists exact paths scheduled for deletion.
- Preserve
--dry-runand recommend it before destructive operations. - Add tests covering pre-existing directories, unrelated files, custom targets, and partially modified installations.
