Back to skill

Security audit

Torch Domain Auction Bot

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly coherent with its Solana DeFi bot purpose, but it has review-worthy risk from unpinned npm execution, automatic fund-moving actions, and unvalidated metadata URL fetching.

Review before installing. Prefer an exact pinned package or a verified local audited build, run it in a restricted container or account, omit SOLANA_PRIVATE_KEY unless you truly need a stable controller wallet, fund the vault minimally, and restrict outbound network access so untrusted token metadata cannot reach localhost, private networks, or cloud metadata services.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (2)

T09 · Insecure Skill Coding Practices

Error
Location
lib/torchsdk/tokens.js:272
Finding
Unrestricted On-Chain Metadata URL Fetch Enables Server-Side Request Forgery<![CDATA[ ## Vulnerability Details **File Location**: `lib/torchsdk/tokens.js:272-276`; supporting fetch implementation at `lib/torchsdk/gateway.js:30-41` **Vulnerability Type**: Server-Side Request Forgery (SSRF) **Risk Level**: High ### Vulnerable Code ```js // lib/torchsdk/tokens.js:272-276 const uri = (0, program_1.decodeString)(bondingCurve.uri); if (uri) { try { const res = await (0, gateway_1.fetchWithFallback)(uri); const data = (await res.json()); ``` The destination is subsequently fetched without an allowlist or network-address validation: ```js // lib/torchsdk/gateway.js:30-41 const fetchWithFallback = async (url, options, timeoutMs = 10000) => { const controller = new AbortController(); const timer = setTimeout(() => controller.abort(), timeoutMs); const opts = { ...options, signal: controller.signal }; try { // If it's an Irys gateway URL, use uploader directly (gateway has SSL issues) if ((0, exports.isIrysUrl)(url)) { const uploaderUrl = (0, exports.irysToUploader)(url); return await fetch(uploaderUrl, opts); } // For non-Irys URLs, fetch normally return await fetch(url, opts); ``` ### Technical Analysis The metadata URI is decoded from a token's on-chain bonding-curve account. A token creator can therefore control this value. Although the gateway helper specially handles Irys URLs, every other URI is passed directly to `fetch()`. The implementation does not: - Restrict the scheme to HTTPS. - Restrict requests to approved metadata gateways. - Reject loopback, link-local, private, multicast, or reserved IP ranges. - Resolve and validate DNS addresses before connecting. - Validate redirect destinations. - Restrict response size or verify that the response is JSON. The monitor invokes `getToken()` for discovered tokens with active loans. Consequently, this request can occur automatically during normal unattended operation rather than only in ...[truncated 1987 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Allow only `https:` metadata URLs. 2. Prefer an explicit hostname allowlist for trusted content-addressed gateways, such as approved Irys hosts. 3. Parse the URL before use and reject embedded credentials, malformed hosts, unexpected ports, and non-HTTP protocols. 4. Resolve the hostname before connecting and reject every address in loopback, link-local, private, multicast, unspecified, and reserved ranges for both IPv4 and IPv6. 5. Disable automatic redirects or validate the destination of every redirect using the same scheme, hostname, and resolved-address controls. 6. Defend against DNS rebinding by ensuring the validated address is the address used for the connection. 7. Limit response size, set strict connection and read timeouts, and require an appropriate JSON content type. 8. Consider retrieving metadata through a hardened proxy with no access to internal networks. 9. Treat token metadata as untrusted input and avoid fetching it in the automatic liquidation path unless it is operationally necessary. ]]>

T08 · Insecure Dependencies

Warning
Location
SKILL.md:36
Finding
Unpinned Registry Package Execution Creates Supply-Chain Risk<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:36-39` and `SKILL.md:264` **Vulnerability Type**: Unpinned third-party package installation and execution **Risk Level**: Medium ### Vulnerable Configuration ```yaml install: - id: npm-torch-domain-auction-bot kind: npm package: torch-domain-auction-bot@^2.0.1 flags: [] label: "Install Torch Domain Auction Bot (npm, optional -- SDK is bundled in lib/torchsdk/, kit is in lib/kit/)" ``` The usage instructions then execute the package through `npx`: ```bash VAULT_CREATOR=<vault-creator-pubkey> SOLANA_RPC_URL=<rpc-url> npx torch-domain-auction-bot monitor ``` ### Technical Analysis The caret version range `^2.0.1` permits later compatible releases instead of requiring the exact audited release. The `npx` command can also retrieve and execute a package from the npm registry when an appropriate local executable is unavailable. As a result, the code executed by a user or agent runner is not guaranteed to be the same code contained in and reviewed from this artifact. This weakens the security value of bundling an auditable SDK under `lib/torchsdk/`. The compiled kit also imports `torchsdk` by package name: ```js const torchsdk_1 = require("torchsdk"); ``` This means runtime module resolution may select a registry-installed dependency rather than the bundled `lib/torchsdk/` source unless packaging explicitly maps that name to the audited local copy. This finding does not establish that the current npm package is malicious. It identifies an unsafe supply-chain configuration that permits the effective executable payload to change after this artifact has been reviewed. ### Attack Path 1. A malicious compatible package version is published, or the npm publisher account/package distribution is compromised. 2. The installation declaration resolves `torch-domain-auction-bot@^2.0.1` to that newer version. 3. Alternatively, `npx torch-domain-auction-bot monitor` downloads a registry ve ...[truncated 1262 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Pin the bot package to an exact reviewed version rather than using a caret range: ```yaml package: torch-domain-auction-bot@2.0.1 ``` 2. Verify the package using a trusted integrity hash or signed provenance. 3. Commit and enforce a lockfile with integrity metadata for all transitive dependencies. 4. Avoid bare `npx` execution. Invoke a verified local binary with package downloads disabled. 5. Disable dependency lifecycle scripts where operationally possible. 6. Change imports to explicit relative paths when the bundled SDK is intended to be authoritative, or provide a packaging configuration that guarantees `require("torchsdk")` resolves to the audited bundled implementation. 7. Run the bot in a restricted container or operating-system account with minimal filesystem and network permissions. 8. Provide the optional private key only when persistent controller identity is necessary; otherwise continue using an ephemeral keypair. 9. Monitor dependency ownership, release provenance, and checksums before accepting upgrades. ]]>
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • Memory PoisoningPersistent Context Injection, Context Window Stuffing, Memory Manipulation
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (60)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
The skill queries generic token data, holder lists, vault state, memos/messages, and external metadata/price services in ways that are broader than a concise domain-lending description implies. This matters because it expands observable data collection and system reach, which should be transparent before operators provide RPC access and optional signing keys.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
The skill queries generic token data, holder lists, vault state, memos/messages, and external metadata/price services in ways that are broader than a concise domain-lending description implies. This matters because it expands observable data collection and system reach, which should be transparent before operators provide RPC access and optional signing keys.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
The skill queries generic token data, holder lists, vault state, memos/messages, and external metadata/price services in ways that are broader than a concise domain-lending description implies. This matters because it expands observable data collection and system reach, which should be transparent before operators provide RPC access and optional signing keys.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The skill queries generic token data, holder lists, vault state, memos/messages, and external metadata/price services in ways that are broader than a concise domain-lending description implies. This matters because it expands observable data collection and system reach, which should be transparent before operators provide RPC access and optional signing keys.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The skill queries generic token data, holder lists, vault state, memos/messages, and external metadata/price services in ways that are broader than a concise domain-lending description implies. This matters because it expands observable data collection and system reach, which should be transparent before operators provide RPC access and optional signing keys.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The skill queries generic token data, holder lists, vault state, memos/messages, and external metadata/price services in ways that are broader than a concise domain-lending description implies. This matters because it expands observable data collection and system reach, which should be transparent before operators provide RPC access and optional signing keys.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The skill queries generic token data, holder lists, vault state, memos/messages, and external metadata/price services in ways that are broader than a concise domain-lending description implies. This matters because it expands observable data collection and system reach, which should be transparent before operators provide RPC access and optional signing keys.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The skill queries generic token data, holder lists, vault state, memos/messages, and external metadata/price services in ways that are broader than a concise domain-lending description implies. This matters because it expands observable data collection and system reach, which should be transparent before operators provide RPC access and optional signing keys.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The skill queries generic token data, holder lists, vault state, memos/messages, and external metadata/price services in ways that are broader than a concise domain-lending description implies. This matters because it expands observable data collection and system reach, which should be transparent before operators provide RPC access and optional signing keys.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The skill queries generic token data, holder lists, vault state, memos/messages, and external metadata/price services in ways that are broader than a concise domain-lending description implies. This matters because it expands observable data collection and system reach, which should be transparent before operators provide RPC access and optional signing keys.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The skill queries generic token data, holder lists, vault state, memos/messages, and external metadata/price services in ways that are broader than a concise domain-lending description implies. This matters because it expands observable data collection and system reach, which should be transparent before operators provide RPC access and optional signing keys.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The skill queries generic token data, holder lists, vault state, memos/messages, and external metadata/price services in ways that are broader than a concise domain-lending description implies. This matters because it expands observable data collection and system reach, which should be transparent before operators provide RPC access and optional signing keys.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The skill queries generic token data, holder lists, vault state, memos/messages, and external metadata/price services in ways that are broader than a concise domain-lending description implies. This matters because it expands observable data collection and system reach, which should be transparent before operators provide RPC access and optional signing keys.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
The skill queries generic token data, holder lists, vault state, memos/messages, and external metadata/price services in ways that are broader than a concise domain-lending description implies. This matters because it expands observable data collection and system reach, which should be transparent before operators provide RPC access and optional signing keys.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The skill queries generic token data, holder lists, vault state, memos/messages, and external metadata/price services in ways that are broader than a concise domain-lending description implies. This matters because it expands observable data collection and system reach, which should be transparent before operators provide RPC access and optional signing keys.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The skill queries generic token data, holder lists, vault state, memos/messages, and external metadata/price services in ways that are broader than a concise domain-lending description implies. This matters because it expands observable data collection and system reach, which should be transparent before operators provide RPC access and optional signing keys.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding
The skill queries generic token data, holder lists, vault state, memos/messages, and external metadata/price services in ways that are broader than a concise domain-lending description implies. This matters because it expands observable data collection and system reach, which should be transparent before operators provide RPC access and optional signing keys.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
The skill queries generic token data, holder lists, vault state, memos/messages, and external metadata/price services in ways that are broader than a concise domain-lending description implies. This matters because it expands observable data collection and system reach, which should be transparent before operators provide RPC access and optional signing keys.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding
The skill queries generic token data, holder lists, vault state, memos/messages, and external metadata/price services in ways that are broader than a concise domain-lending description implies. This matters because it expands observable data collection and system reach, which should be transparent before operators provide RPC access and optional signing keys.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding
The skill queries generic token data, holder lists, vault state, memos/messages, and external metadata/price services in ways that are broader than a concise domain-lending description implies. This matters because it expands observable data collection and system reach, which should be transparent before operators provide RPC access and optional signing keys.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The skill queries generic token data, holder lists, vault state, memos/messages, and external metadata/price services in ways that are broader than a concise domain-lending description implies. This matters because it expands observable data collection and system reach, which should be transparent before operators provide RPC access and optional signing keys.

Direct Prompt Extraction

High
Category
System Prompt Leakage
Content
if (!vault) throw new Error(...)

const link = await getVaultForWallet(connection, config.walletKeypair.publicKey.toBase58())
if (!link) { /* print instructions, exit */ }
```

Both checks execute before any command (monitor, launch, info). The bot cannot operate without a valid vault and linked agent.
Confidence
85% confidence
Finding
Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Context-Inappropriate Capability

High
Confidence
95% confidence
Finding
buildWithdrawTokensTransaction constructs a withdrawal from a vault-controlled token account to any destination address supplied by the caller, creating a powerful exfiltration primitive. Even if the on-chain program restricts execution to the vault authority, exposing this arbitrary withdrawal capability inside an agent skill makes prompt-injection, misconfiguration, or unsafe tool-use far more likely to result in unauthorized asset transfer attempts or successful theft by a compromised authority workflow.

Memory Manipulation

High
Category
Memory Poisoning
Content
})))
            .instruction();
    };
    // Helper: build the swap instruction
    const buildSwapIx = async () => {
        return program.methods
            .swapFeesToSol(new anchor_1.BN(minimum_amount_out.toString()))
Confidence
85% confidence
Finding
Skill manipulates agent memory, state, or stored context. Memory corruption can alter personality, override safety rules, or cause unpredictable behavior.

Lp3

Medium
Category
MCP Least Privilege
Confidence
96% confidence
Finding
The skill declares powerful capabilities through environment access and broad outbound network use, but it does not define an explicit tool scope such as permissions or allowed-tools. In an agent ecosystem, missing least-privilege boundaries increases the risk that the skill can access secrets and external services beyond what operators expect, especially since it also performs transaction signing and liquidation actions.

Static analysis

No suspicious patterns detected.