T05 · Unauthorized Access and Privilege Escalation
- Location
SKILL.md:5- Finding
Unnecessary General-Purpose Command Execution Permission
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 5-18
Vulnerability Type: Excessive tool permissions and violation of least privilege
Risk Level: MediumVulnerable Code
yaml allowed-tools: read exec compatibility: "Requires LLM with tool-use capability" metadata: displayName: "游戏资产生成-免费版" version: "1.0.0" summary: "轻量级2D游戏资产生成工具,支持角色设计、精灵图与瓦片集,保持风格一致。" tags: - "Creative" - "GameDev" - "2D" source: "SkillHub" converted_at: "2026-07-22T17:58:36" tools: - exec - readThe document also acknowledges the command-execution risk at lines 377-380:
markdown | Risk Type | Preventive Measure | |----------|---------| | API key leakage | Configure through environment variables; never hardcode keys in code or configuration files | | Command execution risk | Execute only allowlisted commands and avoid concatenating user input into command-line arguments | | Network communication security | Use HTTPS and validate SSL certificates |However, the package does not define or implement an enforceable command allowlist.
Technical Analysis
The Skill grants the Agent access to the general-purpose
exectool even though its demonstrated functionality consists primarily of constructing natural-language prompts for 2D game assets. The concrete shell examples only print text, and the error-handling section suggests runningping. Neither function requires unrestricted command execution.General-purpose shell access substantially expands the Skill's effective authority. Depending on the hosting Agent's sandbox and operating-system permissions,
execmay provide access to local files, environment variables, processes, installed utilities, and network-capable commands. A textual recommendation to use an allowlist does not enforce that restriction at runtime.No directly malicious command, command-injection implementation, credential-stealing log ...[truncated 1790 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove
execfrom bothallowed-toolsandtoolsbecause the documented prompt-generation workflow does not require arbitrary command execution. - Retain only the minimum tool permissions needed for the Skill, such as read-only access where genuinely required.
- Replace shell-based examples that merely print text with plain Markdown examples or Agent-generated text.
- If network diagnostics are essential, provide a narrowly scoped diagnostic tool rather than access to a shell.
- Enforce a fixed command allowlist in code or platform policy; do not rely on textual instructions in
SKILL.md. - Validate every argument against a strict schema. Reject shell metacharacters, redirections, command substitutions, additional commands, and untrusted hostnames.
- Execute any indispensable command in a restricted sandbox with minimal filesystem access, no inherited secrets, limited network access, resource limits, and a non-privileged identity.
- Require explicit user approval before executing commands that affect files, processes, or network resources.
- Add tests confirming that unexpected commands and attacker-controlled arguments are denied.
- Remove
