Back to skill

Security audit

moltx-skills

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches its MoltX purpose, but it can sign real blockchain transactions and includes unsafe token-approval and local key/session behaviors users should review carefully.

Install only if you are comfortable letting this runtime manage a local blockchain wallet and sign MoltX transactions. Before use, inspect ~/.moltx/wallet.json handling, keep only small balances in the generated wallet, always pass an explicit approve_token amount and trusted spender, and treat the built-in Supabase/Pimlico/Alchemy endpoints as third-party services that will see operational metadata.

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
runtime/src/tools/core.ts:353
Finding

Unlimited ERC-20 Allowance Is Granted by Default

Content
View full analysis
{ const record = toRecord(args); const token = requiredAddress(record, "token"); const { config, publicClient, walletClient, account } = await getWriteRuntime(); const spender = optionalAddress(record, "spender") ?? DEFAULT_VAULT_ADDRESS; const decimals = await readTokenDecimals(publicClient, token); const amountInput = optionalString(record, "amount"); const amount = amountInput ? parseValue(amountInput, decimals) : maxUint256; const hash = await walletClient.writeContract({ address: token, abi: erc20Abi, functionName: "approve", args: [spender, amount], account, chain: undefined, }); ``` ### Technical Analysis The `approve_token` tool treats both `spender` and `amount` as optional. If `amount` is omitted, the tool grants `maxUint256`, effectively creating an unlimited ERC-20 allowance. It also permits the caller to supply an arbitrary spender address. This exceeds the minimum privilege necessary to fund a specific bounty or deposit. An exact allowance equal to the required transaction amount would normally be sufficient. The command reference lists `approve_token({ token, spender?, amount? })` but does not warn that omitting `amount` grants an unlimited allowance. ERC-20 approval does not itself transfer tokens, but it authorizes the approved spender to call `transferFrom` without another signature until the allowance is revoked or exhausted. The authorization also applies to future token deposits. ### Attack Path 1. A user or agent invokes `approve_token` without an `amount`, believing the omitted parameter has a safe default. 2. Alternatively, malicious task content or unsafe agent reasoning causes an attacker-controlled addr ...[truncated 843 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
runtime/src/tools/config.ts:17
Finding

Billable Third-Party Service Credentials Are Hardcoded in Source

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (50)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The code is narrowly focused on the MoltX council contract and arbitration lifecycle. It reads dispute, juror, and vote state and performs write actions for commitVote, revealVote, finalizeCommit, and finalizeReveal, plus local vote-hash generation. This aligns with 'arbitrator' participation, but not with the broader declared purpose of helping an agent participate as a maker, taker, or prediction trader. Those roles would require separate task/market interaction capabilities not present here. Thus the description overstates the scope and primary purpose of the supplied code chunk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description suggests a domain-specific skill for understanding and participating in MoltX markets or dispute/prediction roles. However, the supplied code only provides generic hash functions and requirement-JSON canonicalization/hash generation. There is no logic for market participation, maker/taker actions, arbitration, prediction trading, or MoltX-specific operations. This is a material description-behavior mismatch because the primary purpose of the code is cryptographic hashing, not MoltX participation.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description suggests a domain-specific skill for interacting with MoltX trading/arbitration/prediction functionality. The supplied code does not implement any maker/taker/arbitrator/trader behavior, market interaction, or MoltX-specific logic. Instead, it is a generic requirement-document processing and hash-verification utility, likely for task/contract integrity checking. This is a materially different primary purpose, so the description does not accurately represent the code.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The declared description suggests a domain skill for understanding MoltX and acting in platform roles like maker, taker, arbitrator, or prediction trader. The supplied code does not implement those activities. Its primary function is authentication/session management via SIWE and Supabase: building a sign-in message, signing with the current wallet, requesting access/refresh tokens, persisting them locally, refreshing them, clearing them, and reporting login status. While authentication may support later MoltX participation, this code chunk's actual purpose is materially narrower and different from the declared purpose, so this is a mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding

The declared description focuses on understanding MoltX and participating in market roles (maker, taker, arbitrator, prediction trader). However, the supplied code chunk only implements get_wallet_info, which inspects stored authentication, runtime config, and wallet signer state to return a wallet address and related metadata. That is a wallet introspection/auth-support capability, not direct participation in MoltX trading or dispute roles. While wallet access may be a supporting component for such participation, this code’s primary purpose is materially narrower and different from the declared purpose, so it should be flagged as a mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The declared purpose suggests end-user or agent-facing functionality for interacting with MoltX roles and workflows. The supplied code does not implement participation in MoltX or provide maker/taker/arbitrator/prediction-trader actions directly; instead, it performs internal test validation of which tools are present in the runtime CLI surface. This is a materially different primary purpose from the description, so it should be flagged as a mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The declared description suggests end-user or agent-facing functionality for interacting with MoltX roles and markets. However, the actual code chunk does not implement or demonstrate participation in MoltX as a maker, taker, arbitrator, or prediction trader, nor does it help explain protocol behavior directly. Instead, it is infrastructure/test code focused on local runtime config defaults and ABI file presence. That is a materially different primary purpose from the declared skill behavior, so this is a description-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description suggests a skill for understanding and participating in the MoltX system in several protocol roles. However, the code chunk only contains unit tests for JSON requirement hashing and verification helpers. It does not implement or expose MoltX participation features, trading, arbitration, or prediction-market behavior. This is a materially different primary purpose, so the description does not accurately represent the code.

Content

No source excerpt is available for this finding.

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
85% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · package.json (reported line 20)May include surrounding context.

json
},
  "scripts": {
    "test": "node --import tsx --test runtime/test/**/*.test.ts",
    "build": "rm -rf runtime/dist && tsc -p runtime/tsconfig.json && cp -R runtime/src/contracts runtime/dist/contracts",
    "dev": "tsx runtime/src/cli.ts"
  },
  "keywords": [

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

approve_token defaults to maxUint256 when no amount is supplied, silently granting unlimited ERC-20 allowance to the spender. In an agent setting, this is especially dangerous because a vague or manipulated request can cause the agent to authorize indefinite token spending, enabling full balance drain if the spender is compromised, malicious, or incorrectly specified.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The prediction-events tool is materially misimplemented: it fetches logs from the core contract address and decodes them with the core ABI, while presenting the result as prediction-contract events. This can cause consumers to make trading, settlement, monitoring, or automation decisions on false data, and it may also permanently skip real prediction events because state is advanced and transaction hashes are marked processed under the wrong stream.

Content

No source excerpt is available for this finding.

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 · runtime/src/tools/siwe.ts (reported line 43)May include surrounding context.

ts
}

/**
 * Returns the stored access token if it exists and has more than 60 seconds remaining.
 * Returns undefined if missing or expired — agent should call siwe_login or siwe_refresh.
 */
export function getStoredJwt(): string | undefined {

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 · skills/moltx-tools/SKILL.md (reported line 74)May include surrounding context.

md
- JWT 有效期 1 小时,`refresh_token` 有效期更长
- `MOLTX_API_JWT` 环境变量优先级高于 `~/.moltx/auth.json`
- `public.current_wallet()` 有两条路径:JWT 里有 `wallet_address` 顶层 claim 时直接读取(快),没有时自动 fallback 到 `auth.identities` 查询(慢)。两条路径均可独立工作
- 可选优化:在 Supabase Dashboard → Authentication → Hooks → Custom Access Token 注册 `public.custom_access_token_hook`,可避免每次请求额外查询 `auth.identities`

## Config / wallet

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The README explicitly documents automatic creation of ~/.moltx/wallet.json for wallet management but provides no warning that private key material or other sensitive wallet data may be written to disk. In a blockchain skill that performs on-chain actions on mainnet, silent persistence of credentials materially increases the risk of key theft from local compromise, backups, or accidental disclosure.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
83% confidence
Finding

The skill explicitly requires Node and instructs the agent to run a local CLI that accesses the filesystem, wallet files, environment variables, and remote APIs, but it declares no tool scope or allowed-tools boundary. That omission increases the chance an agent will grant broader-than-necessary network and local-state access, especially because the skill handles private keys and auth tokens.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill documentation is written in Chinese throughout, while the file does not indicate that Chinese is required or provide an option for another language. This can violate language/locale policy because it imposes a specific language without user opt-in or documented justification.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill tells the agent that the runtime will auto-generate a local private key in ~/.moltx/wallet.json on first use and only later advises backup, without a prominent up-front warning about custody, encryption, file permissions, or the risk of autonomous key creation. In an agent setting, silent creation of spend-capable keys can lead to accidental asset custody, theft from weak local storage, or unauthorized signing under the wrong trust model.

Content

No source excerpt is available for this finding.

Skill Enumeration

Medium
Category
Agent Snooping
Confidence
80% confidence
Finding

Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Content

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

md
## 场景路由

- 发布任务、审核提交、取回赏金:`skills/moltx-maker/SKILL.md`
- 接单、提交、领奖、发起争议:`skills/moltx-taker/SKILL.md`
- 仲裁 commit / reveal / finalize:`skills/moltx-arbitrator/SKILL.md`
- Prediction 预测市场:`skills/moltx-prediction/SKILL.md`

Skill Enumeration

Medium
Category
Agent Snooping
Confidence
80% confidence
Finding

Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Content

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

md
## 场景路由

- 发布任务、审核提交、取回赏金:`skills/moltx-maker/SKILL.md`
- 接单、提交、领奖、发起争议:`skills/moltx-taker/SKILL.md`
- 仲裁 commit / reveal / finalize:`skills/moltx-arbitrator/SKILL.md`
- Prediction 预测市场:`skills/moltx-prediction/SKILL.md`
- 命令参考:`skills/moltx-tools/SKILL.md`

Skill Enumeration

Medium
Category
Agent Snooping
Confidence
80% confidence
Finding

Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Content

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

md
- 发布任务、审核提交、取回赏金:`skills/moltx-maker/SKILL.md`
- 接单、提交、领奖、发起争议:`skills/moltx-taker/SKILL.md`
- 仲裁 commit / reveal / finalize:`skills/moltx-arbitrator/SKILL.md`
- Prediction 预测市场:`skills/moltx-prediction/SKILL.md`
- 命令参考:`skills/moltx-tools/SKILL.md`

Skill Enumeration

Medium
Category
Agent Snooping
Confidence
80% confidence
Finding

Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Content

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

md
- 发布任务、审核提交、取回赏金:`skills/moltx-maker/SKILL.md`
- 接单、提交、领奖、发起争议:`skills/moltx-taker/SKILL.md`
- 仲裁 commit / reveal / finalize:`skills/moltx-arbitrator/SKILL.md`
- Prediction 预测市场:`skills/moltx-prediction/SKILL.md`
- 命令参考:`skills/moltx-tools/SKILL.md`

## 统一原则

Skill Enumeration

Medium
Category
Agent Snooping
Confidence
80% confidence
Finding

Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Content

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

md
- 接单、提交、领奖、发起争议:`skills/moltx-taker/SKILL.md`
- 仲裁 commit / reveal / finalize:`skills/moltx-arbitrator/SKILL.md`
- Prediction 预测市场:`skills/moltx-prediction/SKILL.md`
- 命令参考:`skills/moltx-tools/SKILL.md`

## 统一原则

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

resetAllAgentState replaces all stored state files with empty defaults, which is an irreversible data-loss operation from the perspective of this local state store. The file provides no prompt, warning, or user-facing notice before clearing sync, task, dispute, bet, and processed-event data.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The reset_agent_state tool unconditionally calls resetAllAgentState() and returns success, with no confirmation, authorization check, scope limitation, or warning. In an agent environment, another tool call, prompt injection, or user misunderstanding could trigger irreversible deletion of local workflow/state data, causing loss of synchronization history and potentially forcing unsafe resync or operational mistakes.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
84% confidence
Finding

The file hardcodes external service endpoints and embeds API tokens/keys directly in source for Pimlico and Supabase. While the Supabase token appears to be an anon key and the Pimlico key may be intended for client/server use, hardcoding secrets and forcing traffic to third-party services can leak operational metadata, enable unauthorized consumption of quota, and make key rotation difficult.

Content

Scanner excerpt · runtime/src/tools/config.ts (reported line 24)May include surrounding context.

ts
export const DEFAULT_IDENTITY_ADDRESS = "0xb16aA007A5F0C6dE1A69D0D81412BA6d77c685Ab" as `0x${string}`;
export const DEFAULT_VAULT_ADDRESS = "0x372290907d22544cfa0f75dfe1FCE0eBfcE18cd2" as `0x${string}`;

export const PAYMASTER_URL = "https://api.pimlico.io/v2/8453/rpc?apikey=pim_2V2Kb734c4mRdagDnBGdHc";

// ── API constants (operator-configured, not user-facing) ─────────────────────
export const API_URL = "https://eplsuascoclomzejttgz.supabase.co";