Back to skill

Security audit

x402janus

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a disclosed wallet-security tool, but its paid commands can sign asset-transfer payment authorizations from insufficiently validated server data.

Install only if you are comfortable using it with a low-balance payment wallet, the official HTTPS JANUS_API_URL, and no reused webhook secret. Avoid running paid commands with a wallet holding valuable assets until the skill validates x402 payment asset, recipient, network, and maximum amount locally.

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/list-approvals.ts:76
Finding

Untrusted x402 Challenges Can Produce Arbitrary Token Transfer Authorizations

Content
View full analysis
Remediation
View remediation
MAX_PAYMENT) { throw new Error("Payment amount exceeds local policy"); } ``` 3. Require `JANUS_API_URL` to use HTTPS and pin its hostname to the documented service unless the user explicitly enables a development override. 4. Validate the final response URL after redirects, or disable cross-origin redirects for payment requests. 5. Treat token name and version as locally trusted constants after validating the token contract rather than accepting arbitrary values from the challenge. 6. Enforce strict timeout bounds and reject negative, zero, non-integer, or excessive timing values. 7. Display the token, amount, recipient, and expiration before signing. Require explicit confirmation whenever a value differs from the expected command policy. 8. Consolidate the duplicated payment implementation into one reviewed helper and add tests with malicious challenges covering arbitrary assets, recipients, amounts, networks, ...[truncated 171 chars]

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/start-monitoring.ts:244
Finding

Webhook Verification Secret Can Be Disclosed to an Arbitrary API Endpoint

Content
View full analysis
{ const apiUrl = requireEnv("JANUS_API_URL").replace(/\/$/, ""); const url = `${apiUrl}/api/guardian/subscribe`; const body: Record = { walletAddress: address, chain: opts.chain, minRiskLevel: opts.minRisk, alertTypes: opts.alertTypes, }; if (opts.webhook) { body.webhook = { url: opts.webhook, secret: process.env.WEBHOOK_SECRET ?? undefined, }; } ``` The body, including the secret, is subsequently transmitted to the configured endpoint: ```ts const response = await fetchWithPayment(url, { method: "POST", body: JSON.stringify(body), }); ``` ### Technical Analysis `WEBHOOK_SECRET` is a credential used to verify the authenticity of webhook alerts. The script places this secret in a JSON request sent to a destination derived entirely from `JANUS_API_URL`. No validation requires HTTPS, verifies the hostname, pins the origin to the documented Janus service, or prevents redirects to another origin. Therefore, a user configuration error, malicious environment injection, insecure HTTP endpoint, redirect, or compromised service can disclose the secret. Sending the secret to the legitimate monitoring provider may be necessary for a shared-secret webhook design. Sending it to any arbitrary configured origin is not necessary and exceeds minimum disclosure privileges. ### Attack Path 1. An attacker influences the process environment, installation instructions, shell configuration, or automation configuration so that `JANUS_API_URL` points to an attacker-controlled or non-TLS ...[truncated 1239 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (70)

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

The description presents a broader wallet security product with multiple capabilities: scanning approvals, tracing fund flow, detecting drainers, and building revoke transactions. This specific code chunk only implements one slice of that description: listing/scanning token approvals with optional risk filtering and x402-paid API access. It relies on an external API for the actual approval/risk data and merely renders/filter it. There is no code here for transaction graph tracing, drainer analysis, or revoke transaction creation. Additionally, while 'No API keys' is accurate for this chunk, the script does require a wallet PRIVATE_KEY to sign x402 micropayments, which is somewhat at odds with the broad 'No accounts' framing, though that point is less central than the missing major capabilities. Therefore the supplied code does not accurately represent the full declared purpose and should be flagged as a mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The declared description presents a broad wallet security skill covering approval scans, fund-flow tracing, drainer detection, and revoke transaction building. The supplied code chunk only implements the revoke-transaction-builder portion, plus optional execution of that transaction. It constructs ERC-20 approve(spender, amount) calldata, estimates gas, and can broadcast the transaction using a private key through cast. It also handles x402 micropayment signing for a remote service challenge, but in this chunk there is no actual scan/risk-analysis/fund-flow/drainer-detection logic. That makes the actual behavior materially narrower than the declared purpose, and it also includes active transaction execution capability that is not explicitly stated in the declaration. The x402/Base payment aspect is consistent, and there are no unrelated triggers, but overall the description does not accurately represent this code chunk's concrete behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
90% confidence
Finding

The code is broadly related to wallet security scanning and x402 payment on Base, so the high-level theme matches. However, the description overstates what this code chunk actually does. This script does not perform on-chain analysis itself; it calls JANUS_API_URL/api/guardian/scan/

and displays the server's response. Capabilities like tracing fund flow, detecting drainers, and building revoke transactions are not implemented locally in the supplied code. Also, while 'no API keys' is consistent, paid use requires a PRIVATE_KEY for payment signing, which materially qualifies the 'no accounts' style messaging. Therefore the declared description does not accurately represent this code chunk's actual behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The code’s main purpose is to create a paid monitoring subscription by calling /api/guardian/subscribe and configuring webhook or Telegram alert delivery. It validates CLI arguments, signs x402 micropayment authorizations with a wallet private key, and sends subscription details to a remote API. While this is related to the broader Janus security product and consistent with the x402 payment model, the declared description emphasizes active wallet security functions such as scanning approvals, tracing fund flow, detecting drainers, and building revoke transactions. None of those capabilities are implemented in this chunk. Instead, this script is specifically for subscribing to monitoring/alerts. Therefore the description does not accurately represent what this supplied code chunk actually does.

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
npx tsx scripts/scan-wallet.ts 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 --tier free --json

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
npx tsx scripts/scan-wallet.ts 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 --tier free --json

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
npx tsx scripts/scan-wallet.ts 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 --tier free --json

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
npx tsx scripts/scan-wallet.ts 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 --tier free --json

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
npx tsx scripts/scan-wallet.ts 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 --tier free --json

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
npx tsx scripts/scan-wallet.ts 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 --tier free --json

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
npx tsx scripts/scan-wallet.ts 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 --tier free --json

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
npx tsx scripts/list-approvals.ts <address> --format json

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
npx tsx scripts/list-approvals.ts <address> --format json

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
npx tsx scripts/list-approvals.ts <address> --format json

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
npx tsx scripts/revoke-approval.ts <wallet> <token> <spender> --json

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
npx tsx scripts/revoke-approval.ts <wallet> <token> <spender> --json

Known Vulnerable Dependency: ws==8.18.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
93% confidence
Finding

The lockfile includes ws 8.18.0, which is flagged for uninitialized memory disclosure and memory-exhaustion DoS issues. Because this skill operates in a wallet/on-chain context and pulls in multiple networking and wallet-connect stacks, vulnerable WebSocket handling is more concerning: a reachable websocket client/server path could leak process memory or allow resource exhaustion in tooling or services using this dependency.

Content

No source excerpt is available for this finding.

Known Vulnerable Dependency: ws==8.19.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
93% confidence
Finding

The dependency tree also contains ws 8.19.0, flagged for the same memory disclosure and memory exhaustion vulnerabilities. This is a true vulnerable dependency, and the presence of multiple websocket-heavy blockchain and wallet libraries increases the chance that an exposed path exists in development tools, local services, or deployed components built from this project.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill declares required environment variables and clearly depends on outbound network access, but it does not declare an explicit tool scope such as permissions or allowed-tools. In an agent setting, that omission weakens least-privilege controls and can let a wallet-handling skill run with broader capabilities than reviewers or orchestrators expect.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
89% confidence
Finding

Using npx tsx without pinning an exact package version allows execution of whatever version resolves at runtime. That creates a supply-chain risk where a compromised or unexpected package version could run arbitrary code in a context that may expose PRIVATE_KEY and other sensitive environment variables.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
89% confidence
Finding

Using npx tsx without pinning an exact package version allows execution of whatever version resolves at runtime. That creates a supply-chain risk where a compromised or unexpected package version could run arbitrary code in a context that may expose PRIVATE_KEY and other sensitive environment variables.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
89% confidence
Finding

Using npx tsx without pinning an exact package version allows execution of whatever version resolves at runtime. That creates a supply-chain risk where a compromised or unexpected package version could run arbitrary code in a context that may expose PRIVATE_KEY and other sensitive environment variables.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
89% confidence
Finding

Using npx tsx without pinning an exact package version allows execution of whatever version resolves at runtime. That creates a supply-chain risk where a compromised or unexpected package version could run arbitrary code in a context that may expose PRIVATE_KEY and other sensitive environment variables.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
89% confidence
Finding

Using npx tsx without pinning an exact package version allows execution of whatever version resolves at runtime. That creates a supply-chain risk where a compromised or unexpected package version could run arbitrary code in a context that may expose PRIVATE_KEY and other sensitive environment variables.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
89% confidence
Finding

Using npx tsx without pinning an exact package version allows execution of whatever version resolves at runtime. That creates a supply-chain risk where a compromised or unexpected package version could run arbitrary code in a context that may expose PRIVATE_KEY and other sensitive environment variables.

Content

No source excerpt is available for this finding.

Static analysis

Detected: suspicious.dangerous_exec, suspicious.env_credential_access

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
scripts/revoke-approval.ts:329

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
scripts/list-approvals.ts:37

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
scripts/revoke-approval.ts:39

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
scripts/start-monitoring.ts:39