Back to skill

Security audit

XMTP

Security checks for vulnerabilities and agentic risk

Overview

This XMTP agent skill is coherent documentation, but several copy-paste examples handle money, files, and group access without enough safeguards.

Install only if you are comfortable treating this as developer reference material that needs hardening before use. Before copying examples into an agent, add explicit transaction previews and user confirmations, keep token amounts as precise integer types, sanitize attachment filenames and constrain download directories, use private or signed attachment storage where appropriate, avoid logging message bodies, protect .env secrets, and add authorization checks for group membership or admin changes.

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

T09 · Insecure Skill Coding Practices

Error
Location
handling-attachments/rules/receive-attachment.md:29
Finding

Arbitrary File Overwrite Through Untrusted Attachment Filename

Content
View full analysis
{ const attachment = await downloadRemoteAttachment( ctx.message.content, agent ); fs.writeFileSync(`./downloads/${attachment.filename}`, attachment.data); await ctx.conversation.sendText(`Saved: ${attachment.filename}`); }); ``` ### Technical Analysis The filename obtained from the received attachment is untrusted, sender-controlled metadata. It is interpolated directly into a filesystem path without sanitization or containment validation. A filename containing path traversal components, such as `../../config.json`, may escape the intended `./downloads` directory. Depending on platform path semantics, absolute paths, alternate separators, and encoded or normalized traversal components may create similar risks. The use of `writeFileSync` overwrites an existing destination by default. Consequently, the example can cause an implementing agent to write attacker-supplied decrypted content to any location writable by the agent process. ### Attack Path 1. An attacker sends an XMTP remote attachment to the agent. 2. The attachment metadata contains a crafted filename such as `../../app/config.json`. 3. `downloadRemoteAttachment` returns the decrypted attachment and its filename. 4. The handler concatenates the filename with `./downloads/`. 5. The filesystem normalizes the resulting traversal path. 6. `writeFileSync` writes attacker-controlled attachment data outside the intended download directory. 7. If the overwritten file is configuration, application code, or another security-relevant resource, subsequent application behavior may be altered. ### Impact Assessment Exploitation allows arbitrary file creation or overwrite within the operating-system p ...[truncated 580 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
building-agents/rules/events-text.md:13
Finding

Disclosure of Private XMTP Message Content Through Application Logs

Content
View full analysis
{ console.log(`Received: ${ctx.message.content}`); await ctx.conversation.sendText("Hello!"); }); ``` ### Technical Analysis The example records the complete contents of every received text message. XMTP messages may contain personal information, authentication material, payment details, private addresses, recovery information, or other confidential content. Although messages are protected during transport, logging their plaintext content creates a secondary unencrypted copy outside the messaging security boundary. Standard output is commonly retained by process managers, container platforms, cloud logging services, or centralized observability systems. No redaction, environment gating, user consent, retention policy, or access-control guidance accompanies the logging example. ### Attack Path 1. A user sends confidential content to the XMTP agent. 2. The text event handler interpolates the complete plaintext message into a log entry. 3. The runtime, container platform, or logging agent captures standard output. 4. The log entry is retained locally or forwarded to a centralized service. 5. An operator, compromised logging account, or attacker with log-reading access retrieves the private message content. An attacker may also deliberately send forged or multiline content to pollute logs and obscure subsequent operational analysis. ### Impact Assessment The issue can disclose complete private conversations to parties that have access to application or centralized logs but are not authorized to access XMTP message content. The scope depends on logging retention, aggregation, and access controls. Potential consequences include: - Exposure of personal or financial information. - Leakage of credentials or ...[truncated 348 chars]
Remediation
View remediation
{ console.log("Received XMTP text message", { messageId: ctx.message.id, contentType: "text", }); await ctx.conversation.sendText("Hello!"); }); ``` ]]>

T09 · Insecure Skill Coding Practices

Error
Location
handling-transactions/rules/send-usdc-transfer.md:32
Finding

Unsafe BigInt-to-Number Conversion in USDC Transfer Amount Parsing

Content
View full analysis
{ const s = raw.trim(); if (!s) return null; // Accept: "2", "2.5", ".5" if (!/^(?:\d+(?:\.\d+)?|\.\d+)$/.test(s)) return null; const [wholePart, fracPartRaw = ""] = s.split("."); const whole = BigInt(wholePart === "" ? "0" : wholePart); const fracPart = fracPartRaw.padEnd(6, "0").slice(0, 6); const frac = BigInt(fracPart === "" ? "0" : fracPart); const units = whole * 1_000_000n + frac; if (units <= 0n) return null; return Number(units); }; ``` ### Technical Analysis The parser initially calculates the amount correctly as an arbitrary-precision `BigInt`, but then converts it to a JavaScript `number`. JavaScript numbers cannot represent every integer above `Number.MAX_SAFE_INTEGER` (`9,007,199,254,740,991`) exactly. The function accepts an unbounded sequence of digits and does not verify that `units` is safely representable before conversion. Large inputs can therefore: - Lose integer precision. - Be rounded to a different amount. - Convert to `Infinity` for sufficiently large values. - Cause downstream transaction encoding or metadata generation to fail or behave inconsistently. Financial values should remain integer types throughout parsing and contract-call encoding. A permissive parser without a business-level maximum also permits transaction requests far beyond expected payment limits. ### Attack Path 1. A user or attacker supplies an oversized but syntactically valid amount. 2. The regular expression accepts the input because it contains only valid decimal syntax. 3. `BigInt` calculates the base-unit amount without overflow. 4. `Number(units)` converts the amount into an unsafe f ...[truncated 1140 chars]
Remediation
View remediation
{ const s = raw.trim(); if (!/^(?:\d+(?:\.\d{1,6})?|\.\d{1,6})$/.test(s)) { return null; } const [wholePart, fractionalPart = ""] = s.split("."); const whole = BigInt(wholePart || "0"); const fraction = BigInt(fractionalPart.padEnd(6, "0") || "0"); const units = whole * 1_000_000n + fraction; if (units <= 0n || units > MAX_USDC_UNITS) { return null; } return units; }; ``` ]]>
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 Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (24)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 37)May include surrounding context.

md
2. Read that sub-skill’s `SKILL.md` and its `rules/` for step-by-step guidance.

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

Scanner excerpt · building-agents/rules/setup-from-env.md (reported line 30)May include surrounding context.

typescript
import { Agent } from "@xmtp/agent-sdk";

// Load .env file
process.loadEnvFile(".env");

// Create agent using environment variables

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

Scanner excerpt · building-agents/rules/setup-from-env.md (reported line 31)May include surrounding context.

md
import { Agent } from "@xmtp/agent-sdk";

// Load .env file
process.loadEnvFile(".env");

// Create agent using environment variables
const agent = await Agent.createFromEnv();

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The documentation explicitly frames the callback as storing encrypted files, but both examples return publicly reachable URLs to the ciphertext stored on third-party infrastructure. Even if the payload is encrypted, publishing stable public locations can expose sensitive metadata, enable unrestricted retention and redistribution of the encrypted blobs, and create a misleading security expectation that the files are privately stored.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill documentation lists a wallet private key and database encryption key as required environment variables, but does not include any warning that these values are sensitive secrets requiring secure storage and careful handling. For markdown files, omitting warnings about behaviors affecting privacy or system integrity is in scope, and credential exposure risk is safety-relevant.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The document instructs users to place highly sensitive private keys directly in environment variables and even warns that key generation appends to an existing .env file, but it does not provide basic secret-handling guidance such as excluding .env from version control, restricting file permissions, rotating compromised keys, or using a secrets manager. In an agent-development context, this omission can lead to accidental disclosure of wallet and database encryption keys through commits, logs, shell history, or shared development environments.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The documentation instructs users to load highly sensitive secrets, including a wallet private key and database encryption key, from a local .env file but provides no guidance on protecting that file, excluding it from version control, or using a secrets manager in production. This can lead to accidental disclosure through commits, logs, backups, or insecure filesystem permissions, especially because the skill directly normalizes storing long-lived private keys in environment-based config.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The skill description uses very broad activation cues like "creating menus," "selection options," and "buttons," which can cause the agent to invoke this skill in contexts that only loosely relate to XMTP inline actions. Over-broad routing increases the chance the wrong skill is selected, leading to incorrect code generation, unsafe configuration advice, or unintended handling logic in security-sensitive agent workflows.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

This markdown file includes an inline action labeled 'Delete' with a danger style, but the surrounding documentation does not mention confirmation, reversibility, or user impact. For markdown files, safety-affecting behaviors should include warnings when they may affect user data or system integrity.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill description uses broad triggers like 'file upload', 'image sending', and 'remote attachment handling', which can cause the skill to be invoked in more situations than intended. In an attachment-handling skill, unintended invocation is risky because it may lead an agent to process, upload, download, or transform user files without sufficiently specific user intent or contextual checks.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill explains that files are encrypted locally and uploaded to a storage provider, but it does not prominently warn that attachment handling changes data flow by causing uploads, downloads, and storage with third-party providers. That omission can mislead downstream agent behavior or users about privacy, retention, and external data exposure risks, especially when handling potentially sensitive files.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The example writes a remotely supplied attachment directly to disk using attachment.filename without validation, sanitization, path normalization, size limits, or safety warnings. An attacker can supply filenames with path traversal sequences or overwrite-targeting names, and the example also encourages persisting untrusted decrypted content to the filesystem, increasing the risk of arbitrary file overwrite, unsafe storage, and resource exhaustion.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The documentation instructs users to send encrypted remote attachments via an upload callback but does not clearly warn that encrypted file bytes, filenames, content types, sizes, and related transport metadata may be sent to a third-party storage service. In a security-sensitive messaging context, this omission can cause developers to assume the operation is fully local or privacy-preserving, leading to unreviewed data egress and weak trust decisions around the upload destination.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The examples instruct developers to transmit encrypted attachments to external providers and expose them via public Pinata/S3 URLs without warning users or implementers about third-party disclosure, persistence, and public accessibility. In an attachment-handling skill, this omission is security-relevant because developers may assume the pattern preserves privacy beyond content encryption and may deploy it for sensitive files without consent or risk review.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

This skill teaches agents to send token transactions and handle wallet calls but does not prominently warn that these actions can move real funds and may be irreversible once approved and broadcast. In an agent-skill context, missing financial-risk disclosure increases the chance that developers expose users to unintended or poorly understood transaction prompts.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The quick-start snippet directly calls sendWalletSendCalls without an adjacent caution that this will submit a transaction request to the user's wallet for potential signing/execution. Copy-pasteable examples in agent documentation are especially risky because developers may adopt them verbatim and present transaction prompts without adequate consent, review, or environment checks.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The guidance shows how to construct and immediately send a USDC transfer request via sendWalletSendCalls without any explicit requirement to obtain fresh user confirmation, display transfer details, or warn that this initiates a value transfer. In an agent framework, omission of these safeguards can normalize unsafe implementations where user-supplied recipient/amount data is turned into wallet actions, increasing the risk of accidental or socially engineered fund transfers.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The documentation shows how to add and remove group members but does not warn that these operations directly modify access control and can exclude users from conversations or expose group content to newly added members. In an agent-building context, developers may copy these examples into automation without adding authorization checks, confirmation flows, or audit logging, increasing the chance of unintended or abusive membership changes.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The description says to use "dm" and "group" events to welcome users "when they start a conversation," but it does not clearly define the exact activation scope or exclusions. This broad phrasing leaves unclear whether the behavior applies to every new DM/group, repeated joins, or other conversation-start scenarios.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The group gating example automatically adds a user to a group solely based on a shared secret delivered over DM, without documenting consent, membership implications, or abuse controls. This can lead to unintended access grants, easy bypass through secret sharing, and unsafe operator copy-paste of a pattern that changes group membership without adequate warnings or validation.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% 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 · resolving-domains/SKILL.md (reported line 122)May include surrounding context.

typescript
const fetchFarcasterProfile = async (name: string) => {
  const response = await fetch(`https://api.web3.bio/profile/${encodeURIComponent(name)}`);
  if (!response.ok) return { address: null, username: null, fid: null };
  const data = await response.json();
  const profile = data?.find((p: any) => p.platform === "farcaster");

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest description says the skill 'triggers on emoji reactions, thinking indicator, or message acknowledgment' without clearly constraining the context or defining exact activation conditions. Terms like 'thinking indicator' and especially 'message acknowledgment' are broad enough to overlap with ordinary chat behavior, which can cause unintended invocation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
77% confidence
Finding

This markdown file documents behavior that reacts to a common everyday message and immediately performs an action by showing the main menu. While not destructive, the documentation provides no user-facing warning or caveat that such common input may trigger the skill, which can lead to unexpected activation behavior.

Content

No source excerpt is available for this finding.

Vague Triggers

Low
Category
Not specified by scanner
Confidence
79% confidence
Finding

The manifest-style description says the skill is used for creating groups, managing members, setting permissions, or sending welcome messages, and then says it "Triggers on group creation, member management, or permissions." While the domain is specific, the activation conditions are still described at a high level without clear boundaries or negative examples, which can make invocation conditions ambiguous.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.