Back to skill

Security audit

Twilio Comms

Security checks for vulnerabilities and agentic risk

Overview

This is a genuine Twilio communications CLI, but it can use live credentials to immediately contact real recipients and has limited safety guardrails, so users should review it before installing.

Install only if you intend to let the agent use your Twilio account for real communications. Use test credentials or restricted Twilio numbers where possible, confirm recipient consent and expected charges before sends or calls, avoid passing untrusted text to voice-call messages, and protect verification codes and Twilio environment variables.

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/twilio_comms.py:104
Finding

Unescaped Call Message Permits TwiML/XML Injection

Content
View full analysis
{msg}' data["Twiml"] = twiml ``` ### Technical Analysis The user-controlled `--message` value is interpolated directly into an XML document without XML escaping or structural validation. An input containing XML metacharacters or TwiML elements can terminate the intended `` element and introduce additional TwiML verbs. Twilio parses the resulting document as executable call instructions. Consequently, an input intended only to provide spoken text may alter the call flow. Exploitability depends on an attacker being able to influence the value passed to `--message`, such as through an automation workflow that forwards untrusted content to this CLI. ### Attack Path 1. An attacker supplies or influences a message containing crafted TwiML markup. 2. An automation process invokes `call-make` and passes that content through `--message`. 3. The script inserts the content directly between `` and `` without escaping. 4. The generated TwiML is submitted to Twilio through the authenticated account. 5. Twilio interprets the injected elements as call instructions rather than spoken text. 6. The call may perform unintended actions allowed by the account and Twilio’s TwiML processing rules. ### Impact Assessment Successful exploitation can modify outbound call behavior under the privileges of the configured Twilio account. Depending on the injected TwiML and account configuration, this could cause calls to contact unintended destinations, redirect call processing, initiate recording behavior, disclose call content, or incur unexpected telephony charges. The issue does not grant local operating-system privileges or expose the Twilio au ...[truncated 116 chars]
Remediation
View remediation
` using a standard routine such as `xml.sax.saxutils.escape`. - Prefer Twilio’s supported TwiML response builder so user input is represented as text rather than concatenated markup. - Reject invalid XML control characters and enforce a reasonable message-length limit. - Keep raw TwiML support separate from plain-text message support. If raw TwiML is ever required, expose it only through an explicitly privileged option and validate allowed TwiML verbs and attributes. - Add tests using payloads containing `<`, `>`, `&`, quotes, closing `` tags, and additional TwiML elements to verify that they remain spoken text. Example hardening: ```python from xml.sax.saxutils import escape msg = args.message or "Hello, this is an automated call." safe_msg = escape(msg) twiml = ( '' f"{safe_msg}" ) data["Twiml"] = twiml ``` ]]>

T09 · Insecure Skill Coding Practices

Note
Location
scripts/twilio_comms.py:277
Finding

Verification Code Exposed Through Command-Line Arguments

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (7)

Tainted flow: 'vsid' from os.environ.get (line 175, credential/environment) → requests.post (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/twilio_comms.py (reported line 185)May include surrounding context.

python
def verify_send(args):
    vsid = get_verify_sid()
    sid, token, auth = get_auth()
    r = requests.post(
        f"https://verify.twilio.com/v2/Services/{vsid}/Verifications",
        auth=auth,
        data={"To": args.to, "Channel": args.channel}

Tainted flow: 'vsid' from os.environ.get (line 175, credential/environment) → requests.post (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/twilio_comms.py (reported line 204)May include surrounding context.

python
def verify_check(args):
    vsid = get_verify_sid()
    sid, token, auth = get_auth()
    r = requests.post(
        f"https://verify.twilio.com/v2/Services/{vsid}/VerificationCheck",
        auth=auth,
        data={"To": args.to, "Code": args.code}

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
96% confidence
Finding

The skill advertises capabilities that require access to environment variables and outbound network communication, but it does not declare an explicit tool scope such as permissions or allowed-tools. This weakens reviewability and containment, because an agent could access Twilio secrets from the environment and contact external services without clear, user-visible authorization boundaries.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This skill enables sending SMS, WhatsApp messages, voice calls, and verification codes to real recipients, but it does not include clear warnings about privacy exposure, carrier or API billing, consent, or the risk of contacting unintended third parties. In an agent context, that omission increases the chance of misuse, accidental spam, disclosure of personal data, and unexpected charges.

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 · scripts/twilio_comms.py (reported line 11)May include surrounding context.

python
import requests
from requests.auth import HTTPBasicAuth

BASE = "https://api.twilio.com/2010-04-01"


def get_auth():

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The script reads Twilio credentials from environment variables and uses them to authenticate outbound HTTP requests, but there is no comment, docstring, or user-facing notice explaining that credentials and communication metadata are being used and transmitted. For a code file handling credentials and remote API calls, the lack of disclosure meets the missing-warning criteria.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill can send SMS messages and place voice calls immediately from CLI arguments without any confirmation, dry-run mode, rate limiting, or destination allowlisting. In an agent or automation setting, this increases the risk of unintended outbound communications, spam, toll fraud, social-engineering abuse, or costly actions triggered by prompt injection or operator error.

Content

No source excerpt is available for this finding.