T09 · Insecure Skill Coding Practices
- Location
SKILL.md:15- Finding
Shell Command Injection Through Unsafely Interpolated Prompt
- Content
View full analysis
background:true command:"codex exec --full-auto ''" ``` ### Technical Analysis The workflow instructs the orchestrator to interpolate `` directly into a shell command enclosed by single quotes. No escaping, validation, or structured argument handling is specified. If prompt content is obtained from an untrusted or partially trusted source, an embedded single quote can terminate the intended quoted argument. Subsequent shell metacharacters can then be interpreted as command syntax rather than prompt text. This permits arbitrary command injection under the account running the orchestrator. The use of `--full-auto` further increases the potential consequences because the launched Codex process is configured for autonomous operation, although exploitation of the shell interpolation flaw occurs before Codex processes the prompt. ### Attack Path 1. An attacker supplies or influences task text that will be substituted for ``. 2. The malicious text includes a single quote that closes the surrounding shell quote. 3. The text appends shell syntax and an attacker-selected command. 4. The orchestrator constructs and launches the resulting command through `bash`. 5. The shell interprets the appended content as executable syntax. 6. The injected command runs with the filesystem access, environment variables, and operating-system privileges of the user running the orchestration skill. ### Impact Assessment Successful exploitation can provide arbitrary command execution with the invoking user's privileges. Depending on that account's permissions and environment, an attacker could read or modify accessible project files, destroy data, access credentials or tokens exposed through files or environment variables, alter source code, and invoke a ...[truncated 214 chars]- Remediation
View remediation
