T09 · Insecure Skill Coding Practices
- Location
scripts/_common.sh:6- Finding
Executable Configuration File Enables Local Command Execution and Insecure Secret Storage
- Content
View full analysis
~/.pexo/config << 'EOF' PEXO_BASE_URL="https://pexo.ai" PEXO_API_KEY="sk-" EOF ``` ### Technical Analysis The configuration file is presented as storage for two variable values, but it is loaded with Bash `source`. Consequently, every shell construct in the file is executed with the privileges of the user running the Skill. No validation limits the file to `PEXO_BASE_URL` and `PEXO_API_KEY` assignments. The `PEXO_CONFIG` environment variable can also redirect loading to another file. The implementation does not verify that the selected file is owned by the current user, is not writable by another user, or contains only permitted configuration syntax. The setup instructions also do not set a restrictive umask or apply modes `0700` and `0600` to the directory and API-key file. Depending on the existing umask, this may expose the bearer credential to other local users. ### Attack Path 1. An attacker gains write access to `~/.pexo/config`, influences `PEXO_CONFIG`, or places a malicious file at a path selected through that variable. 2. The attacker adds a shell command, command substitution, function, or other executable Bash syntax to the file. 3. The user or Agent invokes any ...[truncated 710 chars]- Remediation
View remediation
