Back to skill

Security audit

Save To Email

Security checks for vulnerabilities and agentic risk

Overview

This skill does what it says: it sends user-provided email content through Resend, with some safety caveats around confirmation and local .env handling.

Install only if you intend to let the agent send email through your Resend account. Review recipient, subject, and body before sending sensitive content, and keep the local .env file private, trusted, and not writable by other users or processes.

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 (1)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/send-email.sh:8
Finding
Arbitrary Shell Command Execution Through Unsafe .env Loading## Vulnerability Details **File Location**: `scripts/send-email.sh`, lines 8–12 **Vulnerability Type**: Unsafe execution of configuration data **Risk Level**: Medium ```bash if [ -f "${ROOT_DIR}/.env" ]; then set -a # shellcheck disable=SC1091 . "${ROOT_DIR}/.env" set +a fi ``` ### Technical Analysis The script loads the project-root `.env` file with the shell dot command (`.`). Dot-sourcing does not treat the file as passive configuration: it parses and executes its contents as shell code in the current process. Consequently, an attacker who can create or modify the skill-root `.env` file can insert command substitutions, shell functions, redirections, or arbitrary commands. These commands execute whenever `scripts/send-email.sh` is invoked. Execution occurs before the script validates its argument count or checks the required environment variables, so even an otherwise invalid invocation triggers the malicious content. The repository does not contain a malicious `.env`, and no evidence of intentional malicious behavior was identified. The vulnerability depends on an attacker or another compromised process gaining write access to that external configuration file. ### Attack Path 1. An attacker gains the ability to create or modify `.env` in the project root. 2. The attacker adds shell code to the file, for example: ```bash RESEND_API_KEY=placeholder RESEND_FROM=sender@example.com arbitrary_attacker_command ``` 3. A user or agent invokes `scripts/send-email.sh`. 4. Lines 8–12 dot-source `.env`. 5. The injected command executes with the same operating-system identity and permissions as the invoking user or agent. 6. The injected code can access data available to that process, including exported secrets and readable local files, and can perform any network or filesystem operation permitted to that identity. ### Impact Assessment Successful exploitation provides arbitrary command execution under the privileges of the user or agent r ...[truncated 457 chars]
Remediation
## Remediation Suggestions - Do not load `.env` with `source` or the dot command. - Replace executable loading with a parser that accepts only an explicit allowlist of keys, such as `RESEND_API_KEY` and `RESEND_FROM`. - Reject malformed lines, unknown keys, command substitutions, shell metacharacters, and unsupported quoting rather than evaluating them. - Prefer supplying secrets through a trusted process environment or secret manager instead of a repository-local file. - Verify that any local configuration file is a regular file, is owned by the expected user, is not a symbolic link, and is not writable by group or other users. - Apply restrictive permissions such as `0600` to files containing credentials. - Keep validation and JSON serialization of email fields, but ensure configuration values are never evaluated as shell syntax.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (11)

Ae1

High
Category
analysis-evasion
Content
./scripts/send-email.sh "recipient@example.com" "Subject" "<p>HTML content</p>"
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
./scripts/send-email.sh "recipient@example.com" "Subject" "<p>HTML content</p>"
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
./scripts/send-email.sh "recipient@example.com" "Subject" "<p>HTML content</p>"
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Credential Access

High
Category
Privilege Escalation
Content
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
ROOT_DIR="$(cd "${SCRIPT_DIR}/.." && pwd)"

if [ -f "${ROOT_DIR}/.env" ]; then
  set -a
  # shellcheck disable=SC1091
  . "${ROOT_DIR}/.env"
Confidence
60% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
ROOT_DIR="$(cd "${SCRIPT_DIR}/.." && pwd)"

if [ -f "${ROOT_DIR}/.env" ]; then
  set -a
  # shellcheck disable=SC1091
  . "${ROOT_DIR}/.env"
Confidence
60% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
The README instructs users to send recipient addresses and message bodies through the Resend API but does not disclose that this data is transmitted to and processed by a third-party service. This can lead to inadvertent exposure of sensitive content or personal data, especially when the skill is used to email reports or generated outputs that may contain confidential information.

Lp3

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding
The skill invokes local shell execution via `./scripts/send-email.sh` and declares required binaries, but it does not define any explicit tool scope such as `permissions` or `allowed-tools`. That increases the chance an agent may invoke shell capabilities more broadly than intended, reducing containment for a skill that can transmit data externally.

Vague Triggers

Medium
Confidence
90% confidence
Finding
The trigger phrases are broad (`send email`, `email this`, multilingual equivalents) and can match many benign user requests without ensuring the user intended external transmission of potentially sensitive generated content. In a skill that sends data to a third-party email API, overbroad activation raises the risk of accidental exfiltration or sending to unintended recipients.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The skill explains how to send recipient addresses, subjects, and HTML bodies through Resend, but it does not clearly warn that this transfers user content and recipient metadata to an external third-party service. Without a prominent disclosure, users may unknowingly send sensitive data off-platform, especially when emailing generated reports or summaries.

External Transmission

Medium
Category
Data Exfiltration
Content
)"

RESPONSE="$(
  curl -sS -w "\n%{http_code}" \
    -X POST "https://api.resend.com/emails" \
    -H "Authorization: Bearer ${RESEND_API_KEY}" \
    -H "Content-Type: application/json" \
Confidence
70% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
RESPONSE="$(
  curl -sS -w "\n%{http_code}" \
    -X POST "https://api.resend.com/emails" \
    -H "Authorization: Bearer ${RESEND_API_KEY}" \
    -H "Content-Type: application/json" \
    --data-binary "${PAYLOAD}"
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Static analysis

No suspicious patterns detected.