T09 · Insecure Skill Coding Practices
- Location
SKILL.md:53- Finding
SMTP Credential Exposure Through Agent-Generated Command Text
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 53–63 and line 73
Vulnerability Type: Sensitive credential exposure through command construction
Risk Level: MediumVulnerable Code Snippet:
bash SMTP_HOST=smtp.163.com \ SMTP_PORT=465 \ SMTP_SECURE=true \ SMTP_USER=your-email@example.com \ SMTP_PASS=your-smtp-password \ SMTP_FROM="Your Name <your-email@example.com>" \ node {baseDir}/scripts/send.js \ --to "recipient@example.com" \ --subject "Email Subject" \ --body "Email Body"text When the user requests sending an email, use the exec tool to execute the command above.Technical Analysis
The Skill directs the AI Agent to execute a shell command containing the SMTP password as an inline environment-variable assignment. When the placeholder is replaced with a real credential, the secret becomes part of the generated command text.
Although an inline assignment may not be retained in ordinary interactive shell history in every execution environment, the complete command can still be exposed through Agent conversation records, tool-call transcripts, executor logs, audit telemetry, debugging output, or process inspection. This behavior also conflicts with the Skill's own warning against placing real SMTP credentials directly on the command line.
The executable script itself reads
SMTP_PASSfrom the environment and does not print it. The vulnerability is therefore in the documented Agent invocation procedure rather than inscripts/send.js.Attack Path
- A user or operator configures the Skill with a real SMTP account and password.
- The Agent follows
SKILL.mdand constructs anexeccommand containingSMTP_PASS=<real-secret>. - The Agent platform, execution service, telemetry system, or another monitoring component records the complete tool call or command.
- An attacker with access to those records extracts the SMTP username, host, a ...[truncated 740 chars]
- Remediation
View remediation
Remediation Suggestions
-
Remove
SMTP_PASSand other credentials from all generated command strings and examples intended for direct Agent execution. -
Provision SMTP credentials through the executor's inherited environment, a platform secret manager, or a dedicated credential-injection mechanism.
-
Instruct the Agent to invoke only the script and non-secret arguments, for example:
bash node {baseDir}/scripts/send.js \ --to "recipient@example.com" \ --subject "Email Subject" \ --body "Email Body" -
Configure the Agent platform and execution layer to redact known secret values and sensitive environment-variable names from tool-call records, logs, traces, and error reports.
-
Use a dedicated SMTP authorization token with the minimum necessary permissions instead of the mailbox's primary password.
-
Rotate any credential that may already have appeared in Agent transcripts or executor logs.
-
Restrict access to historical tool logs and define a short retention period for records that may contain sensitive command data.
-
