Back to skill

Security audit

Web3-Dapp-Master

Security checks for vulnerabilities and agentic risk

Overview

This Web3 development skill is coherent, but it needs review because it gives unsafe session-token guidance and ambiguous private-key setup instructions.

Review this skill before installing or using it for production scaffolding. Do not implement reusable JWTs in URLs; prefer same-site HttpOnly cookies or short-lived, single-use SSE tickets. Treat all .env values as private local configuration, never place funded mainnet private keys in .env, and require explicit limits and user controls for automated trading, signing, deployment, and strategy-worker behavior.

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 (1)

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:422
Finding

JWT Disclosure Through SSE Query Parameters

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:422
Vulnerability Type: Bearer token exposure through URL query parameters
Risk Level: Medium

Vulnerable Code

typescript
// Auth: JWT via query param (EventSource doesn't support headers)

Technical Analysis

The Skill explicitly recommends transmitting a JWT in the query string of an SSE endpoint. Query parameters are unsuitable for bearer credentials because complete URLs may be retained by browser history and captured by reverse-proxy access logs, application logs, observability platforms, analytics systems, and error reports.

Anyone who obtains a valid JWT from one of these locations may replay it against the SSE endpoint until the token expires or is revoked. TLS protects the URL while it is in transit, but it does not prevent endpoint infrastructure or client software from recording it.

Attack Path

  1. An authenticated client opens an SSE connection using a URL such as /events?token=<JWT>.
  2. A browser, reverse proxy, application server, monitoring agent, or log aggregation service records the requested URL.
  3. An attacker or insufficiently privileged operator gains access to the resulting history, telemetry, or log entry.
  4. The attacker extracts the bearer token from the query string.
  5. The attacker submits the token to the SSE endpoint before it expires.
  6. If the server does not impose additional audience, scope, replay, or revocation controls, the attacker receives the victim's authenticated event stream.

Impact Assessment

Successful exploitation can provide unauthorized access to user-specific real-time events. Based on the documented event types, exposed information may include trade status, transaction hashes, strategy lifecycle events, detected signals, scanner activity, price updates, and AI decisions.

The immediate scope is the authorization granted to the JWT for the SSE service. If the same JWT is accepted by other API endpoints, token replay ...[truncated 163 chars]

Remediation
View remediation

Remediation Suggestions

  1. Authenticate native EventSource connections with a same-site session cookie configured with HttpOnly, Secure, and an appropriate SameSite policy.
  2. If cookie authentication is unsuitable, exchange the primary session token for a single-use, narrowly scoped SSE ticket:
    • Limit its audience to the SSE endpoint.
    • Bind it to the intended user and permitted event types.
    • Give it a very short expiration period.
    • Invalidate it immediately after connection establishment.
  3. Do not place reusable access or refresh tokens in URLs.
  4. Configure reverse proxies, application servers, analytics tools, and observability systems to redact query strings and authorization data.
  5. Validate token audience, issuer, expiration, scope, and revocation state on every connection.
  6. Reauthorize subscriptions server-side so clients cannot request another user's channels or event types.
  7. Ensure error responses, reconnect logic, and diagnostic telemetry never reproduce authentication material.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Memory PoisoningPersistent Context Injection, Context Window Stuffing, Memory Manipulation
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (13)

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 · SKILL.md (reported line 634)May include surrounding context.

text
⚪ Config:     Safe to commit to .env.example as placeholder values
🟡 Sensitive:  Must be in .env (gitignored), contains API keys or endpoints
🔴 Secret:     Must NEVER appear in logs, code, or git history
🔴 Critical:   Private keys — highest security, see §XIX rules

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 · SKILL.md (reported line 647)May include surrounding context.

text
⚪ Config:     Safe to commit to .env.example as placeholder values
🟡 Sensitive:  Must be in .env (gitignored), contains API keys or endpoints
🔴 Secret:     Must NEVER appear in logs, code, or git history
🔴 Critical:   Private keys — highest security, see §XIX rules

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 · SKILL.md (reported line 651)May include surrounding context.

text
⚪ Config:     Safe to commit to .env.example as placeholder values
🟡 Sensitive:  Must be in .env (gitignored), contains API keys or endpoints
🔴 Secret:     Must NEVER appear in logs, code, or git history
🔴 Critical:   Private keys — highest security, see §XIX rules

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 · SKILL.md (reported line 656)May include surrounding context.

text
⚪ Config:     Safe to commit to .env.example as placeholder values
🟡 Sensitive:  Must be in .env (gitignored), contains API keys or endpoints
🔴 Secret:     Must NEVER appear in logs, code, or git history
🔴 Critical:   Private keys — highest security, see §XIX rules

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 · SKILL.md (reported line 692)May include surrounding context.

text
⚪ Config:     Safe to commit to .env.example as placeholder values
🟡 Sensitive:  Must be in .env (gitignored), contains API keys or endpoints
🔴 Secret:     Must NEVER appear in logs, code, or git history
🔴 Critical:   Private keys — highest security, see §XIX rules

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 · SKILL.md (reported line 752)May include surrounding context.

text
⚪ Config:     Safe to commit to .env.example as placeholder values
🟡 Sensitive:  Must be in .env (gitignored), contains API keys or endpoints
🔴 Secret:     Must NEVER appear in logs, code, or git history
🔴 Critical:   Private keys — highest security, see §XIX rules

Context Window Stuffing

Medium
Category
Memory Poisoning
Confidence
85% confidence
Finding

Skill attempts to fill the context window with filler content, displacing legitimate instructions and safety constraints. This can degrade agent performance or bypass safety boundaries.

Content

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

Security Rules

text
- Zero-fill Buffer on lock: key.fill(0) before delete
- Vault MUST be unlocked for any write/decrypt operation
- List operations NEVER return decrypted values
- Approve only required token amounts (never maxUint256)

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
80% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

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

md
→ Inform the user which variable is needed and why
        → Provide the service's signup URL
        → Ask the user to set it in .env
        → NEVER ask the user to paste secrets into chat
Rule 5: For DEPLOYER_PRIVATE_KEY, always recommend:
        → cast wallet new (Foundry) to generate locally
        → Hardware wallet / Ledger for mainnet deploys

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% 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 · SKILL.md (reported line 724)May include surrounding context.

md
RPC_ARB=https://arb-mainnet.g.alchemy.com/v2/YOUR_KEY

# === Account Abstraction (get from: https://zerodev.app or https://pimlico.io) ===
BUNDLER_URL=https://api.pimlico.io/v2/YOUR_CHAIN/rpc?apikey=YOUR_KEY
PAYMASTER_URL=https://api.pimlico.io/v2/YOUR_CHAIN/rpc?apikey=YOUR_KEY

# === Embedded Wallet (choose one: https://privy.io or https://dynamic.xyz) ===

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% 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 · SKILL.md (reported line 725)May include surrounding context.

md
RPC_ARB=https://arb-mainnet.g.alchemy.com/v2/YOUR_KEY

# === Account Abstraction (get from: https://zerodev.app or https://pimlico.io) ===
BUNDLER_URL=https://api.pimlico.io/v2/YOUR_CHAIN/rpc?apikey=YOUR_KEY
PAYMASTER_URL=https://api.pimlico.io/v2/YOUR_CHAIN/rpc?apikey=YOUR_KEY

# === Embedded Wallet (choose one: https://privy.io or https://dynamic.xyz) ===

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The .env.example entry leaves DEPLOYER_PRIVATE_KEY blank while the adjacent comment says it is Foundry's default Anvil key #0, creating contradictory guidance around highly sensitive credential material. In a Web3 deployment skill, ambiguity about deployer keys can cause users or agents to assume a default/dev key is acceptable or already implied, increasing the chance of unsafe deployment practices or accidental exposure of a real key.

Content

No source excerpt is available for this finding.

Vague Triggers

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The manifest description presents the skill as a comprehensive solution for many common Web3 development tasks, but it does not define narrow trigger phrases, boundaries, or negative examples. In systems that route skills from natural-language descriptions, this breadth increases the chance of unintended invocation for general software or blockchain-related requests.

Content

No source excerpt is available for this finding.

Vague Triggers

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

Phrases like 'Scaffold / architect a Web3 DApp' and 'Design testing strategy' are high-level and expansive, but the document does not provide exclusion conditions or negative examples. This can cause the skill to match loosely related engineering requests that are not intended to invoke this specific Web3-focused skill.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.