T09 · Insecure Skill Coding Practices
- Location
auth-and-provider.md:27- Finding
API Key Exposed Through Command-Line Argument
- Content
View full analysis
Vulnerability Details
File Location:
auth-and-provider.md, lines 27-37
Vulnerability Type: API credential exposure through process arguments and shell history
Risk Level: MediumVulnerable Code
bash ## OpenClaw CLI Setup ```bash openclaw onboard --deepinfra-api-key <key>Or set the environment variable directly:
bash export DEEPINFRA_API_KEY="<your-deepinfra-api-key>"text ### Technical Analysis The onboarding example instructs users to supply a DeepInfra API key as a command-line argument. Secrets passed in this manner may be exposed through: - Shell command history. - Process argument inspection while the command is running. - Terminal session recording. - Operating-system audit logs. - Endpoint monitoring and diagnostic telemetry. - Support bundles that collect process invocation details. This guidance conflicts with the Skill's stated objective of preventing secret leakage. Although the document also provides an environment-variable alternative, presenting the command-line method as the primary OpenClaw setup procedure may lead users to adopt the less secure option. ### Attack Path 1. A user copies the documented command and replaces the placeholder with a valid DeepInfra API key. 2. The complete command is stored in shell history, captured by telemetry, or temporarily exposed in the process argument list. 3. A local user, monitoring agent, log reader, or support-system operator obtains the exposed argument. 4. The attacker extracts the API key. 5. The attacker submits unauthorized DeepInfra API requests using the victim's account until the key is revoked or its account-side limits are reached. ### Impact Assessment Successful exploitation grants the attacker the API permissions associated with the exposed DeepInfra key. Depending on account configuration, this may permit unauthorized model inference, consumption of the victim's usage quot ...[truncated 258 chars]- Remediation
View remediation
Remediation Suggestions
- Remove the command-line argument example for supplying a real API key.
- Prefer retrieving the credential from
DEEPINFRA_API_KEYwithout reproducing its value in generated commands, output, notes, or logs. - If interactive onboarding is required, accept the key through a hidden terminal prompt or standard input rather than through process arguments.
- Add an explicit warning that users must not place API keys directly in shell commands or shell history.
- Ensure onboarding code never logs the credential and does not include it in error messages, process titles, or diagnostic output.
- Recommend restrictive access controls for any local credential store and provide key-rotation instructions for users who previously followed the unsafe example.
