T05 · Unauthorized Access and Privilege Escalation
- Location
SKILL.md:16- Finding
Excessive and Ambiguous Tool Permissions Violate Least Privilege
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 16-23
Vulnerability Type: Excessive tool permissions and ambiguous configuration
Risk Level: MediumVulnerable Code
yaml tools: - - read - exec homepage: https://skillhub.cn pricing_tier: L2 pricing_model: per_use suggested_price: 19.9 tools: ["read", "write", "exec"]Technical Analysis
The skill declares the
toolskey twice. The first declaration requestsreadandexec, while the second requestsread,write, andexec. Duplicate YAML keys are handled inconsistently: some parsers reject them, while others silently retain the last value. In parsers that apply last-key-wins behavior, the skill receives all three capabilities, including filesystem write access.The documented purpose is parsing, flattening, extracting, and validating JSON. Although reading a user-selected file and invoking a constrained parser may support that purpose, the documentation does not identify a legitimate requirement for unrestricted filesystem writes. General-purpose command execution is also broader than necessary when the operation can be implemented through a fixed, reviewed parser or a constrained runtime interface.
The package contains no parser implementation or executable script, so the agent is expected to translate the Markdown instructions into commands dynamically. This increases the security significance of broad
execpermissions because there is no bundled implementation that constrains executable operations or validates arguments.Attack Path
- The skill is loaded by an agent platform that interprets the final
toolsdeclaration and grantsread,write, andexec. - A user supplies an untrusted JSON file, path, or parsing request containing instructions or content intended to influence the agent's command construction.
- Because the skill provides no fixed parser implementation, the agent dynamically creates shel ...[truncated 1279 chars]
- The skill is loaded by an agent platform that interprets the final
- Remediation
View remediation
Remediation Suggestions
- Define the
toolskey exactly once so permission handling is deterministic across YAML parsers. - Remove
writeunless a specific documented feature requires file output. - Replace unrestricted
execwith a dedicated JSON-parsing tool or a bundled, reviewed script exposed through a constrained interface. - If command execution is unavoidable, restrict it to an allowlisted executable and fixed operation modes. Pass JSON input through standard input or safely encoded arguments rather than interpolating it into shell commands.
- Limit file reads to paths explicitly selected by the user and enforce canonical-path checks against an approved workspace.
- Run parsing in a sandbox with resource limits, no network access, a read-only filesystem where possible, and no access to secrets or sensitive host directories.
- Validate the skill manifest in continuous integration and reject duplicate YAML keys or permissions not mapped to documented functionality.
- Add a concrete parser implementation with tests for malicious filenames, oversized input, deeply nested JSON, and shell metacharacters.
- Define the
