T09 · Insecure Skill Coding Practices
- Location
SKILL.md:27- Finding
Arbitrary Command Execution Through Executable .env Loading
- Content
View full analysis
/dev/null || true COOKIE_FILE="/tmp/qb_cookies.txt" ``` ### Technical Analysis The documented workflow loads `.env` with the shell built-in `source`. A sourced file is treated as executable shell code rather than as an inert collection of configuration values. Because the skill instructs the agent to check and use a `.env` file from the current project directory, an attacker who controls that project can add arbitrary shell commands to the file. Those commands execute with the same operating-system identity and permissions as the agent or user following the workflow. Redirecting errors to `/dev/null` and appending `|| true` can also obscure indicators that malicious or malformed commands ran. ### Attack Path 1. An attacker supplies or modifies a project containing a `.env` file. 2. The file includes expected qBittorrent variables so that it appears legitimate, followed by arbitrary shell commands. 3. A user asks the agent to perform a qBittorrent API operation. 4. The agent follows the documented authentication workflow and executes `source .env`. 5. The attacker's commands execute with the agent process's permissions before the API operation occurs. ### Impact Assessment Successful exploitation provides arbitrary command execution under the account running the skill. The attacker could read or modify files accessible to that account, steal environment variables and credentials, alter project content, invoke network utilities, or execute additional local payloads. The vulnerability does not independently grant root privileges, but its scope includes everything available to the affected user account. ]]>- Remediation
View remediation
