T09 · Insecure Skill Coding Practices
- Location
SKILL.md:14- Finding
API Key Exposure Through Command-Line Arguments
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, line 14
Vulnerability Type: API key disclosure through process arguments and shell history
Risk Level: MediumVulnerable Code Snippet:
bash - If not authenticated: `mmx auth login --api-key <key>`Technical Analysis
The skill instructs users or agents to place a MiniMax API key directly in the
mmxcommand line. After replacing the placeholder with a real credential, the secret may become visible in shell history, process listings, terminal transcripts, command telemetry, audit logs, or agent execution logs.Command-line arguments are generally not an appropriate secret-transport mechanism because they can be recorded or inspected outside the authenticated process. Although the document does not contain a hardcoded credential, following its authentication guidance can disclose a user-supplied credential.
Attack Path
- A user or agent follows the prerequisite instructions.
- The placeholder is replaced with a valid MiniMax API key.
- The authentication command is executed with the key in its argument list.
- The command or process arguments are retained in shell history, logs, telemetry, or process-monitoring output.
- A local user, monitoring service, log reader, or other party with access to those records retrieves the key.
- The exposed key is used to access MiniMax services under the victim's account, subject to the key's permissions.
Impact Assessment
Exploitation requires access to process metadata, command history, terminal records, or execution logs containing the command. A recovered key could permit unauthorized API requests, consumption of the victim's quota or credits, access to capabilities granted to the credential, and activity attributed to the victim's account. The precise scope is limited by the API key's assigned permissions and provider-side controls.
- Remediation
View remediation
Remediation Suggestions
- Remove examples that pass API keys through command-line arguments.
- Prefer the CLI's interactive authentication flow with hidden input, if supported.
- Alternatively, provide the credential through standard input, an operating-system credential store, or another vendor-supported secret mechanism that does not expose it in process arguments.
- If an environment variable is the only supported noninteractive option, load it from a permission-restricted secret manager rather than placing it in shell history, and document the residual risk that environment data may be visible to sufficiently privileged processes.
- Ensure terminal transcripts and agent logs redact authentication values.
- Advise users who previously followed this command with a real key to inspect relevant histories and logs, remove exposed records where feasible, revoke the key, and issue a replacement.
