T09 · Insecure Skill Coding Practices
Warning
- Location
- evals/run_evals.py:6
- Finding
- API Key Exposed Through Process Command-Line Arguments## Vulnerability Details **File Location**: `evals/run_evals.py`, lines 6–8 **Vulnerability Type**: API credential exposure through process arguments **Risk Level**: Medium ### Vulnerable Code ```python python run_evals.py --api-key $ANTHROPIC_API_KEY python run_evals.py --scenario CTC-001 --api-key $ANTHROPIC_API_KEY python run_evals.py --verbose --api-key $ANTHROPIC_API_KEY ``` ### Technical Analysis The documented commands instruct users to pass `ANTHROPIC_API_KEY` as a command-line argument. The shell expands the environment variable before starting Python, placing the plaintext credential in the process argument vector. Depending on the operating system and deployment environment, process arguments may be accessible to other local users, process-monitoring utilities, CI/CD telemetry, container orchestration systems, diagnostic collectors, shell tracing, or error-reporting services. This creates an avoidable credential-disclosure channel even though the key originally resides in an environment variable. ### Attack Path 1. A user exports a valid `ANTHROPIC_API_KEY` and runs one of the documented commands. 2. The shell expands `$ANTHROPIC_API_KEY` to its plaintext value. 3. The expanded key is included in the Python process argument vector. 4. A local observer, monitoring service, CI runner, or diagnostic collector captures the command-line arguments. 5. The exposed credential is reused to make unauthorized API requests. ### Impact Assessment An attacker who obtains the key may consume the associated API quota, incur charges, access API capabilities granted to the credential, and disrupt legitimate evaluations through rate-limit or budget exhaustion. The precise scope is limited by the permissions, spending limits, and account configuration associated with the exposed key. This issue does not directly provide operating-system privilege escalation.
- Remediation
- ## Remediation Suggestions - Remove `--api-key $ANTHROPIC_API_KEY` from all usage examples. - Have the evaluation framework read `ANTHROPIC_API_KEY` directly from the environment without copying it into `sys.argv`. - Prefer an operating-system or CI secret provider for automated execution. - Ensure verbose output, exceptions, and telemetry redact authentication values. - If interactive entry is necessary, use a non-echoing prompt such as Python's `getpass` rather than a command-line option. - Rotate any key that may already have appeared in process telemetry or logs. - Apply least-privilege permissions, spending limits, and usage alerts to evaluation credentials.
