T09 · Insecure Skill Coding Practices
- Location
scripts/submit_gpt_5_5_chat.sh:12- Finding
PoYo API Key Exposed in Process Command-Line Arguments
- Content
View full analysis
/cmdline`. A local process running under the same account—or a privileged local user—could monitor newly created processes and capture the bearer token while `curl` is active. This issue does not send the credential to an unrelated host and does not grant system-level privileges by itself. The exposure is limited to local process visibility and the permissions associated with the compromised PoYo API key. ### Attack Path 1. A victim sets a valid `POYO_API_KEY` and invokes the submission script. 2. The shell expands `${POYO_API_KEY}` into the `curl` command-line argument. 3. A local attacker with sufficient process-inspection access continuously monitors process arguments. 4. The attacker identifies the `curl` process and reads its `Authorization: Bearer ...` argument before the process exits. 5. The attacker reuses the captured bearer token to submit requests to the PoYo API. 6. Requests execute within the account access, limits, and billing scope associated with that API key. Successful exploitation requires local process visibility; it cannot be performed remotely solely through this ...[truncated 609 chars]- Remediation
View remediation
"${config_file}" printf 'header = "Content-Type: application/json"\n' >>"${config_file}" curl --fail-with-body --request POST \ --config "${config_file}" \ --url "https://api.poyo.ai/v1/chat/completions" \ --data @"${payload_file}" ``` Additional hardening measures include: 1. Ensure the temporary file is created in a trusted local directory with mode `0600`. 2. Register cleanup traps immediately so the file is deleted on normal exit and common interruption signals. 3. Never enable shell tracing with `set -x` while processing the credential. 4. Do not log the generated curl configuration, authorization header, environment, or raw request command. 5. Run the script under a dedicated least-privileged service account where practical. 6. Restrict process inspection through appropriate operating-system controls. 7. Rotate the API key promptly if process arguments may already have been monitored. 8. Limit the key's permissions, quota, and lifetime where the provider supports those controls. ]]>
