Back to skill

Security audit

Baozi Prediction Markets

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly coherent for Baozi prediction-market use, but it asks users to run mutable third-party code in a financial workflow and automatically registers a wallet-based affiliate code without clear opt-in.

Review this before installing. Use only a pinned and reviewed version of the Baozi MCP server, run it in a restricted environment with no private keys or seed phrases, verify every transaction before signing, and do not proceed unless you are comfortable with wallet-address affiliate registration or can disable it.

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

T08 · Insecure Dependencies

Error
Location
SKILL.md:42
Finding
Unpinned Third-Party Package Is Downloaded and Executed Through npx<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 42-66 **Vulnerability Type**: Unpinned third-party dependency execution **Risk Level**: High ### Vulnerable Code ```bash echo '{\"name\":\"list_markets\",\"arguments\":{\"layer\":\"Lab\",\"status\":\"Active\"}}' | npx @baozi.bet/mcp-server ``` ```bash echo '{\"name\":\"list_race_markets\",\"arguments\":{\"layer\":\"Lab\",\"status\":\"Active\"}}' | npx @baozi.bet/mcp-server ``` ```bash echo '{\"name\":\"get_market\",\"arguments\":{\"market\":\"MARKET_PUBKEY\"}}' | npx @baozi.bet/mcp-server ``` ```bash echo '{\"name\":\"get_quote\",\"arguments\":{\"market\":\"MARKET_PUBKEY\",\"side\":\"Yes\",\"amount\":1.0}}' | npx @baozi.bet/mcp-server ``` ```bash echo '{\"name\":\"get_positions\",\"arguments\":{\"wallet\":\"WALLET_ADDRESS\"}}' | npx @baozi.bet/mcp-server ``` ```bash echo '{\"name\":\"analyze-market\",\"arguments\":{\"market\":\"MARKET_PUBKEY\"}}' | npx @baozi.bet/mcp-server ``` ### Technical Analysis Every documented operation invokes `npx @baozi.bet/mcp-server` without specifying an exact package version. Depending on the local npm configuration and cache state, `npx` can retrieve the version currently selected by the package registry and execute its lifecycle scripts and program code immediately. The reviewed project contains no local copy of the MCP server source, dependency manifest, lockfile, or integrity metadata. Consequently, the code that ultimately executes is mutable after this Skill has been reviewed and cannot be verified from the project contents. This is particularly sensitive because the package is presented as an interface to a cryptocurrency prediction market. Although `SKILL.md` states that the agent builds transactions and the user signs them, the external package implementation was not included in the audit. The stated separation therefore cannot be independently confirmed from the reviewed artifact. ### Attack Path 1. An attacker compromises the package pub ...[truncated 1753 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Pin the package to a reviewed, exact version rather than using a floating package reference, for example: ```bash npx --no-install @baozi.bet/mcp-server ``` Install the exact approved version separately through a locked dependency manifest. 2. Add `package.json` and a committed lockfile containing the expected resolved version and integrity hash. Use lockfile-enforced installation such as: ```bash npm ci --ignore-scripts ``` 3. Audit the pinned MCP server source and its transitive dependencies before deployment. Re-audit deliberately before upgrading the pinned version. 4. Disable unnecessary npm lifecycle scripts. If lifecycle scripts are required, document and review each one rather than allowing them implicitly. 5. Run the MCP server in a restricted environment with: - Minimal filesystem access - No private keys or wallet seed phrases - A tightly filtered environment - Restricted outbound network access - No elevated operating-system privileges - Resource and execution-time limits 6. Display the complete serialized transaction and human-readable interpretation before requesting a signature. Independently verify the program ID, instruction type, account addresses, token or SOL amount, fees, and recipient accounts against trusted data. 7. Require explicit user approval for every state-changing action, including the automatic affiliate registration described in `SKILL.md`. Read-only requests must not trigger registration or other blockchain writes. 8. Publish reproducible-build information, checksums, and provenance attestations for the approved MCP server artifact. Verify these controls during installation and startup. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (8)

Rp1

Medium
Category
MCP Rug Pull
Confidence
93% confidence
Finding
The skill instructs use of an unpinned MCP package via `npx @baozi.bet/mcp-server`, which fetches whatever version is current at execution time. That creates a supply-chain risk: a compromised publisher account, malicious update, or breaking change could cause the agent to run unreviewed code in a high-risk financial workflow involving quotes, wallet positions, and transaction construction.

Rp1

Medium
Category
MCP Rug Pull
Confidence
93% confidence
Finding
This invocation again relies on an unpinned `npx` package, allowing remote code changes outside the skill author's control. Because the package is used to enumerate market data in a betting context, any package compromise could mislead decisions, exfiltrate environment data, or tamper with downstream transaction-related behavior.

Rp1

Medium
Category
MCP Rug Pull
Confidence
93% confidence
Finding
Using `npx @baozi.bet/mcp-server` without version pinning means the executed tool is mutable and can change between runs. In a crypto prediction-market skill, that materially increases risk because the tool may influence financial actions and could be swapped for malicious code or altered logic.

Rp1

Medium
Category
MCP Rug Pull
Confidence
93% confidence
Finding
The skill repeats a floating MCP dependency for wallet-position queries, exposing users to supply-chain compromise and unexpected behavior changes. Since wallet-related operations are especially sensitive, executing unpinned remote package code is dangerous even if private keys are not directly handled by the agent.

Rp1

Medium
Category
MCP Rug Pull
Confidence
93% confidence
Finding
This unpinned MCP invocation for market analysis carries the same supply-chain risk as the others: arbitrary upstream updates may introduce malicious behavior or silent output manipulation. In a financial analysis context, even data or recommendation tampering can cause direct economic loss.

Rp1

Medium
Category
MCP Rug Pull
Confidence
93% confidence
Finding
Another unpinned `npx` execution appears in a skill that can lead to live betting once an environment flag is enabled. The combination of mutable remote code and transaction-building functionality makes the issue more dangerous than in a read-only context, because compromised code could alter quotes, destinations, or transaction contents presented for signature.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The skill states that on first use it automatically checks for and registers an affiliate code using the user's wallet address, but it does not require an explicit warning or consent step. That creates a transaction/identity side effect the user may not expect, potentially linking their wallet to an affiliate program, changing on-chain state, and exposing them to privacy, compliance, or trust issues.

Natural-Language Policy Violations

Medium
Confidence
97% confidence
Finding
Automatically registering an affiliate code derived from the user's wallet address without opt-in is a genuine unsafe behavior, not just a documentation issue. In this crypto context, wallet addresses are durable identifiers, so forced affiliate enrollment can create unwanted attribution, privacy leakage, and possible financial or reputational consequences if users are enrolled without informed consent.

Static analysis

No suspicious patterns detected.