T09 · Insecure Skill Coding Practices
- Location
references/auth-prerequisite.md:10- Finding
API Secret Exposed Through Command-Line Arguments
- Content
View full analysis
Vulnerability Details
File Location:
references/auth-prerequisite.md:10-13references/auth-prerequisite.md:52-55references/auth-prerequisite.md:61-63references/auth-prerequisite.md:131-134references/auth-prerequisite.md:167-170references/command-mapping.md:16-19
Vulnerability Type: Credential exposure through process arguments and shell history
Risk Level: MediumVulnerable Code
bash dimens-cli auth api-key-login \ --base-url https://dimens.bintelai.com/api \ --api-key ak_xxx \ --api-secret sk_xxxThis command pattern is repeatedly prescribed as the standard authentication method.
Technical Analysis
The documentation directs users and AI agents to supply an API key and API secret as command-line arguments. Secrets passed this way can be exposed through:
- Shell history files.
- Process-listing utilities while the command is running.
- Terminal session recording.
- CI/CD logs and command tracing.
- Agent transcripts or diagnostic logs.
- Parent-process telemetry and endpoint-monitoring products.
Although the examples use placeholders, users are expected to replace them with real credentials. The repeated recommendation makes accidental disclosure likely during normal use.
Attack Path
- A user or agent replaces
ak_xxxandsk_xxxwith valid credentials. - The authentication command is executed in an interactive shell, automated job, or agent-controlled terminal.
- The command and its arguments are retained in shell history, logs, telemetry, or process metadata.
- A local user, compromised monitoring process, log reader, or CI operator retrieves the exposed secret.
- The attacker submits the recovered credentials to the documented authentication endpoint.
- The service returns a token associated with the account bound to the API credentials.
- The attacker accesses resources permitted to tha ...[truncated 745 chars]
- Remediation
View remediation
Remediation Suggestions
- Add a secure interactive authentication mode that reads the API secret from a no-echo prompt.
- Support reading the secret from protected standard input, for example through a
--api-secret-stdinoption. - Integrate with an operating-system credential store or secrets manager and reference credentials by identifier.
- Remove direct
--api-secret VALUEexamples from documentation. - If environment-variable input is supported, document that environment variables may still be visible to privileged local processes and must not be printed or logged.
- Ensure the CLI redacts API keys, API secrets, tokens, and refresh tokens from errors, debug logs, telemetry, and agent output.
- Disable command echoing around authentication steps in automation.
- Recommend short-lived credentials, least-privilege service identities, rotation, revocation, and audit monitoring.
- Add automated tests verifying that secrets never appear in process output or logs.
