Back to skill

Security audit

SmartSaaS

Security checks for vulnerabilities and agentic risk

Overview

This is a broad SmartSaaS admin connector, but unsafe script behavior could expose its API key or run unintended local code, so it needs review before installation.

Install only with a least-privilege SmartSaaS API key and only if you are comfortable granting broad account mutation rights. Avoid name-based dataset lookup and do not pass untrusted dataset names to add-to-dataset.sh until it is fixed; require normal TLS verification for production HTTPS URLs; review and confirm any integration removal, campaign start, email send, webhook, or cron operation before running it.

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

Error
Location
scripts/add-to-dataset.sh:17
Finding

Bearer API Key Exposed by Disabled TLS Certificate Verification

Content
View full analysis

Vulnerability Details

File Location: scripts/add-to-dataset.sh:17-18, 52, 76-77
Vulnerability Type: Improper TLS certificate validation
Risk Level: High

Vulnerable Code

bash
AUTH_HEADER="Authorization: Bearer $KEY"
CURL_OPTS="-s -S"
[[ "$BASE" == https://* ]] && CURL_OPTS="$CURL_OPTS -k"

The insecure options are subsequently used for authenticated requests:

bash
RESP=$(curl $CURL_OPTS -H "$AUTH_HEADER" "$BASE/api/protected/data/folders?limit=100")
bash
RES=$(curl $CURL_OPTS -w "\n%{http_code}" -X POST -H "$AUTH_HEADER" -H "Content-Type: application/json" \
  -d "$PAYLOAD" "$BASE/api/protected/data/folders/$FOLDER_ID/items")

Technical Analysis

The script adds curl's -k option whenever the configured base URL begins with https://. This option disables server-certificate and hostname verification for every HTTPS destination, including production servers.

The bearer API key is then transmitted through this unverified connection. Encryption without certificate authentication does not establish that the remote endpoint is the intended SmartSaaS server. An attacker capable of intercepting or redirecting traffic can present an arbitrary certificate, terminate TLS, and receive both the bearer credential and request content.

This behavior is unnecessary for the declared production API functionality. Other scripts limit insecure TLS handling to localhost-like destinations, whereas this script disables verification for all HTTPS hosts.

Attack Path

  1. A user or agent invokes add-to-dataset.sh with valid SMARTSAAS_BASE_URL and SMARTSAAS_API_KEY environment variables.
  2. An attacker obtains a network interception or redirection position, such as through a malicious proxy, compromised DNS, hostile Wi-Fi, or routing manipulation.
  3. The attacker presents an untrusted certificate while impersonating the configured HTTPS endpoint.
  4. Because curl runs with -k, the script accepts the certificate without valida ...[truncated 1019 chars]
Remediation
View remediation

Remediation Suggestions

  • Remove unconditional use of curl's -k option:
bash
CURL_OPTS=(-sS)
  • Require a valid HTTPS URL for non-loopback destinations and reject plaintext HTTP.
  • If local development genuinely requires a self-signed certificate, allow the exception only for strictly parsed loopback hostnames or addresses, not substring matches.
  • Prefer configuring curl with an explicit development CA certificate:
bash
curl --cacert "$SMARTSAAS_CA_BUNDLE" ...
  • Use Bash arrays for curl options so arguments remain correctly separated.
  • Add automated tests confirming that production HTTPS requests fail for expired, self-signed, hostname-mismatched, and otherwise untrusted certificates.
  • Rotate the API key if this script has been used over a network where interception may have occurred.

T09 · Insecure Skill Coding Practices

Error
Location
scripts/add-to-dataset.sh:50
Finding

Arbitrary Python Code Injection Through Dataset Name

Content
View full analysis

Vulnerability Details

File Location: scripts/add-to-dataset.sh:50-66
Vulnerability Type: Code injection through unsafe source-code construction
Risk Level: High

Vulnerable Code

bash
else
  echo "Resolving folder by name: $FOLDER_REF" >&2
  RESP=$(curl $CURL_OPTS -H "$AUTH_HEADER" "$BASE/api/protected/data/folders?limit=100")
  if ! echo "$RESP" | grep -q '"success":true'; then
    echo "Failed to list folders: $RESP" >&2
    exit 2
  fi
  FOLDER_ID=$(echo "$RESP" | python3 -c "
import sys, json
ref = '''$FOLDER_REF'''.strip().lower().replace(' ', '_')
data = json.load(sys.stdin)
for item in (data.get('data') or []):
    title = (item.get('dataTitle') or '').strip().lower()
    if title == ref or ref in title or ref.replace('_', ' ') in title.replace('_', ' '):
        print(item.get('_id', ''))
        break
" 2>/dev/null)

Technical Analysis

When the first argument is not a 24-character hexadecimal identifier, it is treated as a dataset name and assigned to FOLDER_REF. The value is then interpolated directly into the source text supplied to python3 -c.

Triple quotes do not make this safe. An attacker-controlled value containing a terminating ''' sequence can close the intended Python string literal and append Python expressions or statements. The resulting source is parsed and executed by the Python interpreter under the same operating-system identity as the Skill process.

Shell quoting around the overall python3 -c argument does not prevent this vulnerability because the injection target is Python syntax, not shell syntax. The broad instruction to invoke scripts with user-defined positional arguments makes crafted dataset names a plausible untrusted input channel.

Attack Path

  1. An attacker causes the user or agent to resolve a dataset using a crafted non-hexadecimal name containing Python syntax that terminates the triple-quoted literal.
  2. The agent passes that name as FOLDER_REF to add-to-dataset.sh.

...[truncated 1178 chars]

Remediation
View remediation

Remediation Suggestions

Pass the dataset name as data rather than embedding it in Python source. For example:

bash
FOLDER_ID=$(
  printf '%s' "$RESP" |
    python3 -c '
import json
import sys

ref = sys.argv[1].strip().lower().replace(" ", "_")
data = json.load(sys.stdin)

for item in data.get("data") or []:
    title = (item.get("dataTitle") or "").strip().lower()
    if (
        title == ref
        or ref in title
        or ref.replace("_", " ") in title.replace("_", " ")
    ):
        print(item.get("_id", ""))
        break
' "$FOLDER_REF"
)

Additional hardening should include:

  • Prefer requiring a validated 24-character folder ID, as documented in SKILL.md, and remove name-based fuzzy resolution if it is not essential.
  • If name lookup remains necessary, use exact matching or explicitly handle ambiguous results rather than selecting the first partial match.
  • Validate all identifiers and JSON input before network submission.
  • Do not suppress Python diagnostics unconditionally; return a controlled error without concealing unexpected parser or runtime failures.
  • Add regression tests with quotes, triple quotes, newlines, backslashes, Unicode, and Python metacharacters in dataset names.
  • Rotate exposed credentials and inspect the host if a crafted dataset name may previously have reached this path.
Vulnerability Patterns
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • 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
Findings (175)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The manifest and top-level description frame this as a narrow dataset helper, but the body documents broad administrative capabilities including projects, tasks, integrations, campaigns, templates, knowledge, calendar, and webhook/cron operations. This mismatch can cause operators or downstream policy systems to grant the skill more trust than warranted, enabling unexpected remote modifications across multiple SmartSaaS resources.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The manifest and top-level description frame this as a narrow dataset helper, but the body documents broad administrative capabilities including projects, tasks, integrations, campaigns, templates, knowledge, calendar, and webhook/cron operations. This mismatch can cause operators or downstream policy systems to grant the skill more trust than warranted, enabling unexpected remote modifications across multiple SmartSaaS resources.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The manifest and top-level description frame this as a narrow dataset helper, but the body documents broad administrative capabilities including projects, tasks, integrations, campaigns, templates, knowledge, calendar, and webhook/cron operations. This mismatch can cause operators or downstream policy systems to grant the skill more trust than warranted, enabling unexpected remote modifications across multiple SmartSaaS resources.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The manifest and top-level description frame this as a narrow dataset helper, but the body documents broad administrative capabilities including projects, tasks, integrations, campaigns, templates, knowledge, calendar, and webhook/cron operations. This mismatch can cause operators or downstream policy systems to grant the skill more trust than warranted, enabling unexpected remote modifications across multiple SmartSaaS resources.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The manifest and top-level description frame this as a narrow dataset helper, but the body documents broad administrative capabilities including projects, tasks, integrations, campaigns, templates, knowledge, calendar, and webhook/cron operations. This mismatch can cause operators or downstream policy systems to grant the skill more trust than warranted, enabling unexpected remote modifications across multiple SmartSaaS resources.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The manifest and top-level description frame this as a narrow dataset helper, but the body documents broad administrative capabilities including projects, tasks, integrations, campaigns, templates, knowledge, calendar, and webhook/cron operations. This mismatch can cause operators or downstream policy systems to grant the skill more trust than warranted, enabling unexpected remote modifications across multiple SmartSaaS resources.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The manifest and top-level description frame this as a narrow dataset helper, but the body documents broad administrative capabilities including projects, tasks, integrations, campaigns, templates, knowledge, calendar, and webhook/cron operations. This mismatch can cause operators or downstream policy systems to grant the skill more trust than warranted, enabling unexpected remote modifications across multiple SmartSaaS resources.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The manifest and top-level description frame this as a narrow dataset helper, but the body documents broad administrative capabilities including projects, tasks, integrations, campaigns, templates, knowledge, calendar, and webhook/cron operations. This mismatch can cause operators or downstream policy systems to grant the skill more trust than warranted, enabling unexpected remote modifications across multiple SmartSaaS resources.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The manifest and top-level description frame this as a narrow dataset helper, but the body documents broad administrative capabilities including projects, tasks, integrations, campaigns, templates, knowledge, calendar, and webhook/cron operations. This mismatch can cause operators or downstream policy systems to grant the skill more trust than warranted, enabling unexpected remote modifications across multiple SmartSaaS resources.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The manifest and top-level description frame this as a narrow dataset helper, but the body documents broad administrative capabilities including projects, tasks, integrations, campaigns, templates, knowledge, calendar, and webhook/cron operations. This mismatch can cause operators or downstream policy systems to grant the skill more trust than warranted, enabling unexpected remote modifications across multiple SmartSaaS resources.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The manifest and top-level description frame this as a narrow dataset helper, but the body documents broad administrative capabilities including projects, tasks, integrations, campaigns, templates, knowledge, calendar, and webhook/cron operations. This mismatch can cause operators or downstream policy systems to grant the skill more trust than warranted, enabling unexpected remote modifications across multiple SmartSaaS resources.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The manifest and top-level description frame this as a narrow dataset helper, but the body documents broad administrative capabilities including projects, tasks, integrations, campaigns, templates, knowledge, calendar, and webhook/cron operations. This mismatch can cause operators or downstream policy systems to grant the skill more trust than warranted, enabling unexpected remote modifications across multiple SmartSaaS resources.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The manifest and top-level description frame this as a narrow dataset helper, but the body documents broad administrative capabilities including projects, tasks, integrations, campaigns, templates, knowledge, calendar, and webhook/cron operations. This mismatch can cause operators or downstream policy systems to grant the skill more trust than warranted, enabling unexpected remote modifications across multiple SmartSaaS resources.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The manifest and top-level description frame this as a narrow dataset helper, but the body documents broad administrative capabilities including projects, tasks, integrations, campaigns, templates, knowledge, calendar, and webhook/cron operations. This mismatch can cause operators or downstream policy systems to grant the skill more trust than warranted, enabling unexpected remote modifications across multiple SmartSaaS resources.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The manifest and top-level description frame this as a narrow dataset helper, but the body documents broad administrative capabilities including projects, tasks, integrations, campaigns, templates, knowledge, calendar, and webhook/cron operations. This mismatch can cause operators or downstream policy systems to grant the skill more trust than warranted, enabling unexpected remote modifications across multiple SmartSaaS resources.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The manifest and top-level description frame this as a narrow dataset helper, but the body documents broad administrative capabilities including projects, tasks, integrations, campaigns, templates, knowledge, calendar, and webhook/cron operations. This mismatch can cause operators or downstream policy systems to grant the skill more trust than warranted, enabling unexpected remote modifications across multiple SmartSaaS resources.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The manifest and top-level description frame this as a narrow dataset helper, but the body documents broad administrative capabilities including projects, tasks, integrations, campaigns, templates, knowledge, calendar, and webhook/cron operations. This mismatch can cause operators or downstream policy systems to grant the skill more trust than warranted, enabling unexpected remote modifications across multiple SmartSaaS resources.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The manifest and top-level description frame this as a narrow dataset helper, but the body documents broad administrative capabilities including projects, tasks, integrations, campaigns, templates, knowledge, calendar, and webhook/cron operations. This mismatch can cause operators or downstream policy systems to grant the skill more trust than warranted, enabling unexpected remote modifications across multiple SmartSaaS resources.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The manifest and top-level description frame this as a narrow dataset helper, but the body documents broad administrative capabilities including projects, tasks, integrations, campaigns, templates, knowledge, calendar, and webhook/cron operations. This mismatch can cause operators or downstream policy systems to grant the skill more trust than warranted, enabling unexpected remote modifications across multiple SmartSaaS resources.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The manifest and top-level description frame this as a narrow dataset helper, but the body documents broad administrative capabilities including projects, tasks, integrations, campaigns, templates, knowledge, calendar, and webhook/cron operations. This mismatch can cause operators or downstream policy systems to grant the skill more trust than warranted, enabling unexpected remote modifications across multiple SmartSaaS resources.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The manifest and top-level description frame this as a narrow dataset helper, but the body documents broad administrative capabilities including projects, tasks, integrations, campaigns, templates, knowledge, calendar, and webhook/cron operations. This mismatch can cause operators or downstream policy systems to grant the skill more trust than warranted, enabling unexpected remote modifications across multiple SmartSaaS resources.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The manifest and top-level description frame this as a narrow dataset helper, but the body documents broad administrative capabilities including projects, tasks, integrations, campaigns, templates, knowledge, calendar, and webhook/cron operations. This mismatch can cause operators or downstream policy systems to grant the skill more trust than warranted, enabling unexpected remote modifications across multiple SmartSaaS resources.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The manifest and top-level description frame this as a narrow dataset helper, but the body documents broad administrative capabilities including projects, tasks, integrations, campaigns, templates, knowledge, calendar, and webhook/cron operations. This mismatch can cause operators or downstream policy systems to grant the skill more trust than warranted, enabling unexpected remote modifications across multiple SmartSaaS resources.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The manifest and top-level description frame this as a narrow dataset helper, but the body documents broad administrative capabilities including projects, tasks, integrations, campaigns, templates, knowledge, calendar, and webhook/cron operations. This mismatch can cause operators or downstream policy systems to grant the skill more trust than warranted, enabling unexpected remote modifications across multiple SmartSaaS resources.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The manifest and top-level description frame this as a narrow dataset helper, but the body documents broad administrative capabilities including projects, tasks, integrations, campaigns, templates, knowledge, calendar, and webhook/cron operations. This mismatch can cause operators or downstream policy systems to grant the skill more trust than warranted, enabling unexpected remote modifications across multiple SmartSaaS resources.

Content

No source excerpt is available for this finding.