Back to skill

Security audit

x402 Bazaar Bridge

Security checks for vulnerabilities and agentic risk

Overview

This skill does what it claims, but it handles a wallet private key and can make paid network requests with safeguards that are too weak to rely on.

Review carefully before installing. Use only a low-balance dedicated wallet, set a conservative budget, avoid the resolve command for untrusted queries, and do not rely on the local budget file as the only spending control. Install only if you accept that the skill can sign Base USDC payment authorizations and contact arbitrary HTTPS endpoints from your environment.

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
scripts/bazaar_bridge.js:76
Finding

Bypassable URL Validation Enables Server-Side Request Forgery

Content
View full analysis
2048) return { ok: false, error: 'Invalid URL length' }; let parsed; try { parsed = new URL(trimmed); } catch { return { ok: false, error: 'Malformed URL' }; } // Only allow https if (parsed.protocol !== 'https:') return { ok: false, error: 'Only https:// URLs are allowed' }; // Block internal/reserved IPs const hostname = parsed.hostname.toLowerCase(); if (hostname === 'localhost' || hostname === '127.0.0.1' || hostname === '0.0.0.0' || hostname === '[::1]' || hostname.endsWith('.local') || hostname.endsWith('.internal')) { return { ok: false, error: 'Internal/host-local URLs are not allowed' }; } // Block private IP ranges (10.x.x.x, 172.16-31.x.x, 192.168.x.x) const ipMatch = hostname.match(/^(\d+)\.(\d+)\.(\d+)\.(\d+)$/); if (ipMatch) { const [_, a, b] = ipMatch.map(Number); if (a === 10 || (a === 172 && b >= 16 && b <= 31) || (a === 192 && b === 168)) { return { ok: false, error: 'Private IP ranges are not allowed' }; } } // Block link-local/multicast (169.254.x.x, 224-239.x.x.x) if (ipMatch) { const a = Number(ipMatch[1]); if (a === 169 || (a >= 224 && a <= 239)) { return { ok: false, error: 'Link-local and multicast IPs are not allowed' }; } } return { ok: true, url: trimmed }; } ``` The validated value is subsequently passed to `fetch`: ```js res = await fetch(urlVal.url, { signal: AbortSignal.timeout(REQUEST_TIMEOUT) }); ``` Discovery-controlled URLs can also reach the same sink automatically: ```js const result = await fetchEndpoint(best.url, conf ...[truncated 2360 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/bazaar_bridge.js:240
Finding

Non-Atomic and Fail-Open Budget Enforcement Allows Spending Above the Daily Limit

Content
View full analysis
config.dailyBudget) { budget.rejected++; saveBudget(budget); return { allowed: false, budget }; } return { allowed: true, budget }; } function recordSpend(costUsd) { const budget = loadBudget(); budget.spent += costUsd; budget.calls += 1; saveBudget(budget); log(`Spent $${costUsd.toFixed(4)} | Total today: $${budget.spent.toFixed(4)} (${budget.calls} calls)`); } ``` Spending is only recorded after `executePayment` reports success: ```js try { const paidData = await executePayment(urlVal.url, paymentRequired, baseOption, config); recordSpend(cost); const result = { ok: true, data: paidData, paid: true, costUsd: cost }; setCache(cacheKey, result, CACHE_TTL.fetch); return result; } catch (err) { return { ok: false, error: err.message }; } ``` The signed authorization is transmitted before the HTTP result is known: ```js try { paidRes = await fetch(url, { headers: { 'payment-signature': encoded }, signal: AbortSignal.timeout(REQUEST_TIMEOUT), }); } catch (err) { // Payment was signed and broadcast, but we couldn't verify the result // The settlement may have gone through — check your wallet throw new Error(`Payment sent but res ...[truncated 3280 chars]
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
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (22)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/bazaar_bridge.js search "bitcoin node fees"

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/bazaar_bridge.js search "bitcoin node fees"

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/bazaar_bridge.js search "bitcoin node fees"

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/bazaar_bridge.js search "bitcoin node fees"

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/bazaar_bridge.js search "bitcoin node fees"

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/bazaar_bridge.js search "bitcoin node fees"

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/bazaar_bridge.js search "bitcoin node fees"

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/bazaar_bridge.js search "bitcoin node fees"

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/bazaar_bridge.js search "bitcoin node fees"

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/bazaar_bridge.js (reported line 10)May include surrounding context.

js
*
 * ⚠️ SECURITY WARNING ⚠️
 * This script requires a PRIVATE KEY (WALLET_KEY) to sign payments.
 * - NEVER commit .env to git
 * - Keep your .env file permissions at 0600 (owner read-only)
 * - The private key stays on YOUR machine — never leaves it
 * - Error messages intentionally hide wallet addresses and keys

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/bazaar_bridge.js (reported line 11)May include surrounding context.

js
*
 * ⚠️ SECURITY WARNING ⚠️
 * This script requires a PRIVATE KEY (WALLET_KEY) to sign payments.
 * - NEVER commit .env to git
 * - Keep your .env file permissions at 0600 (owner read-only)
 * - The private key stays on YOUR machine — never leaves it
 * - Error messages intentionally hide wallet addresses and keys

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/bazaar_bridge.js (reported line 21)May include surrounding context.

js
*
 * ⚠️ SECURITY WARNING ⚠️
 * This script requires a PRIVATE KEY (WALLET_KEY) to sign payments.
 * - NEVER commit .env to git
 * - Keep your .env file permissions at 0600 (owner read-only)
 * - The private key stays on YOUR machine — never leaves it
 * - Error messages intentionally hide wallet addresses and keys

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/bazaar_bridge.js (reported line 125)May include surrounding context.

js
*
 * ⚠️ SECURITY WARNING ⚠️
 * This script requires a PRIVATE KEY (WALLET_KEY) to sign payments.
 * - NEVER commit .env to git
 * - Keep your .env file permissions at 0600 (owner read-only)
 * - The private key stays on YOUR machine — never leaves it
 * - Error messages intentionally hide wallet addresses and keys

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/bazaar_bridge.js (reported line 384)May include surrounding context.

js
*
 * ⚠️ SECURITY WARNING ⚠️
 * This script requires a PRIVATE KEY (WALLET_KEY) to sign payments.
 * - NEVER commit .env to git
 * - Keep your .env file permissions at 0600 (owner read-only)
 * - The private key stays on YOUR machine — never leaves it
 * - Error messages intentionally hide wallet addresses and keys

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/bazaar_bridge.js (reported line 608)May include surrounding context.

js
*
 * ⚠️ SECURITY WARNING ⚠️
 * This script requires a PRIVATE KEY (WALLET_KEY) to sign payments.
 * - NEVER commit .env to git
 * - Keep your .env file permissions at 0600 (owner read-only)
 * - The private key stays on YOUR machine — never leaves it
 * - Error messages intentionally hide wallet addresses and keys

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/bazaar_bridge.js (reported line 616)May include surrounding context.

js
*
 * ⚠️ SECURITY WARNING ⚠️
 * This script requires a PRIVATE KEY (WALLET_KEY) to sign payments.
 * - NEVER commit .env to git
 * - Keep your .env file permissions at 0600 (owner read-only)
 * - The private key stays on YOUR machine — never leaves it
 * - Error messages intentionally hide wallet addresses and keys

Credential Access

High
Category
Privilege Escalation
Confidence
84% confidence
Finding

The script reads a plaintext .env file from disk and loads WALLET_KEY directly into process memory/environment for payment signing. In an agent skill context, handling a blockchain private key from a local file increases secret exposure risk through local compromise, accidental inclusion in process environment, or reuse by other code running in the same process.

Content

Scanner excerpt · scripts/bazaar_bridge.js (reported line 131)May include surrounding context.

js
// ─── Config ─────────────────────────────────────────────────

function loadEnv() {
  const envPath = resolve(SKILL_DIR, '.env');
  if (existsSync(envPath)) {
    const content = secureRead(envPath);
    if (content) {

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/bazaar_bridge.js (reported line 603)May include surrounding context.

js
// ─── .gitignore Check ─────────────────────────────────────

function envCheck() {
  const envPath = resolve(SKILL_DIR, '.env');
  const gitignorePath = resolve(SKILL_DIR, '.gitignore');
  const skillGitignore = resolve(SKILL_DIR, '..', '.gitignore');

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/bazaar_bridge.js (reported line 612)May include surrounding context.

js
// ─── .gitignore Check ─────────────────────────────────────

function envCheck() {
  const envPath = resolve(SKILL_DIR, '.env');
  const gitignorePath = resolve(SKILL_DIR, '.gitignore');
  const skillGitignore = resolve(SKILL_DIR, '..', '.gitignore');

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill describes functionality that uses environment secrets (WALLET_KEY) and outbound network access, but it does not declare any explicit tool scope or permission boundaries. This creates a mismatch between documented capabilities and enforceable restrictions, increasing the risk that the skill can access sensitive data or make unintended external requests without clear operator consent.

Content

No source excerpt is available for this finding.

Unsafe Defaults

Medium
Category
Tool Misuse
Confidence
70% confidence
Finding

Tool defaults are unsafe or overly permissive (e.g. disabled TLS verification, no authentication, world-writable permissions). Unsafe defaults widen the attack surface.

Content

Scanner excerpt · scripts/bazaar_bridge.js (reported line 37)May include surrounding context.

js
mkdirSync(LOG_DIR, { recursive: true });

// Secure file permissions — 0o600 = owner read/write only
// (macOS default umask often makes files 0644, world-readable)
try { chmodSync(LOG_DIR, 0o700); } catch {}

const CACHE_FILE = resolve(LOG_DIR, 'bazaar_cache.json');

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/bazaar_bridge.js (reported line 43)May include surrounding context.

js
const CACHE_FILE = resolve(LOG_DIR, 'bazaar_cache.json');
const BUDGET_FILE = resolve(LOG_DIR, 'bazaar_budget.json');
const LOG_FILE = resolve(LOG_DIR, 'bazaar_bridge.log');
const DISCOVERY_API = 'https://api.cdp.coinbase.com/platform/v2/x402/discovery';
const REQUEST_TIMEOUT = 15_000; // 15s fetch timeout

// ─── Secure File Helpers ───────────────────────────────────

Static analysis

Detected: suspicious.env_credential_access

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
scripts/bazaar_bridge.js:142