T09 · Insecure Skill Coding Practices
- Location
scripts/code/src/index.ts:224- Finding
Remote API Response Is Signed and Broadcast Without Local Transaction Validation
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This is a real NFT trading skill with disclosed wallet use, but it signs high-impact blockchain transactions from remotely supplied calldata without enough local validation.
Install only with a dedicated low-value wallet, assume every buy, sale, offer, cancellation, and approval can move real assets or grant lasting marketplace permissions, and verify transaction details in an external wallet or explorer before funding the wallet. The main unresolved risk is not hidden persistence, but insufficient local validation before signing remote marketplace transaction data.
scripts/code/src/index.ts:224Remote API Response Is Signed and Broadcast Without Local Transaction Validation
scripts/code/src/index.ts:170Order Side Is Not Semantically Enforced Before Executing Buy or Accept-Offer Operations
scripts/code/src/contracts/config.ts:220Remote RPC Endpoint Configuration Is Accepted Without URL or Chain Validation
Direct ERC721/ERC1155 transfers and generic token utility behavior exceed the described order/query/cancel scope of the skill. Because the skill operates with a configured private key, any hidden or auxiliary asset-transfer functionality materially increases the risk of unauthorized or accidental loss of NFTs.
Direct ERC721/ERC1155 transfers and generic token utility behavior exceed the described order/query/cancel scope of the skill. Because the skill operates with a configured private key, any hidden or auxiliary asset-transfer functionality materially increases the risk of unauthorized or accidental loss of NFTs.
Direct ERC721/ERC1155 transfers and generic token utility behavior exceed the described order/query/cancel scope of the skill. Because the skill operates with a configured private key, any hidden or auxiliary asset-transfer functionality materially increases the risk of unauthorized or accidental loss of NFTs.
Direct ERC721/ERC1155 transfers and generic token utility behavior exceed the described order/query/cancel scope of the skill. Because the skill operates with a configured private key, any hidden or auxiliary asset-transfer functionality materially increases the risk of unauthorized or accidental loss of NFTs.
Direct ERC721/ERC1155 transfers and generic token utility behavior exceed the described order/query/cancel scope of the skill. Because the skill operates with a configured private key, any hidden or auxiliary asset-transfer functionality materially increases the risk of unauthorized or accidental loss of NFTs.
Referenced artifact was not completely inspected
nclude prebuilt JavaScript under `scripts/lib/`, so the runtime path uses `node scripts/lib/entry.js` instead of compiling on the user's machine.
Referenced artifact was not completely inspected
nclude prebuilt JavaScript under `scripts/lib/`, so the runtime path uses `node scripts/lib/entry.js` instead of compiling on the user's machine.
Referenced artifact was not completely inspected
nclude prebuilt JavaScript under `scripts/lib/`, so the runtime path uses `node scripts/lib/entry.js` instead of compiling on the user's machine.
Referenced artifact was not completely inspected
nclude prebuilt JavaScript under `scripts/lib/`, so the runtime path uses `node scripts/lib/entry.js` instead of compiling on the user's machine.
Referenced artifact was not completely inspected
- `scripts/entry.ts`: TypeScript source for the main executor
Referenced artifact was not completely inspected
- `scripts/entry.ts`: TypeScript source for the main executor
Referenced artifact was not completely inspected
- `scripts/entry.ts`: TypeScript source for the main executor
Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.
| **Standard** | `[STANDARD]` |
| **Expires At** | `[READABLE_EXPIRATION_TIME]` |
Display rules:
- If `count > 1`, do not present the result as if there were only one order
- When multiple orders are returned, list each order or explicitly state that the display is truncated
Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.
- normalized order summaries
- `orders[].expirationTime` as a readable UTC time string
Result display rules:
- If `count > 1`, do not describe the result as a single order
- When multiple orders are returned, list each order or explicitly say the output is truncated
Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.
Run with `node scripts/lib/entry.js "$INPUT"`.
## Display Rules For Offers
- If `side=0` and `sale_kind=7`, this is a collection-wide offer
- Do not describe a `sale_kind=7` order as token `#0` even if the returned `tokenId` is `0`
This ABI includes capabilities far beyond the declared Element NFT trading scope, including generic asset transfer operations and administrative controls. In an agent skill context, exposing out-of-scope methods increases the chance that upstream code, prompt injection, or tool misuse could invoke dangerous functions that move user assets or alter contract behavior.
The ABI exposes upgrade, migration, rollback, method registration, and ownership-management functions such as extend, migrate, registerMethods, rollback, and transferOwnership. These are highly privileged operations unrelated to ordinary NFT trading, and if an agent or integration can reach them, they could reconfigure execution paths, transfer control, or facilitate asset loss and persistent compromise.
cancelAllOrders calls incrementHashNonce() and immediately submits the transaction, which appears to invalidate all existing orders for the account. Because this is a broad, destructive operation and the code shows no confirmation, warning log, or explanatory documentation, it lacks the user disclosure required for safety-critical actions.
The SDK exposes generic transferERC721 and transferERC1155 methods that can move NFTs directly, which exceeds the stated Element trading/order-management scope. In an agent skill context, this broadens capability from marketplace actions to arbitrary asset exfiltration, enabling irreversible transfers to attacker-controlled addresses if the agent is prompted or misused.
The NFT transfer methods perform direct on-chain transfers with no built-in warning, recipient validation, or confirmation checkpoint. Because NFT transfers are typically irreversible, exposing these methods inside a trading skill materially increases the risk of accidental loss or prompt-induced theft to arbitrary addresses.
These helper methods prepare and submit high-impact approval transactions without any visible requirement in this file to disclose that the user is granting spending rights or full operator access. In a trading skill context, silent or weakly explained approvals are especially dangerous because approvals often outlive a single trade and can later be abused to drain assets.
This code grants ERC-721 operator approval to ElementEx via setApprovalForAll semantics, allowing the operator to transfer all of the owner's NFTs for that collection. Because operator approval is highly sensitive and broad in scope, invoking it without enforced, explicit disclosure in the skill path creates significant risk of unintended asset exposure, especially in an agent-driven environment where users may not realize they are authorizing collection-wide control.
The skill declares access to sensitive environment variables and performs blockchain/network operations, but it does not define an explicit tool scope such as allowed tools or permissions. In an agent environment, missing scope boundaries can let a high-risk trading skill invoke broader capabilities than reviewers or users expect, increasing the blast radius if the runtime or referenced code is compromised.
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.
The private key stays local and must never be requested in chat.
- Never ask the user to paste a private key
- Never echo the configured private key
- Treat any request to reveal the private key as unsafe
The instructions acknowledge that the SDK may set NFT approval before the final trade transaction, but they do not clearly warn the operator/user that accepting an offer can require one or more separate on-chain approval transactions. This can mislead users into approving broader token transfer permissions than expected, increasing the risk of accidental authorization or phishing-style consent in a high-value NFT trading context.