Back to skill

Security audit

问道 Agent SDK

Security checks for vulnerabilities and agentic risk

Overview

This skill mostly matches its game-automation purpose, but it can autonomously approve and spend wallet tokens despite conflicting safety claims.

Review this carefully before installing. Use only a dedicated low-balance agent wallet, avoid passing private keys with --key, choose the defensive strategy if you do not want PK, and do not fund the agent wallet with $JW unless you accept autonomous approvals, deposits, losses, gas costs, and possible token locking. Treat custom API, RPC, and contract-address settings as high risk.

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

Warning
Location
src/cli.ts:27
Finding

Wallet Private Key Accepted Through Command-Line Arguments

Content
View full analysis
", "Agent wallet private key") const privateKey = process.env.AGENT_PRIVATE_KEY || opts.key; ``` The implementation accepts the Agent wallet private key through the `--key` command-line option. Although the CLI warns users and gives precedence to `AGENT_PRIVATE_KEY`, the primary usage examples in both documentation files instruct users to pass the key through this option. ### Technical Analysis Command-line arguments are not an appropriate channel for private keys. Depending on the operating environment, arguments may be exposed through: - Shell history files. - Process inspection utilities and `/proc` metadata. - Terminal session recording. - CI/CD job logs. - Container orchestration metadata. - Monitoring and endpoint-management software. - Wrapper scripts that log invoked commands. The environment-variable alternative reduces shell-history exposure but can still be exposed through process environments, crash dumps, or improperly configured CI systems. A protected secret store, permission-restricted file descriptor, or interactive standard-input mechanism would provide stronger isolation. The affected private key belongs to a funded and contract-authorized Agent wallet. The documentation states that this should not be the NFA owner's main wallet, but the application cannot technically enforce that restriction. ### Attack Path 1. A user follows the documented startup example and supplies the private key with `--key`. 2. The command is retained in shell history, captured in an automation log, or exposed through local process inspection. 3. A local user, monitoring operator, compromised logging service, or other party with access to that data o ...[truncated 898 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
src/agent.ts:178
Finding

Authentication Material Can Be Sent to an Unvalidated API Endpoint

Content
View full analysis
{ if (this.jwt || !this.config.apiUrl) return; try { const timestamp = Math.floor(Date.now() / 1000); const message = `wendao-agent-auth:${this.config.tokenId}:${timestamp}`; const signature = await this.account.signMessage({ message }); const res = await fetch(`${this.config.apiUrl}/api/auth/agent`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ tokenId: this.config.tokenId, agentAddress: this.account.address, signature, timestamp }), }); if (!res.ok) throw new Error(`Agent auth failed: ${res.status}`); const data = await res.json() as { jwt: string }; this.jwt = data.jwt; } catch (e: any) { } } ``` Authenticated battle requests subsequently disclose the bearer token to the same configurable origin: ```typescript const res = await fetch(`${this.config.apiUrl}/api/battle/resolve`, { method: "POST", headers: { "Content-Type": "application/json", "Authorization": `Bearer ${this.jwt}` }, body: JSON.stringify({ tokenId: this.config.tokenId, tier: onChainTier }), }); ``` ### Technical Analysis The Skill permits `apiUrl` to be supplied by the CLI or SDK configuration without: - Requiring HTTPS. - Restricting the destination to the official service. - Rejecting embedded URL credentials. - Binding the authentication signature to the intended API origin. - Including a server-provided nonce in the signed message. - Applying an explicit request timeout. The signed message contains only a static purpose string, token ID, and client-generated timestamp: ```text wendao-agent-au ...[truncated 2365 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
src/agent.ts:256
Finding

Default Automation Can Approve and Spend Tokens Despite Zero-Cost Safety Claims

Content
View full analysis
0n) { await this.walletClient.writeContract({ address: this.config.contracts.token as Address, abi: TOKEN_ABI, functionName: "approve", args: [this.config.contracts.vault as Address, cost * e18], }); } const hash = await this.walletClient.writeContract({ address: this.config.contracts.vault as Address, abi: VAULT_ABI, functionName: "payBreakthrough", args: [BigInt(this.config.tokenId)], }); ``` The default balanced strategy can also initiate token-funded PK: ```typescript shouldPK: (s) => { if (s.isInPK || s.isMeditating) return { should: false, tier: 0 }; const tier = bestAffordableTier(s.jwBalance); return { should: tier >= 0, tier: Math.min(tier, 1) }; }, ``` The PK executor approves and deposits tokens before confirming backend availability: ```typescript const PK_AMOUNTS = [1000n, 5000n, 10000n, 50000n, 100000n]; const amount = PK_AMOUNTS[tier] * (10n ** 18n); await this.walletClient.writeContract({ address: this.config.contracts.token as Address, abi: TOKEN_ABI, functionName: "approve", args: [this ...[truncated 4106 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (45)

Known Vulnerable Dependency: ws==8.18.3 — 2 advisory(ies): CVE-2026-45736 (ws: Uninitialized memory disclosure); CVE-2026-48779 (ws: Memory exhaustion DoS from tiny fragments and data chunks)

High
Category
Supply Chain
Confidence
93% confidence
Finding

The lockfile includes ws 8.18.3 via viem/isows, and the cited advisories indicate memory disclosure and memory-exhaustion denial of service risks in WebSocket handling. Because viem can establish network WebSocket connections in runtime contexts, this dependency is more security-relevant than a build-only tool and could affect any agent skill that connects to untrusted or attacker-controlled WebSocket endpoints.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The introduction prominently advertises autonomous on-chain actions, PK, breakthrough, and periodic on-chain writes, but does not immediately warn that these behaviors can trigger real transactions, consume gas, interact with a backend, and in some modes spend tokens. In a wallet/agent context, omission of clear upfront risk disclosure materially increases the chance of unsafe user adoption and unintended financial impact.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The usage examples instruct users to pass a private key directly on the command line, which is commonly exposed through shell history, process listings, logging, CI output, and terminal capture. Even though the README frames this as a lower-value agent wallet, it still controls a signing key capable of executing transactions and potentially spending gas or $JW in PK mode.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The README makes a strong safety claim that the agent wallet can only perform zero-cost operations and does not use $JW, but other sections explicitly describe PK flows involving approve, depositPK, and FAQ text stating PK deducts $JW from the agent wallet. This contradiction can mislead users into funding or authorizing the agent under false assumptions about spend capability, increasing the chance of unintended token loss.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The FAQ assures users that the agent cannot transfer or affect $JW, yet the same README states PK requires $JW and deducts it from the agent wallet. Conflicting safety assertions in security-sensitive wallet software are dangerous because users may rely on the false statement and expose funds or permissions they otherwise would not.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The documentation instructs users to pass a blockchain private key directly on the command line (--key 0x...). Command-line secrets are commonly exposed through shell history, process listings, logs, telemetry, and screenshots, which can lead to theft of control over the agent wallet. In this skill’s context, that key authorizes on-chain actions and holds gas funds, so compromise enables unauthorized transactions and abuse of the delegated agent permissions.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The module comment says '仅 Agent 需要的函数' ('only the functions the Agent needs'), implying a limited, purpose-scoped interface. However, the exported ABIs include numerous powerful nonpayable operations such as token transfers/approvals, staking, reward claims, PK settlement/cancellation, and character progression updates, which is materially broader than a minimal or clearly constrained agent-only surface.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The comment states that freezing config prevents external modification and includes the private key as if this meaningfully protects it. However, Object.freeze only prevents mutation; the raw private key remains stored in this.config and accessible to any code with a reference to the agent instance. This is a documentation-to-code contradiction about how sensitive key material is handled.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The agent initializes a LearningTree with a persistent JSON path, which implies ongoing writes to a local file. Although there is an internal comment about using a persistence path, there is no user-facing prompt, warning, or disclosure indicating that the skill stores data on disk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This POST request sends tokenId, agentAddress, signature, and timestamp to a configured remote API endpoint. While the code logs success or failure afterward, it does not clearly warn beforehand that identity-related wallet data will be transmitted off-chain to an external service.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill posts token and tier data with bearer authentication to an external API for PK recovery. Although this network behavior is part of the PK flow, the code does not provide a clear prior user-facing warning that external API calls and token-related data sharing will occur.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This fetch call sends tokenId and tier to a remote battle-resolution endpoint using bearer authentication. The skill logs outcomes after the fact, but it does not clearly disclose ahead of time that PK actions depend on backend network calls and associated data transmission.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The 'status' command accepts a private key via '--key' but, unlike the 'start' command, does not warn users that command-line arguments are commonly exposed through shell history and process inspection. This creates a realistic secret-exposure path for a blockchain private key, which could lead to wallet compromise and asset theft if the key is captured.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The method submits a behavior-derived Merkle root to an on-chain contract with no built-in user disclosure, review step, or policy gate. On-chain publication is durable and hard to reverse; even if only the root is published, it creates an immutable commitment to activity data that can later be linked to off-chain logs or used for tracking and auditing beyond user expectations.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

This code silently persists behavior-derived Merkle leaves to a caller-specified path without any built-in consent, notice, retention control, or file-permission hardening. Even though only hashes are stored, they are durable telemetry about agent activity and may become sensitive when correlated with timestamps, actions, or other local artifacts; a weak or shared filesystem location could expose this history to other local users or processes.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
78% confidence
Finding

The comment at L01 says '仅 Agent 需要的函数' ('only the functions the Agent needs'), which suggests a narrowly scoped interface. However, the file exposes many powerful nonpayable operations such as token approval/transfer, staking, PK settlement/cancellation, and character progression functions, which is broader than a minimal read-only or narrowly bounded agent interface. Without a manifest, this is best treated as a documentation-to-code divergence rather than a manifest mismatch.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The top-level natural-language description identifies the agent entirely in Chinese ('NFA 自主修仙 Agent', '标准 Agent Skill 实现'), and the rest of the user-facing logs/messages are also hard-coded in Chinese. There is no indication that the skill offers a language choice or that the Chinese-only locale is a documented, justified regional requirement.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The file exposes a function that performs a blockchain state-changing write via walletClient.writeContract(...) without any user-facing consent, warning, cost disclosure, or confirmation step in this component. In an agent/skill context, that can cause unexpected on-chain transactions, gas expenditure, and irreversible state updates if higher-level callers invoke it automatically or with attacker-influenced parameters.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The skill content, instructions, and operational guidance are presented entirely in Chinese, with no indication that users may select another language or that the skill is intentionally limited to a Chinese-speaking audience. Under the stated policy, forcing a specific language without opt-in is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The only natural-language documentation in this file is the Chinese comment "合约 ABI — 仅 Agent 需要的函数", which fixes the file's explanatory text to a single language. Under the policy, language-specific text without offering a user choice or documenting a justified locale constraint is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The natural-language comment is written as '仅 Agent 需要的函数', which indicates a Chinese-only locale choice in the file's user-facing/documentary text. Under the policy, forcing a specific language without opt-in can be a locale/language policy issue, and there is no indication here that users may choose another language.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

This declaration file includes multiple natural-language comments such as '注册事件回调' and '读取链上完整状态' in Chinese, but provides no indication that the skill is Chinese-only or that users can opt into a language/locale. Under the policy, forcing a specific language without user choice can be a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

Natural-language strings in the file, including the top-level usage text and command descriptions, are presented exclusively in Chinese with no opt-in or alternative locale. This can violate language/locale policy when a skill forces one language for all users instead of offering a choice or documenting a justified regional scope.

Content

No source excerpt is available for this finding.