Back to skill

Security audit

mailgun sender

Security checks for vulnerabilities and agentic risk

Overview

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.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/send_email.sh:7
Finding

Credential File Is Executed as Arbitrary Shell Code

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Note
Location
scripts/send_email.sh:28
Finding

Mailgun API Key Is Exposed in the Curl Process Argument Vector

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (7)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

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.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · references/api.md (reported line 15)May include surrounding context.

md
# 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" \

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/send_email.sh (reported line 30)May include surrounding context.

sh
# 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" \

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.