Back to skill

Security audit

BNB Chain NFT

Security checks for vulnerabilities and agentic risk

Overview

This NFT skill is coherent but needs Review because it can immediately transfer NFTs, grant collection-wide approvals, and use wallet private keys with limited safety controls.

Install only if you are comfortable with a CLI that can sign real BNB Chain NFT transfers and approvals. Use a dedicated low-value wallet, avoid passing private keys on the command line, verify every contract and recipient/operator address, avoid approve-all unless necessary, and be aware that metadata lookups may contact URLs controlled by NFT contracts.

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

Warning
Location
nft.js:53
Finding

Unrestricted NFT Metadata URL Fetch Enables Server-Side Request Forgery

Content
View full analysis
null), contract.tokenURI(tokenId).catch(() => null) ]); if (!owner) { console.log(JSON.stringify({ error: 'Token does not exist or was burned' })); return; } let metadata = null; if (tokenURI && tokenURI.startsWith('http')) { try { const response = await fetch(tokenURI, { timeout: 5000 }); metadata = await response.json(); } catch (e) { // Could not fetch metadata } } ``` ### Technical Analysis The metadata URL originates from the untrusted `tokenURI()` response of a user-selected NFT contract. The implementation only checks whether the value begins with `http`, then requests it from the environment running the Skill. This allows both HTTP and HTTPS URLs without validating the destination hostname or resolved IP address. Consequently, a malicious contract can return URLs targeting: - Loopback services such as `127.0.0.1` or `[::1]` - Private network ranges - Link-local addresses - Cloud instance metadata services - Internal administrative or development services - Redirectors that ultimately resolve to a restricted destination The retrieved JSON is included in the command output. If an internal endpoint returns valid JSON, this behavior can expose its response through the Skill. The request also lacks effective resource controls. The standard Node.js `fetch` API does not enforce a `timeout` option in this form; an `AbortSignal` is required. No response-size limit is imposed before `response.json()` buffers and parses the response, creating an additional denial-of-service risk. Fetching remote NFT metadata is consistent with the declared functionality, but unrestricted access to arbitrary netw ...[truncated 1707 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
nft.js:289
Finding

Wallet Private Key Accepted Through Exposed Command-Line Arguments

Content
View full analysis
[--key ] node nft.js approve [--key ] node nft.js approve-all [--key ] ``` ### Technical Analysis The Skill accepts a wallet private key through the `--key` command-line option. Command-line arguments are not an appropriate secret transport because they may be exposed through: - Shell history files - Process inspection interfaces - Process-monitoring utilities - Agent tool-call records - Terminal session capture - CI/CD and orchestration telemetry - Debugging, auditing, or command execution logs The private key is used locally by `ethers.Wallet`; the reviewed code does not explicitly transmit the raw key to the RPC endpoint or metadata server. Nevertheless, exposing the key through process arguments creates an avoidable credential-disclosure path. The environment-variable fallback avoids command-line exposure but can still leak through inherited environments, diagnostic dumps, or improperly configured process-management systems. A protected keystore, secret manager, file descriptor, or hidden interactive prompt would provide stronger isolation. ### Attack Path 1. A user follows the documented examples and invokes a write operation with: ```bash node nft.js transfer --key ``` 2. The comple ...[truncated 1315 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (11)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The declared description emphasizes general NFT utility, but the documented behavior also includes high-risk approval actions and off-chain HTTP fetching from tokenURI values. This mismatch can cause a caller or orchestrator to invoke the skill under a lower-risk assumption, while the skill can actually grant third parties transfer rights over NFTs or make untrusted outbound requests.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The documentation describes transfer, approve, and approve-all operations without an explicit, prominent warning that these actions are irreversible or can delegate full control of NFTs to another address. In the NFT context, approvals—especially approve-all—can result in immediate loss of assets if granted to a malicious operator or if the user misunderstands the action.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill exposes approve and approve-all capabilities that grant third parties transfer rights over NFTs, but the manifest description only mentions transfer and read operations. In an agent/tooling context, undisclosed approval primitives are especially dangerous because setApprovalForAll can silently enable wholesale asset exfiltration without requiring immediate transfer, and users may not realize they are authorizing future theft.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The approve-all operation grants an operator broad rights to transfer every NFT in the collection for the wallet, yet the code provides no explicit warning or confirmation. This is more dangerous than a single transfer because it creates persistent delegated authority that can be abused later for mass asset theft if the operator is malicious or compromised.

Content

No source excerpt is available for this finding.

Known Vulnerable Dependency: ws==8.17.1 — 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
96% confidence
Finding

The lockfile pins ws to 8.17.1, and the supplied analysis indicates this version is affected by a memory disclosure issue and a memory-exhaustion denial-of-service issue. Because this skill uses ethers, which can rely on WebSocket transport for blockchain connectivity, a vulnerable ws version can expose the agent to remote attacks if it connects to untrusted or attacker-influenced endpoints, making the issue relevant rather than merely theoretical.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill uses sensitive capabilities implied by its instructions and behavior—environment access for private keys and network access for blockchain and metadata requests—but does not declare any tool scope or permission boundaries. This makes the operational trust model unclear and can lead to over-privileged execution or accidental use in contexts where users are not adequately warned about secret and network use.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The trigger text says to use the skill for 'any NFT-related tasks on BSC,' which is overly broad for a skill that can perform irreversible transfers and grant approvals. Broad invocation language increases the chance the agent selects this skill in situations where a safer read-only tool should be used, leading to unintended asset movement or approval changes.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

Metadata retrieval follows arbitrary tokenURI values over HTTP and fetches attacker-controlled URLs. That can cause server-side request forgery behavior, unexpected outbound network access, tracking, or consumption of untrusted content in environments where the skill runs with network reachability, and this behavior is not clearly disclosed by the manifest.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The transfer command submits an on-chain NFT transfer immediately after a minimal ownership check, with no explicit user warning or confirmation step. In an agent setting, parameter confusion, prompt injection, or mistaken recipient addresses can lead to irreversible loss of valuable assets because blockchain transfers cannot be rolled back.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The code accepts a private key from an environment variable as a default signing source for destructive blockchain actions. In agent or shared-runtime environments, environment variables are often broadly accessible or reused across tools, so implicit key pickup increases the chance of unintended signing, secret misuse, or asset loss.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
94% confidence
Finding

The dependency on ethers uses a caret range (^6.16.0), which permits automatic installation of newer compatible versions rather than a single audited version. If a compromised or breaking upstream release is published, builds may silently pull it in and change runtime behavior, which is risky for a blockchain skill that may handle NFT ownership queries and token transfers.

Content

Scanner excerpt · package.json (reported line 13)May include surrounding context.

json
"license": "ISC",
  "description": "BNB Chain NFT operations",
  "dependencies": {
    "ethers": "^6.16.0"
  }
}

Static analysis

Detected: suspicious.env_credential_access

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
nft.js:5