T05 · Unauthorized Access and Privilege Escalation
- Location
SKILL.md:23- Finding
Overprivileged Tool Access for a DNS Lookup Skill
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 23-26
Vulnerability Type: Excessive tool permissions and violation of least privilege
Risk Level: MediumRelevant capability declarations (
SKILL.md, lines 23-26):yaml tools: - read - exec - writeRelated functionality advertised elsewhere (
SKILL.md, lines 162-166):markdown ## 主要功能 - **自动化执行**: 用bind-utils的dig把主机名解析为IP,排查域名。Resolve hostnames to IP addres - **文件处理**: 支持多种文件格式的读取、解析和写入操作 - **API集成**: 通过标准化接口调用外部服务并处理响应 - **命令执行**: 在安全沙箱中执行系统命令并收集结果Technical Analysis
The Skill's stated purpose is resolving hostnames through
dig. That task does not require unrestricted filesystem write access, and it ordinarily does not require general filesystem read access. If command execution is necessary, it should be narrowly limited to a fixeddigexecutable and validated DNS arguments.Instead, the manifest requests generic
read,write, andexectools. The document also advertises broad file processing, external API integration, and system-command execution. No command allowlist, filesystem boundary, network destination restriction, shell-metacharacter filtering, hostname validation, or approval requirement is specified.The input model accepts a free-form instruction:
markdown | instruction | string | 是 | 用户指令文本 |Because no implementation files exist, this audit cannot confirm that arbitrary commands or filesystem operations are actually executed. The confirmed issue is the excessive capability declaration and unsafe authorization design, not a demonstrated command-injection payload.
Attack Path
- An operator installs or invokes the Skill expecting only DNS resolution.
- The hosting Agent grants the declared
read,write, andexeccapabilities. - An attacker or untrusted user supplies a crafted free-form
instruction. - If the Agent interprets that instruction using the ...[truncated 1046 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove the
readandwritetools because they are not necessary for hostname resolution. - Prefer a dedicated DNS-resolution API over general command execution.
- If
execmust remain available, enforce an executable allowlist containing only the absolute path todig. - Pass arguments directly to the process API without invoking a shell.
- Validate hostnames using a strict DNS-name parser and permit only an explicit allowlist of record types.
- Reject shell metacharacters, option injection, arbitrary resolver addresses, and unsupported
digflags. - Apply query-count, timeout, output-size, and concurrency limits.
- Restrict outbound network access to approved DNS resolvers where operationally feasible.
- Require explicit user approval for any operation outside a DNS query.
- Align the documentation with the Skill's actual purpose by removing claims of generic file processing, API integration, and command execution.
- Add tests confirming that crafted instructions cannot trigger filesystem access or commands other than the approved DNS operation.
- Remove the
