T09 · Insecure Skill Coding Practices
- Location
rollbar.sh:158- Finding
Arbitrary Shell Execution Through Workspace .env File
- Content
View full analysis
/dev/null || true ``` ### Technical Analysis The script uses Bash `source` to load `$PWD/.env`. This treats the entire file as executable shell code rather than parsing it as a data file containing only `ROLLBAR_ACCESS_TOKEN`. Consequently, command substitutions, shell functions, external commands, redirections, and other Bash syntax in `.env` execute with the privileges of the user or Agent running `rollbar.sh`. The suppression of standard error does not prevent execution and may conceal evidence that malicious commands ran. The documented functionality only requires reading a single variable, so executing arbitrary contents of the file violates the principle of least privilege. ### Attack Path 1. An attacker gains the ability to add or modify `.env` in the directory from which the Skill is invoked. This may occur through a malicious repository, compromised workspace artifact, or untrusted project contribution. 2. The attacker inserts executable shell syntax into `.env`. 3. A user or Agent invokes any `rollbar.sh` command, including a read-only operation such as `items`. 4. Before the Rollbar request is performed, line 158 sources `.env`. 5. The attacker's shell commands execute under the identity and permissions of the Skill process. No `--yes` confirmation is required because this execution occurs during credential initialization, before command-specific safety checks. ### Impact Assessment Successful exploitation provides arbitrary command execution with the privileges of the user or Agent invoking the Skill. Depending on those privileges, an attacker could: - Read environment variables and local credentials. - Access files available to the Agent. - Modify or delete workspace data. ...[truncated 276 chars]- Remediation
View remediation
