Back to skill

Security audit

UniMarket P2P Marketplace

Security checks for vulnerabilities and agentic risk

Overview

This marketplace skill is mostly coherent, but it handles wallet secrets in an unsafe and under-disclosed way, so users should review it carefully before installing.

Install only if you are comfortable with this skill reading your shared Unicity wallet and handling the raw private key in-process for marketplace authentication. Prefer a test wallet or sandboxed account, run dependencies from the lockfile before commands, avoid direct unpinned npx execution, and treat posted listings plus profile data as public marketplace activity. The hard-coded API key and raw private-key extraction should be fixed before broad trust.

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/wallet.ts:27
Finding
Hard-Coded Shared Oracle API Key<![CDATA[ ## Vulnerability Details **File Location**: `lib/wallet.ts:27-30` **Vulnerability Type**: Hard-coded credential **Risk Level**: High ### Vulnerable Code ```ts oracle: { trustBasePath, apiKey: process.env.UNICITY_API_KEY ?? 'sk_06365a9c44654841a366068bcfc68986', }, ``` ### Technical Analysis The Skill embeds a live-looking API key directly in its source code and automatically uses it whenever the `UNICITY_API_KEY` environment variable is absent. A credential distributed with the Skill cannot be considered secret. Anyone with access to the package, source repository, installation cache, or audit artifact can extract and reuse it independently of the Skill. The fallback also causes all users without an explicit API key to share the same credential, preventing reliable attribution and per-user revocation. The key is supplied to the Sphere SDK's oracle provider. The exact server-side permissions and billing scope of the credential cannot be determined from the audited files, but exposing it violates secure secret-management principles regardless of its current scope. ### Attack Path 1. An attacker downloads or otherwise accesses the Skill source. 2. The attacker opens `lib/wallet.ts` and extracts the embedded `sk_...` credential. 3. The attacker identifies the associated oracle service through the Sphere SDK or observes legitimate SDK requests. 4. The attacker submits requests directly using the exposed credential. 5. Requests are attributed to the shared key until the service revokes it or applies another control. No local access to the victim's wallet is required for this attack. ### Impact Assessment Depending on the credential's server-side permissions, exploitation may permit: - Unauthorized use of the oracle service. - Consumption of shared quotas or rate limits. - Charges against the credential owner if the service is billable. - Service disruption for legitimate users after quota exhaustion. - Loss of attribution because multiple i ...[truncated 348 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Immediately revoke and rotate the exposed API key. 2. Remove the fallback credential from the source code and repository history. 3. Require `UNICITY_API_KEY` to be supplied explicitly: ```ts const apiKey = process.env.UNICITY_API_KEY; if (!apiKey) { throw new Error('UNICITY_API_KEY is required'); } ``` 4. Store credentials in the platform's secret-management facility rather than source files, command-line arguments, or plaintext configuration committed with the Skill. 5. Issue separate, narrowly scoped credentials for each user or installation. 6. Apply server-side rate limits, usage alerts, expiration, and origin or account restrictions where supported. 7. Review service logs for unauthorized use of the exposed key. 8. Add secret scanning to CI and pre-commit checks to prevent recurrence. ]]>

T08 · Insecure Dependencies

Warning
Location
SKILL.md:48
Finding
Documented npx Workflow May Download and Execute Unreviewed Package Code<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:48-51` **Vulnerability Type**: Unsafe dependency execution workflow **Risk Level**: Medium ### Vulnerable Code ```md 1. **Register** — create your marketplace account using your plugin wallet identity: ``` npx tsx scripts/register.ts --name "YourAgentName" --nostr <your-nostr-pubkey> ``` ``` The package is also declared using a non-exact version range in `package.json`: ```json "devDependencies": { "@types/node": "^22.0.0", "tsx": "^4.21.0", "typescript": "^5.9.3" } ``` ### Technical Analysis The documented workflow invokes `npx tsx` directly. When an appropriate local binary is unavailable, `npx` may retrieve package code from the configured npm registry and execute it. This creates a conditional remote-code execution channel whose effective payload can differ from the version reviewed with the Skill. The project includes a lockfile with registry URLs and integrity hashes, which reduces this risk when users first run `npm ci` and execute the resulting local binary. However, the instructions do not require that locked installation workflow before invoking `npx`. The manifest also permits compatible future releases through the `^4.21.0` range. This is especially sensitive because the invoked scripts initialize the Sphere SDK and read the wallet mnemonic from `~/.openclaw/unicity/mnemonic.txt`. Third-party code executed in the same Node.js process operates with the user's OS permissions and could access the same files. The audit did not find evidence that the currently locked `tsx` package is malicious. The vulnerability is the unsafe execution path that can retrieve and run a package version outside the reviewed lockfile. ### Attack Path A viable exploitation path is conditional on package or registry compromise: 1. The user follows the documented `npx tsx ...` command without first installing the lockfile-pinned dependencies. 2. No suitable local `tsx` executable is avai ...[truncated 1327 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Require a lockfile-enforced installation before any Skill command: ```sh npm ci ``` 2. Execute only the installed local binary: ```sh npx --no-install tsx scripts/register.ts --name "YourAgentName" ``` Alternatively: ```sh ./node_modules/.bin/tsx scripts/register.ts --name "YourAgentName" ``` 3. Pin security-sensitive direct dependencies to exact versions rather than caret ranges: ```json "tsx": "4.21.0" ``` 4. Ensure automated and production installation always honors `package-lock.json`. 5. Reject unexpected registry configuration and avoid untrusted npm mirrors. 6. Review dependency updates before regenerating the lockfile. 7. Use automated dependency scanning and package provenance verification where available. 8. Consider compiling the TypeScript scripts into reviewed JavaScript during release so runtime TypeScript tooling is unnecessary. 9. Run the Skill under a restricted account or sandbox with access only to the wallet resources strictly required for the requested operation. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • 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
Findings (51)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
The declared description is about marketplace actions on UniMarket and negotiation via Nostr. This code chunk does not implement search, posting intents, discovery, negotiation, or Nostr messaging. Instead, it performs wallet management: reading a mnemonic from local storage, loading trust base configuration, initializing a Sphere wallet client, and exposing direct access to the private key via an internal field. Accessing and returning a private key is a sensitive capability not reflected in the declared purpose, making this a clear description/behavior mismatch.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The declared description presents a full UniMarket P2P trading capability with offer posting, offer discovery, and Nostr-based negotiation. The supplied code chunk only fetches a list of categories from a public search endpoint and logs them. This is a narrow catalog/listing function and does not demonstrate the core declared marketplace or negotiation behaviors. Therefore, the description materially overstates what the code actually does.

Tp4

High
Category
MCP Tool Poisoning
Confidence
91% confidence
Finding
The code chunk is focused on intent lifecycle management for a marketplace: create a buy/sell intent, list intents, and close an intent. That partially matches the description's posting and discovering offers. However, the description also claims negotiation via Nostr and broader marketplace trading behavior, neither of which is implemented in this code. Instead, the script performs authenticated REST API operations using a loaded wallet/private key. Because a significant declared capability (negotiation via Nostr) is absent and the actual behavior is narrower and somewhat different, this is a mismatch.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The declared description centers on marketplace trading functionality, but this code chunk only fetches and displays the authenticated agent's profile. While it references a Nostr public key as part of the profile output, it does not perform offer discovery, posting intents, or negotiating deals. This is a materially different primary purpose, so the description does not accurately represent the code.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
The code chunk is an agent registration script, not a marketplace trading/searching implementation. Its primary function is to collect a display name, derive the agent's public key from the local wallet, and register that identity with a server API. While the optional Nostr pubkey may relate to the broader system, this script does not post buy/sell intents, discover offers, or negotiate deals. The wallet/key usage and server registration are materially different from the declared purpose, so this is a clear description-behavior mismatch.

Tp4

High
Category
MCP Tool Poisoning
Confidence
87% confidence
Finding
The supplied code only implements searching/discovery of marketplace intents. It accepts a query plus optional type/category/limit filters, calls a public search API endpoint, and displays results. There is no functionality for posting intents, executing trades, or negotiating via Nostr in this chunk. Because the declared description presents a broader trading and negotiation capability than the code actually provides, the description does not accurately represent this specific code chunk.

Ae1

High
Category
analysis-evasion
Content
npx tsx scripts/register.ts --name "YourAgentName" --nostr <your-nostr-pubkey>
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
npx tsx scripts/intent.ts post --type sell --desc "Offering web scraping service, any site" --category services --price 5
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
npx tsx scripts/intent.ts post --type sell --desc "Offering web scraping service, any site" --category services --price 5
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
npx tsx scripts/intent.ts post --type sell --desc "Offering web scraping service, any site" --category services --price 5
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
npx tsx scripts/intent.ts post --type sell --desc "Offering web scraping service, any site" --category services --price 5
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Context-Inappropriate Capability

High
Confidence
99% confidence
Finding
The code deliberately bypasses the SDK's public safety boundary by reading the TypeScript-private `_identity` field and returning the raw `privateKey`. Exposing a wallet private key is highly dangerous because any downstream caller, logger, plugin action, or compromised component can exfiltrate it and fully impersonate the wallet owner, irreversibly stealing funds or signing malicious actions.

Missing User Warnings

High
Confidence
97% confidence
Finding
The function accesses and exposes the most sensitive wallet credential without any user disclosure, consent flow, or obvious functional need for a marketplace trading/search skill. In this context, silent key extraction is especially suspicious because users would reasonably expect order posting or negotiation, not raw secret export, making covert credential theft or misuse much more dangerous.

Credential Access

High
Category
Privilege Escalation
Content
"@libp2p/crypto": "^5.1.7",
        "@libp2p/interface": "^3.1.0",
        "@libp2p/kad-dht": "^16.1.0",
        "@libp2p/keychain": "^6.0.5",
        "@libp2p/logger": "^6.0.5",
        "@libp2p/utils": "^7.0.5",
        "interface-datastore": "^9.0.2",
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
"@libp2p/crypto": "^5.1.7",
        "@libp2p/interface": "^3.1.0",
        "@libp2p/kad-dht": "^16.1.0",
        "@libp2p/keychain": "^6.0.5",
        "@libp2p/logger": "^6.0.5",
        "@libp2p/utils": "^7.0.5",
        "interface-datastore": "^9.0.2",
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
"@libp2p/crypto": "^5.1.7",
        "@libp2p/interface": "^3.1.0",
        "@libp2p/kad-dht": "^16.1.0",
        "@libp2p/keychain": "^6.0.5",
        "@libp2p/logger": "^6.0.5",
        "@libp2p/utils": "^7.0.5",
        "interface-datastore": "^9.0.2",
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
"@libp2p/crypto": "^5.1.7",
        "@libp2p/interface": "^3.1.0",
        "@libp2p/kad-dht": "^16.1.0",
        "@libp2p/keychain": "^6.0.5",
        "@libp2p/logger": "^6.0.5",
        "@libp2p/utils": "^7.0.5",
        "interface-datastore": "^9.0.2",
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
"@libp2p/crypto": "^5.1.7",
        "@libp2p/interface": "^3.1.0",
        "@libp2p/kad-dht": "^16.1.0",
        "@libp2p/keychain": "^6.0.5",
        "@libp2p/logger": "^6.0.5",
        "@libp2p/utils": "^7.0.5",
        "interface-datastore": "^9.0.2",
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
"@libp2p/crypto": "^5.1.7",
        "@libp2p/interface": "^3.1.0",
        "@libp2p/kad-dht": "^16.1.0",
        "@libp2p/keychain": "^6.0.5",
        "@libp2p/logger": "^6.0.5",
        "@libp2p/utils": "^7.0.5",
        "interface-datastore": "^9.0.2",
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
"@libp2p/crypto": "^5.1.7",
        "@libp2p/interface": "^3.1.0",
        "@libp2p/kad-dht": "^16.1.0",
        "@libp2p/keychain": "^6.0.5",
        "@libp2p/logger": "^6.0.5",
        "@libp2p/utils": "^7.0.5",
        "interface-datastore": "^9.0.2",
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
"@libp2p/crypto": "^5.1.7",
        "@libp2p/interface": "^3.1.0",
        "@libp2p/kad-dht": "^16.1.0",
        "@libp2p/keychain": "^6.0.5",
        "@libp2p/logger": "^6.0.5",
        "@libp2p/utils": "^7.0.5",
        "interface-datastore": "^9.0.2",
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Known Vulnerable Dependency: @libp2p/kad-dht==16.1.3 — 1 advisory(ies): CVE-2026-45783 (@libp2p/kad-dht: Unvalidated PUT_VALUE records allow unbounded disk exhaustion o)

High
Category
Supply Chain
Confidence
93% confidence
Finding
The lockfile includes '@libp2p/kad-dht' version 16.1.3, which is flagged with a high-severity advisory for unvalidated PUT_VALUE records leading to unbounded disk exhaustion. In this skill's marketplace/networking context, libp2p-related optional dependencies can increase exposure to untrusted peer input, making denial-of-service against the host more plausible if the affected component is enabled.

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
90% confidence
Finding
The dependency tree contains 'ws' version 7.5.10, which is associated with a memory exhaustion DoS advisory. Because this skill negotiates and communicates over networked protocols and includes optional websocket-capable components, an attacker may be able to send crafted fragmented frames or chunks to degrade or crash the process if the vulnerable path is reachable.

Known Vulnerable Dependency: axios==1.13.5 — 16 advisory(ies): CVE-2026-44494 (axios Vulnerable to Full Man-in-the-Middle via Prototype Pollution Gadget in `co); CVE-2026-44495 (axios Vulnerable to Credential Theft and Response Hijacking via Prototype Pollut); CVE-2025-62718 (Axios has a NO_PROXY Hostname Normalization Bypass that Leads to SSRF) +13 more

High
Category
Supply Chain
Confidence
96% confidence
Finding
The lockfile includes 'axios' 1.13.5 with multiple advisories, including SSRF-related and prototype-pollution-adjacent impacts. In a trading/marketplace skill that likely makes outbound requests and handles remote data, these issues could expose internal network resources, tamper with request behavior, or facilitate credential/response compromise if vulnerable axios features are exercised.

Known Vulnerable Dependency: brace-expansion==1.1.12 — 4 advisory(ies): CVE-2026-13149 (brace-expansion: DoS via exponential-time expansion of consecutive non-expanding); CVE-2026-33750 (brace-expansion: Zero-step sequence causes process hang and memory exhaustion); CVE-2026-14257 (brace-expansion: DoS via unbounded expansion length causing an out-of-memory pro) +1 more

High
Category
Supply Chain
Confidence
88% confidence
Finding
The presence of 'brace-expansion' 1.1.12 introduces several denial-of-service advisories related to pathological expansion behavior. While commonly triggered in tooling or pattern parsing rather than core runtime paths, it remains a real supply-chain risk if any reachable code processes attacker-influenced glob-like patterns.

Static analysis

No suspicious patterns detected.