T09 · Insecure Skill Coding Practices
- Location
scripts/send_email.sh:7- Finding
Credential File Is Executed as Arbitrary Shell Code
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This Mailgun email skill mostly does what it says, but it has an unsafe credential-file fallback that can execute local shell code and its outbound email behavior needs clearer user control.
Review before installing. Use a narrowly scoped Mailgun sending key, confirm the resolved recipient and sender before use, avoid sending sensitive content unless intended, and do not rely on ~/.config/mailgun/credentials unless it is trusted, user-owned, non-symlinked, and locked down. Prefer environment variables or a non-executable config format over sourcing a credential file.
scripts/send_email.sh:7Credential File Is Executed as Arbitrary Shell Code
scripts/send_email.sh:28Mailgun API Key Is Exposed in the Curl Process Argument Vector
The skill documentation indicates shell-based execution via local scripts, but it does not declare any explicit tool scope such as allowed shell access. That weakens security boundaries and reviewability, because an agent may invoke shell capabilities more broadly than expected when handling email-sending tasks.
The skill supports default recipients and custom recipient/sender overrides, but it does not warn that these settings can send potentially sensitive content to external addresses without sufficient user awareness. In an agent context, silent use of MAILGUN_DEFAULT_TO or caller-provided addresses increases the risk of unintended data exfiltration through outbound email.
The script performs a network transmission to a third-party email service, including the message body, subject, sender, and recipient, but provides no prior user-facing warning or confirmation before sending. Although the script reports success or failure afterward, that is not a disclosure before the safety-relevant operation occurs.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
# Send email via Mailgun API
RESPONSE=$(curl -s -w "\n%{http_code}" --user "api:$MAILGUN_API_KEY" \
"https://api.mailgun.net/v3/$MAILGUN_DOMAIN/messages" \
-F from="$FROM" \
-F to="$TO" \
-F subject="$SUBJECT" \
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
# Send email via Mailgun API
RESPONSE=$(curl -s -w "\n%{http_code}" --user "api:$MAILGUN_API_KEY" \
"https://api.mailgun.net/v3/$MAILGUN_DOMAIN/messages" \
-F from="$FROM" \
-F to="$TO" \
-F subject="$SUBJECT" \
This markdown file documents an operation that transmits user-provided content, recipient addresses, and optional attachments to an external email service. Under the markdown-specific warning criterion, the description omits any user-facing caution about sharing sensitive data, attachments, or recipient information with a third-party provider.
The file includes user-facing natural-language content in Chinese, which imposes a specific language on users without any opt-in or alternative. This can violate language/locale policy where skills should not force a language unless clearly justified or optional.
No suspicious patterns detected.