Back to skill

Security audit

SendGrid Skills

Security checks for vulnerabilities and agentic risk

Overview

The verdict is benign because the reported network activity is described as email sending through SendGrid, while the flagged credential, shell, and remote-fetch patterns are reported in tests or documentation; confidence is medium because the scan was partial.

The verdict is benign, with medium confidence, but the scan is incomplete: it covered 16 of 17 components and only partially interpreted the webhook parser. Before installing or using it, review the email content and recipients before sending, and consider whether the skill’s declared tool scope is clear enough for your needs.

Vulnerability Patterns
  • 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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
Findings (29)

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · docs/security-audit-22.md (reported line 24)May include surrounding context.

md
he same immutable package contains `send-email/SKILL.md`, outbound API helpers and examples, `sendgrid-inbound/SKILL.md`, webhook implementation examples and a local parser. The root Sub-Skills table routes to both. An individual helper is intentionally narrower than the router. The package provides guidance/examples, not an automatically deployed inbound server. |
| SC2 records 5–8 (`scripts/README.md:131,227`, `scripts/parse-webhook-payload.js:7,133`) | **Rejected as remote-code execution.** `curl URL \| node scripts/parse-webhook-payload.js` runs the bundled local script; stdin is read by `readline`, split into fields and emitted via `JSON.stringify` (envelope uses `JSON.parse`). There is no eval, dynamic import or process execution of the response. A regression feeds code-like text through the real parser and verifies it remains data. The network/privacy concern is valid: local captures are now preferred and the retained optional pipeline is restricted in guidance to approved, owne

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · scripts/README.md (reported line 149)May include surrounding context.

Parse a local capture as a lossy text diagnostic, not a production multipart parser or authenticated receiver. It buffers input, may lose fields/whitespace, and is not binary-safe. Output can contain private bodies and attachments: use a bounded, approved synthetic/redacted capture and keep output private. Treat results as untrusted data, never executable code or agent instructions.

Prefer a local capture. The optional curl pipeline below performs a real GET to an owned, trusted HTTPS endpoint; approve that destination first, never substitute an untrusted/internal URL. Its response is data passed to the local parser, not downloaded JavaScript. A GET response is not necessarily an Inbound Parse payload.

Usage:

bash

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · scripts/parse-webhook-payload.js (reported line 7)May include surrounding context.

js
* 
 * Usage:
 *   node parse-webhook-payload.js < payload.txt
 *   curl https://webhook.example.com/parse | node parse-webhook-payload.js
 * 
 * Reads multipart/form-data from stdin and outputs structured JSON
 * Diagnostic only: output can include private email bodies and attachments.

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · scripts/parse-webhook-payload.js (reported line 140)May include surrounding context.

js
console.log('');
  console.log('Examples:');
  console.log('  node parse-webhook-payload.js < payload.txt');
  console.log('  curl https://webhook.example.com/parse | node parse-webhook-payload.js');
  console.log('');
  console.log('Output fields:');
  console.log('  - from, to, cc, subject');

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · tests/test_security.py (reported line 177)May include surrounding context.

python
def test_html_symlink_target_requires_html_suffix(self):
        # All targets are synthetic files in scratch, never real credential paths.
        for target in ("synthetic-secret.txt", "approved.htm"):
            (self.work / target).write_text("synthetic fixture")
            link = self.work / "report.html"
            link.unlink(missing_ok=True)

Skill declares no tool scope ('permissions' or 'allowed-tools') but code capabilities were detected: env, file_read, file_write, shell.

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
80% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · docs/security-audit-22.md (reported line 23)May include surrounding context.

md
d captures. Guidance is not a runtime approval gate. |
| TP4 records 1–4 (`SKILL.md:1`, individually compared with helper chunks) | **Rejected as package scope mismatch.** The same immutable package contains `send-email/SKILL.md`, outbound API helpers and examples, `sendgrid-inbound/SKILL.md`, webhook implementation examples and a local parser. The root Sub-Skills table routes to both. An individual helper is intentionally narrower than the router. The package provides guidance/examples, not an automatically deployed inbound server. |
| SC2 records 5–8 (`scripts/README.md:131,227`, `scripts/parse-webhook-payload.js:7,133`) | **Rejected as remote-code execution.** `curl URL \| node scripts/parse-webhook-payload.js` runs the bundled local script; stdin is read by `readline`, split into fields and emitted via `JSON.stringify` (envelope uses `JSON.parse`). There is no eval, dynamic import or process execution of the response. A regression feeds code-like text through the real parser and ve

External Transmission

Medium
Category
Data Exfiltration
Confidence
70% 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-html-email.sh (reported line 187)May include surrounding context.

sh
}

# Send via SendGrid API
RESPONSE=$(curl --disable -sS --connect-timeout 10 --max-time 60 \
  --proto =https --noproxy '*' -w "\n%{http_code}" \
  --request POST \
  --url https://api.sendgrid.com/v3/mail/send \

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 · SKILL.md (reported line 26)May include surrounding context.

md
- jq
        - node
    notes: |
      Live send helpers POST to https://api.sendgrid.com/v3/mail/send and require a Mail Send-only API key. The HTML helper reads an explicitly approved local file or inline content. The inbound verifier checks DNS MX records only; active webhook probing is disabled. The parser reads stdin locally. Review scripts and obtain recipient/content approval before live sends; no API key is needed for DNS or local parsing.
---

# SendGrid

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 · docs/security-audit-22.md (reported line 25)May include surrounding context.

md
ynamic import or process execution of the response. A regression feeds code-like text through the real parser and verifies it remains data. The network/privacy concern is valid: local captures are now preferred and the retained optional pipeline is restricted in guidance to approved, owned/trusted endpoints. |
| E1 records 13–19, 23 (send helpers and outbound reference curl examples) | **Purpose-aligned external transmission, not evidence of covert exfiltration.** Destination is the documented `https://api.sendgrid.com/v3/mail/send`, authenticated with the explicitly declared environment key. Some scanner excerpts reuse the test helper's heredoc even for other files: actual `send-html-email.sh` already uses jq, and reference curl bodies are static quoted-heredoc JSON. Executed reference examples with recording curl assert exact argv and complete JSON, including CC/BCC/templates/attachments. Privacy/approval warnings remain necessary and are added. |
| LP3 record 11 (`SKILL.md:1`) | **P

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-html-email.sh (reported line 190)May include surrounding context.

sh
RESPONSE=$(curl --disable -sS --connect-timeout 10 --max-time 60 \
  --proto =https --noproxy '*' -w "\n%{http_code}" \
  --request POST \
  --url https://api.sendgrid.com/v3/mail/send \
  --config <(printf 'header = "Authorization: Bearer %s"\n' "$SENDGRID_API_KEY") \
  --header 'Content-Type: application/json' \
  --data-binary @- <<<"$JSON_PAYLOAD") || {

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-test-email.sh (reported line 93)May include surrounding context.

sh
# Send email via SendGrid API
RESPONSE=$(curl --disable -sS --connect-timeout 10 --max-time 60 \
  --proto =https --noproxy '*' -w "\n%{http_code}" -X POST \
  https://api.sendgrid.com/v3/mail/send \
  --config <(printf 'header = "Authorization: Bearer %s"\n' "$SENDGRID_API_KEY") \
  -H "Content-Type: application/json" \
  --data-binary @- <<<"$JSON_PAYLOAD") || {

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 · send-email/references/installation.md (reported line 93)May include surrounding context.

md
fi
  response=$(curl --disable -sS --connect-timeout 10 --max-time 60 \
    --proto =https --noproxy '*' -w '\n%{http_code}' \
    -X POST https://api.sendgrid.com/v3/mail/send \
    --config <(printf 'header = "Authorization: Bearer %s"\n' "$SENDGRID_API_KEY") \
    -H 'Content-Type: application/json' --data-binary @- <<'JSON'
{"personalizations":[{"to":[{"email":"test@example.com"}]}],"from":{"email":"support@example.com"},"subject":"Hello","content":[{"type":"text/plain","value":"Hi"}]}

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 · send-email/references/single-email-examples.md (reported line 102)May include surrounding context.

md
fi
  response=$(curl --disable -sS --connect-timeout 10 --max-time 60 \
    --proto =https --noproxy '*' -w '\n%{http_code}' \
    -X POST https://api.sendgrid.com/v3/mail/send \
    --config <(printf 'header = "Authorization: Bearer %s"\n' "$SENDGRID_API_KEY") \
    -H 'Content-Type: application/json' --data-binary @- <<'JSON'
{"personalizations":[{"to":[{"email":"test@example.com"}],"cc":[{"email":"cc@example.com"}],"bcc":[{"email":"bcc@example.com"}]}],"from":{"email":"support@example.com"},"reply_to":{"email":"support@example.com"},"subject":"SendGrid test","content":[{"type":"text/plain","value":"Plain text body"},{"type":"text/html","value":"<p>HTML body</p>"}],"attachments":[{"content":"aGVsbG8=","type":"text/plain","filename":"hello.txt","disposition":"attachment"}]}

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 · send-email/references/single-email-examples.md (reported line 134)May include surrounding context.

md
fi
  response=$(curl --disable -sS --connect-timeout 10 --max-time 60 \
    --proto =https --noproxy '*' -w '\n%{http_code}' \
    -X POST https://api.sendgrid.com/v3/mail/send \
    --config <(printf 'header = "Authorization: Bearer %s"\n' "$SENDGRID_API_KEY") \
    -H 'Content-Type: application/json' --data-binary @- <<'JSON'
{"from":{"email":"support@example.com"},"personalizations":[{"to":[{"email":"test@example.com"}],"dynamic_template_data":{"first_name":"Vince"}}],"template_id":"d-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}

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 · tests/test_security.py (reported line 95)May include surrounding context.

python
call = calls[0]
        self.assertEqual(call["tool"], "curl")
        args = call["args"]
        self.assertIn("https://api.sendgrid.com/v3/mail/send", args)
        self.assertIn("Authorization: Bearer SG.synthetic-regression-only",
                      call.get("config", " ".join(args)))
        self.assertIn("Content-Type: application/json", args)

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 · tests/test_security.py (reported line 232)May include surrounding context.

python
descriptor = args.index("--config") + 1
                self.assertRegex(args[descriptor], r"^/dev/fd/\d+$")
                args[descriptor] = "<descriptor>"
                post = (["-X", "POST", "https://api.sendgrid.com/v3/mail/send"]
                        if helper == "send-test-email.sh" else
                        ["--request", "POST", "--url", "https://api.sendgrid.com/v3/mail/send"])
                header = "-H" if helper == "send-test-email.sh" else "--header"

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 · tests/test_security.py (reported line 234)May include surrounding context.

python
args[descriptor] = "<descriptor>"
                post = (["-X", "POST", "https://api.sendgrid.com/v3/mail/send"]
                        if helper == "send-test-email.sh" else
                        ["--request", "POST", "--url", "https://api.sendgrid.com/v3/mail/send"])
                header = "-H" if helper == "send-test-email.sh" else "--header"
                self.assertEqual(args, ["--disable", "-sS", "--connect-timeout", "10", "--max-time", "60",
                                        "--proto", "=https", "--noproxy", "*", "-w", r"\n%{http_code}",

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 · tests/test_security.py (reported line 598)May include surrounding context.

python
self.assertEqual(actual[0]["tool"], "curl")
                args = actual[0]["args"]
                self.assertEqual(args[0], "--disable")
                self.assertIn("https://api.sendgrid.com/v3/mail/send", args)
                self.assertIn("POST", args)
                self.assertIn("Content-Type: application/json", args)
                self.assertIn("--data-binary", args)

External Transmission

Medium
Category
Data Exfiltration
Confidence
70% 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-test-email.sh (reported line 91)May include surrounding context.

sh
}

# Send email via SendGrid API
RESPONSE=$(curl --disable -sS --connect-timeout 10 --max-time 60 \
  --proto =https --noproxy '*' -w "\n%{http_code}" -X POST \
  https://api.sendgrid.com/v3/mail/send \
  --config <(printf 'header = "Authorization: Bearer %s"\n' "$SENDGRID_API_KEY") \

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 · send-email/references/installation.md (reported line 7)May include surrounding context.

md
## Optional repository helpers

The repository send helpers require Bash 3.2+, curl and jq 1.6+ (`--rawfile`); HTML file input also requires `realpath`. Check `jq --version` before using them. jq reads each field through a descriptor to preserve UTF-8 without putting message content in child-process arguments. These helpers are optional in a standalone subskill installation. The self-contained cURL examples below require Bash and curl, but do not use jq or sibling scripts.

## Node.js / TypeScript

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 · send-email/references/single-email-examples.md (reported line 87)May include surrounding context.

sg.send(message)

text

## cURL

These self-contained Bash examples stream JSON on stdin and the validated key through a curl config descriptor. They disable default curl config, bypass environment proxies, use HTTPS with TLS verification, do not follow redirects, and do not retry. Keep shell history, environment access and output private; these are not a local-process privacy sandbox.

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 · send-email/references/single-email-examples.md (reported line 109)May include surrounding context.

md
JSON
  ) || {
    status=$?
    echo "Error: request to SendGrid failed (curl exit $status); delivery status is unknown. Do not retry automatically." >&2
    exit "$status"
  }
  code=${response##*$'\n'}

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · tests/test_security.py (reported line 82)May include surrounding context.

python
def run_helper(self, name, *args, input=None):
        runtime = "node" if name.endswith(".js") else "bash"
        return subprocess.run([str(self.bin / runtime), str(ROOT / "scripts" / name), *args],
                              input=input, capture_output=True, text=True, env=self.env,
                              cwd=self.work, timeout=10)

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · tests/test_security.py (reported line 542)May include surrounding context.

python
for block in blocks:
            if self.record.exists():
                self.record.unlink()
            result = subprocess.run([str(self.bin / "bash"), "-c", block], env=self.env,
                                    cwd=self.work, capture_output=True, text=True, timeout=10)
            self.assertEqual(result.returncode, 0, result.stderr)
            yield self.calls()