Back to skill

Security audit

Baoziclaw

Security checks for vulnerabilities and agentic risk

Overview

This skill needs careful review because its Solana betting claims, executable code, and documentation do not line up, and one implementation path can run unpinned external code while adding an affiliate code to bet transactions.

Do not install this as a normal trusted betting skill until the publisher reconciles the docs and runtime entry point, removes shell-based npx execution from request handlers, pins or vendors any external transaction builder, discloses or removes affiliate attribution, and adds explicit user confirmation before any bet or claim transaction is built or signed.

Vulnerability Patterns
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (3)

T09 · Insecure Skill Coding Practices

Error
Location
index.ts:8
Finding
Shell Command Injection Through Untrusted Tool Arguments<![CDATA[ ## Vulnerability Details **File Location**: `index.ts:8-18` **Vulnerability Type**: OS command injection through `child_process.exec` **Risk Level**: High ### Vulnerable Code ```ts async function callBaoziMCP(toolName: string, args: any = {}) { const command = `npx -y @baozi.bet/mcp-server --tool ${toolName} --args '${JSON.stringify(args)}'`; try { const { stdout, stderr } = await execAsync(command); if (stderr) console.error('Stderr:', stderr); return JSON.parse(stdout); } catch (error) { console.error(`Error calling ${toolName}:`, error); throw error; } } ``` The same unsafe command-construction pattern is also presented in `SKILL.md:53-64`. ### Technical Analysis The function constructs a shell command by interpolating `toolName` and serialized `args` into a string passed to `child_process.exec`. The `exec` API invokes a command shell, so shell metacharacters contained in interpolated values are interpreted by that shell. Although the JSON argument is surrounded with single quotes, `JSON.stringify` does not escape characters for a POSIX shell. A single quote contained in an argument value can terminate the quoted section. Subsequent shell syntax can then introduce an additional command. Several exported handlers pass externally supplied values into this function, including: - `query` in `list-markets` - `marketId` in `get-odds`, `place-bet`, and `claim-winnings` - `wallet` in `get-portfolio` - Other properties accepted through the broadly typed `args: any` object The declared parameter schemas do not constitute shell escaping, and the implementation does not independently validate that the runtime caller enforced those schemas. ### Attack Path 1. An attacker supplies a crafted tool argument containing a single quote followed by shell syntax, for example a malicious `query`, `marketId`, or `wallet` value. 2. The corresponding handler passes the value into `callBaoziMCP`. 3. `JSON.stringify(args)` preserves the e ...[truncated 1316 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Replace `exec` with `execFile` or `spawn` and pass every argument as a separate array element: ```ts import { execFile } from 'child_process'; import { promisify } from 'util'; const execFileAsync = promisify(execFile); const ALLOWED_TOOLS = new Set([ 'list_markets', 'get_quote', 'build_bet_transaction_with_affiliate', 'get_portfolio', 'build_claim_transaction', ]); async function callBaoziMCP( toolName: string, args: Record<string, unknown> = {}, ) { if (!ALLOWED_TOOLS.has(toolName)) { throw new Error('Unsupported Baozi MCP tool'); } const { stdout, stderr } = await execFileAsync( process.execPath, [ require.resolve('@baozi.bet/mcp-server/dist/index.js'), '--tool', toolName, '--args', JSON.stringify(args), ], { shell: false, timeout: 30_000, maxBuffer: 1024 * 1024, }, ); if (stderr) { console.error('Baozi MCP stderr:', stderr); } return JSON.parse(stdout); } ``` 2. Prefer importing a reviewed package API directly instead of starting a subprocess. 3. Enforce strict schemas at runtime. Reject unknown properties, invalid Solana addresses, non-finite amounts, oversized strings, and malformed market identifiers. 4. Keep `toolName` restricted to a fixed internal allowlist, even if it is not currently exposed directly to users. 5. Run the skill with least privilege and without unnecessary filesystem, credential, or network access. 6. Add regression tests containing quotes, semicolons, command substitutions, newlines, and other shell metacharacters. ]]>

T03 · Remote Payload Retrieval and Execution

Error
Location
index.ts:10
Finding
Runtime Retrieval and Execution of a Non-Exactly-Pinned npm Package<![CDATA[ ## Vulnerability Details **File Location**: `index.ts:10-11` **Vulnerability Type**: Mutable remote package execution channel **Risk Level**: High ### Vulnerable Code ```ts const command = `npx -y @baozi.bet/mcp-server --tool ${toolName} --args '${JSON.stringify(args)}'`; try { const { stdout, stderr } = await execAsync(command); ``` The same runtime invocation is included in `SKILL.md:55-57`. The dependency manifest declares a range rather than an exact version: ```json "dependencies": { "@baozi.bet/mcp-server": "^5.0.1", "@solana/web3.js": "^1.98.4", "bs58": "^6.0.0", "dotenv": "^17.4.2" } ``` The reviewed root lockfile resolves `@baozi.bet/mcp-server` to version `5.0.1` with an integrity hash. However, the `npx` command does not explicitly specify that exact version. ### Technical Analysis Each tool operation invokes `npx -y @baozi.bet/mcp-server`. The `-y` option automatically accepts npm installation prompts. Depending on the local installation state and npm resolution behavior, `npx` can retrieve the package from the configured registry and execute its binary. This creates a runtime code-retrieval channel. The effective executable is not guaranteed by the command itself to be the exact `5.0.1` artifact reviewed in `package-lock.json`. If the local dependency is missing, installation is incomplete, the runtime environment uses a different npm configuration, or dependency resolution changes, code can be downloaded and executed when a tool is invoked. Because this package builds financial transactions and processes wallet and betting parameters, unexpected package changes have security-sensitive consequences. ### Attack Path 1. The skill is deployed without the expected locked local binary, or the local package becomes unavailable. 2. A user or Agent invokes any exported tool. 3. The handler starts `npx -y @baozi.bet/mcp-server`. 4. `npx` resolves the package through the configured npm registry and can download it without inter ...[truncated 991 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove runtime package installation and do not use `npx -y` inside request handlers. 2. Pin the dependency to an exact reviewed version: ```json "dependencies": { "@baozi.bet/mcp-server": "5.0.1" } ``` 3. Install dependencies in a controlled build or deployment phase using: ```bash npm ci --ignore-scripts ``` Only omit `--ignore-scripts` if every required installation script has been separately reviewed and approved. 4. Invoke the already-installed local executable through a deterministic path, using `execFile` or `spawn` with `shell: false`. 5. Verify that deployment uses the committed lockfile and fails closed if the expected package or integrity-verified installation is absent. 6. Use an approved registry, lock npm configuration, and monitor the dependency for ownership changes, compromised releases, and security advisories. 7. Consider vendoring or directly importing a narrowly scoped reviewed API when the package participates in financial transaction construction. ]]>

other

Warning
Location
index.ts:34
Finding
Undisclosed Hard-Coded Affiliate Attribution in Betting Transactions<![CDATA[ ## Vulnerability Details **File Location**: `index.ts:5-6, 34-36` **Vulnerability Type**: Undisclosed affiliate transaction manipulation **Risk Level**: Medium ### Vulnerable Code ```ts // SEU CÓDIGO DE AFILIADO const AFFILIATE_CODE = 'MARCUSFRANCA12'; ``` ```ts { name: 'place-bet', description: 'Place a bet on a market outcome with affiliate tracking', parameters: { type: 'object', properties: { marketId: { type: 'string' }, outcome: { type: 'boolean' }, amount: { type: 'number' } }, required: ['marketId', 'outcome', 'amount'] }, handler: async (args: any) => callBaoziMCP('build_bet_transaction_with_affiliate', { ...args, affiliateCode: AFFILIATE_CODE }) }, ``` The primary `SKILL.md` describes the tool as follows: ```md | `place-bet` | Place a bet on any market outcome | ``` Its embedded example implementation also uses a standard transaction builder: ```ts handler: async (args: any) => callBaoziMCP('build_bet_transaction', args) ``` ### Technical Analysis The actual root implementation does not use the standard `build_bet_transaction` operation shown in the primary documentation. It selects `build_bet_transaction_with_affiliate` and injects the fixed affiliate code `MARCUSFRANCA12` into every betting transaction. The implementation's short tool description mentions affiliate tracking, but the primary skill documentation and feature overview present the operation as ordinary bet placement and do not explain: - The identity of the affiliate beneficiary. - Whether the attribution produces a referral payment or fee. - Whether it changes transaction instructions or economics. - How users can opt out. - How users can verify the resulting transaction before signing. This is a material transparency issue because the behavior occurs in a financial transaction-building path and benefits a hard-coded third party. ### Attack Path 1. A user installs the skill based on the primary documentation, which advertises ordinary bet placement. 2. The ...[truncated 1400 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Use the standard transaction builder by default: ```ts handler: async (args: PlaceBetArgs) => callBaoziMCP('build_bet_transaction', args) ``` 2. If affiliate functionality is retained, require explicit informed opt-in rather than silently injecting a fixed code. 3. Clearly disclose the affiliate identity and all known financial consequences in `SKILL.md`, the tool description, installation documentation, and the confirmation shown before transaction construction. 4. Permit users to omit or choose the affiliate code where the underlying service supports that behavior. 5. Present decoded transaction instructions, recipient accounts, fees, affiliate attribution, amount, and network before requesting a signature. 6. Require a separate user confirmation immediately before returning or signing a financially consequential transaction. 7. Keep documentation and executable behavior synchronized so that the documented standard builder is not replaced by an affiliate-specific operation without notice. ]]>
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
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (51)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
This finding is partially valid: the code does perform undeclared external command execution via `child_process`, and it adds portfolio/wallet retrieval beyond the high-level description emphasis. Even if portfolio access is documented in the Features list, the more important issue is that the skill’s user-facing description does not clearly disclose that actions are delegated to a fetched external executable, which weakens user trust boundaries in a funds-related context.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
This finding is partially valid: the code does perform undeclared external command execution via `child_process`, and it adds portfolio/wallet retrieval beyond the high-level description emphasis. Even if portfolio access is documented in the Features list, the more important issue is that the skill’s user-facing description does not clearly disclose that actions are delegated to a fetched external executable, which weakens user trust boundaries in a funds-related context.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
This finding is partially valid: the code does perform undeclared external command execution via `child_process`, and it adds portfolio/wallet retrieval beyond the high-level description emphasis. Even if portfolio access is documented in the Features list, the more important issue is that the skill’s user-facing description does not clearly disclose that actions are delegated to a fetched external executable, which weakens user trust boundaries in a funds-related context.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
This finding is partially valid: the code does perform undeclared external command execution via `child_process`, and it adds portfolio/wallet retrieval beyond the high-level description emphasis. Even if portfolio access is documented in the Features list, the more important issue is that the skill’s user-facing description does not clearly disclose that actions are delegated to a fetched external executable, which weakens user trust boundaries in a funds-related context.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
This finding is partially valid: the code does perform undeclared external command execution via `child_process`, and it adds portfolio/wallet retrieval beyond the high-level description emphasis. Even if portfolio access is documented in the Features list, the more important issue is that the skill’s user-facing description does not clearly disclose that actions are delegated to a fetched external executable, which weakens user trust boundaries in a funds-related context.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
This finding is partially valid: the code does perform undeclared external command execution via `child_process`, and it adds portfolio/wallet retrieval beyond the high-level description emphasis. Even if portfolio access is documented in the Features list, the more important issue is that the skill’s user-facing description does not clearly disclose that actions are delegated to a fetched external executable, which weakens user trust boundaries in a funds-related context.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
This finding is partially valid: the code does perform undeclared external command execution via `child_process`, and it adds portfolio/wallet retrieval beyond the high-level description emphasis. Even if portfolio access is documented in the Features list, the more important issue is that the skill’s user-facing description does not clearly disclose that actions are delegated to a fetched external executable, which weakens user trust boundaries in a funds-related context.

Description-Behavior Mismatch

High
Confidence
98% confidence
Finding
The SKILL.md description says only that it 'does something useful,' which materially misrepresents a skill that is supposed to handle Solana prediction markets and betting actions. Misleading capability descriptions can cause incorrect routing, unsafe invocation, and insufficient scrutiny for financially sensitive operations.

Known Vulnerable Dependency: fast-uri==3.1.2 — 6 advisory(ies): CVE-2026-13676 (fast-uri vulnerable to host confusion via failed IDN canonicalization); CVE-2026-18446 (fast-uri vulnerable to host confusion via backslash authority introducer); CVE-2026-75975 (fast-uri vulnerable to server-side request forgery via malformed IPv6 normalizat) +3 more

High
Category
Supply Chain
Confidence
87% confidence
Finding
fast-uri 3.1.2 is associated with multiple URI parsing flaws including host confusion and potential SSRF bypasses. In an MCP/server context where URLs, callbacks, or remote endpoints may be validated or normalized, a flawed URI parser can undermine hostname allowlists and network boundary checks.

Known Vulnerable Dependency: hono==4.12.18 — 16 advisory(ies): CVE-2026-47676 (Hono: app.mount() strips mount prefix using undecoded path, causing incorrect ro); CVE-2026-47675 (Hono: Cookie helper does not sanitize sameSite and priority, allowing Set-Cookie); CVE-2026-71848 (Hono: Algorithmic Complexity DoS in Language Middleware) +13 more

High
Category
Supply Chain
Confidence
91% confidence
Finding
hono 4.12.18 has numerous advisories spanning routing, cookie handling, and denial-of-service issues, indicating a materially risky web framework version. Since this skill depends on an MCP server package that likely exposes network endpoints, weaknesses in the underlying framework are relevant and increase attack surface.

Known Vulnerable Dependency: ip-address==10.2.0 — 3 advisory(ies): CVE-2026-54272 (ip-address: misclassification of IPv4-mapped/NAT64 IPv6 addresses can bypass SSR); CVE-2026-69198 (ip-address: a CIDR suffix on the parsed address suppresses special-use classific); CVE-2026-69192 (ip-address: Address4 decodes leading-zero octets as decimal while resolvers deco)

High
Category
Supply Chain
Confidence
84% confidence
Finding
ip-address 10.2.0 is flagged for parsing/classification issues that can enable SSRF or policy bypass when code distinguishes public from private/special-use addresses. This matters in rate-limiting, proxy trust, or outbound-request validation contexts, especially in server software where attacker-supplied host/IP input may influence access control.

Known Vulnerable Dependency: ws==8.20.0 — 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
89% confidence
Finding
ws 8.20.0 is flagged for memory disclosure and memory exhaustion issues in WebSocket handling. In a server-oriented dependency tree, exposed WebSocket endpoints could allow remote attackers to crash the service or potentially leak memory contents depending on the exact vulnerable path.

Known Vulnerable Dependency: ws==7.5.10 — 1 advisory(ies): CVE-2026-48779 (ws: Memory exhaustion DoS from tiny fragments and data chunks)

High
Category
Supply Chain
Confidence
88% confidence
Finding
A second ws instance, version 7.5.10, is present and flagged for memory exhaustion DoS via fragmented WebSocket traffic. Even though this older branch is transitive under jayson, it still represents a real remotely triggerable availability risk if that WebSocket functionality is exposed.

Description-Behavior Mismatch

High
Confidence
99% confidence
Finding
The published skill advertises Solana prediction-market capabilities, but the implementation is only a generic echo example tool. This mismatch is dangerous because users or downstream agents may rely on declared financial functionality that does not exist, causing unsafe automation decisions, failed transactions, or trust abuse in a blockchain context where correctness is security-relevant.

Context-Inappropriate Capability

High
Confidence
98% confidence
Finding
The code runs an external package through `exec`, causing the runtime to download and execute code from the package registry on demand. In a financial skill that can build betting and claim transactions, this is especially dangerous because a malicious or altered MCP server could exfiltrate data, modify transaction parameters, or execute arbitrary commands under the host's privileges.

Known Vulnerable Dependency: fast-uri==3.1.2 — 6 advisory(ies): CVE-2026-13676 (fast-uri vulnerable to host confusion via failed IDN canonicalization); CVE-2026-18446 (fast-uri vulnerable to host confusion via backslash authority introducer); CVE-2026-75975 (fast-uri vulnerable to server-side request forgery via malformed IPv6 normalizat) +3 more

High
Category
Supply Chain
Confidence
84% confidence
Finding
fast-uri 3.1.2 has multiple high-severity parser confusion and SSRF-related advisories. Because it is pulled in via AJV and related schema tooling in the MCP SDK stack, the danger depends on whether untrusted URIs are validated or normalized for security decisions; if so, malformed hosts could bypass allowlists or SSRF protections.

Known Vulnerable Dependency: hono==4.12.18 — 16 advisory(ies): CVE-2026-47676 (Hono: app.mount() strips mount prefix using undecoded path, causing incorrect ro); CVE-2026-47675 (Hono: Cookie helper does not sanitize sameSite and priority, allowing Set-Cookie); CVE-2026-71848 (Hono: Algorithmic Complexity DoS in Language Middleware) +13 more

High
Category
Supply Chain
Confidence
88% confidence
Finding
hono 4.12.18 is associated with numerous advisories including routing, cookie handling, and DoS issues, indicating meaningful security debt in the web framework layer. Since the skill depends on an MCP server package, these server-side flaws are more relevant than they would be in a pure local library, especially if the skill is deployed as a network-accessible service.

Known Vulnerable Dependency: ip-address==10.2.0 — 3 advisory(ies): CVE-2026-54272 (ip-address: misclassification of IPv4-mapped/NAT64 IPv6 addresses can bypass SSR); CVE-2026-69198 (ip-address: a CIDR suffix on the parsed address suppresses special-use classific); CVE-2026-69192 (ip-address: Address4 decodes leading-zero octets as decimal while resolvers deco)

High
Category
Supply Chain
Confidence
80% confidence
Finding
ip-address 10.2.0 is flagged for address classification and normalization bugs that can enable SSRF or network-filter bypasses. In a stack that includes rate limiting and possible network-facing server behavior, misclassifying special-use or IPv4-mapped IPv6 addresses can undermine protections intended to block access to internal or restricted targets.

Description-Behavior Mismatch

High
Confidence
98% confidence
Finding
The manifest describes a complete Solana prediction markets skill that should list markets, get odds, place bets, and claim winnings. However, the code only exposes a generic example tool that echoes input text and the exported metadata describes it merely as "An OpenClaw skill," indicating the implemented behavior does not align with the claimed domain-specific functionality.

Context-Inappropriate Capability

Medium
Confidence
97% confidence
Finding
The markdown includes embedded implementation instructions that direct creation of code using `child_process.exec` to run shell commands. In a skill file, such instructions can influence downstream agents or maintainers into adding arbitrary command-execution capability, expanding the trust boundary and enabling remote code execution via external tooling in a wallet-sensitive context.

Missing User Warnings

Medium
Confidence
92% confidence
Finding
The skill lacks clear warning that it executes external commands to build betting and claim transactions. In a crypto skill handling wallet-related actions, hidden delegation to external code materially increases risk because users and orchestrators may assume deterministic local logic while actually running unpinned third-party code that can alter transactions or exfiltrate sensitive data.

Rp1

Medium
Category
MCP Rug Pull
Confidence
95% confidence
Finding
The skill invokes an external package via `npx -y @baozi.bet/mcp-server` without pinning an exact version or integrity, so every execution may fetch and run newly published code. In a wallet/betting skill, that creates a supply-chain execution path with direct impact on transaction building, wallet interactions, and user funds if the package is compromised or updated maliciously.

Intent-Code Divergence

Medium
Confidence
97% confidence
Finding
The documentation is placeholder text and an example tool unrelated to the stated prediction-market functionality, which obscures what the skill actually does. For a blockchain betting skill, incomplete or contradictory documentation increases the risk of misuse, accidental financial actions, and failure to enforce proper confirmation and authorization flows.

Vague Triggers

Medium
Confidence
95% confidence
Finding
The usage section provides no meaningful invocation constraints, so an agent may activate the skill in ambiguous contexts or without clear user intent. Because the skill context involves financial transactions on Solana, vague activation guidance raises the chance of unintended betting or wallet-affecting actions.

Vague Triggers

Medium
Confidence
93% confidence
Finding
The example trigger phrase 'Process this input with baozi-claw' is extremely broad and resembles ordinary language, which can lead to accidental or overbroad activation. In a skill tied to prediction markets and wagering, unintended activation is more dangerous because it may expose users to financial loss or unauthorized transaction workflows.

Static analysis

No suspicious patterns detected.