T05 · Unauthorized Access and Privilege Escalation
- Location
SKILL.md:4- Finding
Excessive Agent Tool Permissions Violate Least Privilege
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:4
Vulnerability Type: Excessive tool permissions
Risk Level: MediumVulnerable configuration:
yaml allowed-tools: "Read Write Bash Edit"Technical Analysis
The skill requests unrestricted
Read,Write,Bash, andEditcapabilities even though its implemented functionality only performs deterministic data formatting and prints CLI status. In particular, no legitimate operation inscripts/main.pyrequires shell command execution or modification of existing project files.Granting
BashandEditexpands the agent's authority beyond the task's functional requirements. If attacker-controlled content, a malicious patient record, or a later prompt successfully influences the agent, these capabilities could be used to run local commands or modify files accessible to the agent. This is a least-privilege violation rather than evidence that the current script itself executes malicious commands.Attack Path
- A user loads the skill, causing the agent to receive all declared tool permissions.
- The agent processes attacker-controlled instructions or untrusted clinical content.
- The malicious content induces the agent to invoke
Bash,Write, orEdit. - Commands execute or files are modified under the privileges of the agent process.
- The resulting scope depends on the filesystem access and operating-system privileges granted to that process.
Impact Assessment
Successful exploitation could permit command execution and arbitrary modification of files available to the agent. It could affect project files and other writable locations in the runtime environment. This declaration does not independently provide operating-system privilege escalation, and no direct exploitation mechanism is implemented in the audited Python code.
- Remediation
View remediation
Remediation Suggestions
- Remove
BashandEditfromallowed-tools. - Grant
Readonly for explicitly required templates and reference data. - If document export is implemented, grant
Writeonly for a dedicated output directory. - Enforce path allowlists and reject traversal outside the designated workspace.
- Require explicit user confirmation before overwriting an existing discharge document.
- Treat patient records and reference documents as untrusted data rather than executable instructions.
- Remove
