T09 · Insecure Skill Coding Practices
- Location
scripts/_common.sh:6- Finding
Executable Configuration File and Insufficient Credential File Protection
- Content
View full analysis
~/.pexo/config << 'EOF' PEXO_BASE_URL="https://pexo.ai" PEXO_API_KEY="sk-" EOF ``` ### Technical Analysis The scripts load the configuration with Bash `source`, which treats the entire file as executable shell code rather than parsing it as configuration data. The optional `PEXO_CONFIG` environment variable can select another file without validating its ownership, permissions, contents, or location. Consequently, any command substitution, function definition, redirection, or arbitrary shell command placed in the selected configuration file executes whenever a Pexo script loads it. This does not independently provide an attacker with write access, but it turns compromise or unsafe delegation of the configuration file into code execution. The documented setup procedure also stores the API key without first setting `umask 077` or explicitly applying mode `600`. The resulting permissions depend on the user's ambient umask and may permit other local users to read the credential. ### Attack Path 1. An attacker gains the ability to modify `~/.pexo/config`, influence how it is provisioned, or cause a wrapper process to set `PEXO_CONFIG` to an attacker-controlled file. 2. The attacker inserts a command such as a shell invocation or command substitution into that fil ...[truncated 1157 chars]- Remediation
View remediation
