T09 · Insecure Skill Coding Practices
- Location
SKILL.md:201- Finding
Bearer Token Exposed Through Command-Line Arguments and Persistent Trigger Configuration
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 201–205
Vulnerability Type: Credential exposure through command arguments and stored configuration
Risk Level: HighVulnerable Code
bash maton trigger create --source google-mail --event-type email.received \ --connection-id {connection_id} \ --parameter labels=INBOX \ --destination '{"url":"https://api.maton.ai/slack/api/chat.postMessage","method":"POST","name":"slack","headers":{"Authorization":"Bearer '"$MATON_API_KEY"'","Content-Type":"application/json"},"body_template":"{\"channel\": \"C0123456789\", \"text\": \"New email: <dynamic configuration>\"}"}'Technical Analysis
The shell expands
MATON_API_KEYbefore invoking the Maton CLI. The resulting bearer token becomes part of the process argument vector and the trigger destination configuration.Depending on the operating system, shell, CLI implementation, and gateway behavior, the expanded secret may be exposed through:
- Process inspection tools and process accounting
- Shell command history
- CLI diagnostic or error output
- Local audit and telemetry logs
- Remotely persisted trigger definitions
- Gateway administration interfaces or configuration exports
Authentication to the declared gateway is required for the Skill's functionality, but embedding a reusable credential in a command argument and persistent JSON configuration is not necessary. This also conflicts with the Skill's instruction at line 128 not to print or log
MATON_API_KEY.Attack Path
- A user or Agent follows the documented trigger-creation example.
- The shell replaces
$MATON_API_KEYwith the actual bearer token. - The expanded token is supplied as part of the CLI process arguments.
- The CLI may transmit and persist the token inside the trigger definition.
- An attacker with access to process metadata, shell history, logs, trigger configuration, or gateway administration da ...[truncated 785 chars]
- Remediation
View remediation
Remediation Suggestions
- Do not place bearer tokens in command-line arguments or serialized trigger definitions.
- Use a server-side connection or secret reference, such as a connection ID whose credentials are resolved only at execution time.
- If direct secret transfer is unavoidable, use a protected standard-input channel, operating-system credential store, or restricted file descriptor rather than the process argument vector.
- Ensure trigger APIs reject literal authorization secrets and accept only opaque credential references.
- Redact authorization values from CLI errors, debug output, telemetry, audit logs, and administrative interfaces.
- Prevent shell-history persistence for commands handling sensitive values.
- Encrypt stored trigger configuration and tightly restrict access to it.
- Rotate any token previously used with this example and review gateway logs and trigger definitions for exposure.
