T09 · Insecure Skill Coding Practices
- Location
lib/wallet.ts:27- Finding
Hard-Coded Shared Oracle API Key
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This marketplace skill is mostly coherent, but it handles wallet secrets in an unsafe and under-disclosed way, so users should review it carefully before installing.
Install only if you are comfortable with this skill reading your shared Unicity wallet and handling the raw private key in-process for marketplace authentication. Prefer a test wallet or sandboxed account, run dependencies from the lockfile before commands, avoid direct unpinned npx execution, and treat posted listings plus profile data as public marketplace activity. The hard-coded API key and raw private-key extraction should be fixed before broad trust.
lib/wallet.ts:27Hard-Coded Shared Oracle API Key
SKILL.md:48Documented npx Workflow May Download and Execute Unreviewed Package Code
The declared description is about marketplace actions on UniMarket and negotiation via Nostr. This code chunk does not implement search, posting intents, discovery, negotiation, or Nostr messaging. Instead, it performs wallet management: reading a mnemonic from local storage, loading trust base configuration, initializing a Sphere wallet client, and exposing direct access to the private key via an internal field. Accessing and returning a private key is a sensitive capability not reflected in the declared purpose, making this a clear description/behavior mismatch.
The declared description presents a full UniMarket P2P trading capability with offer posting, offer discovery, and Nostr-based negotiation. The supplied code chunk only fetches a list of categories from a public search endpoint and logs them. This is a narrow catalog/listing function and does not demonstrate the core declared marketplace or negotiation behaviors. Therefore, the description materially overstates what the code actually does.
The code chunk is focused on intent lifecycle management for a marketplace: create a buy/sell intent, list intents, and close an intent. That partially matches the description's posting and discovering offers. However, the description also claims negotiation via Nostr and broader marketplace trading behavior, neither of which is implemented in this code. Instead, the script performs authenticated REST API operations using a loaded wallet/private key. Because a significant declared capability (negotiation via Nostr) is absent and the actual behavior is narrower and somewhat different, this is a mismatch.
The declared description centers on marketplace trading functionality, but this code chunk only fetches and displays the authenticated agent's profile. While it references a Nostr public key as part of the profile output, it does not perform offer discovery, posting intents, or negotiating deals. This is a materially different primary purpose, so the description does not accurately represent the code.
The code chunk is an agent registration script, not a marketplace trading/searching implementation. Its primary function is to collect a display name, derive the agent's public key from the local wallet, and register that identity with a server API. While the optional Nostr pubkey may relate to the broader system, this script does not post buy/sell intents, discover offers, or negotiate deals. The wallet/key usage and server registration are materially different from the declared purpose, so this is a clear description-behavior mismatch.
The supplied code only implements searching/discovery of marketplace intents. It accepts a query plus optional type/category/limit filters, calls a public search API endpoint, and displays results. There is no functionality for posting intents, executing trades, or negotiating via Nostr in this chunk. Because the declared description presents a broader trading and negotiation capability than the code actually provides, the description does not accurately represent this specific code chunk.
Referenced artifact was not completely inspected
npx tsx scripts/register.ts --name "YourAgentName" --nostr <your-nostr-pubkey>
Referenced artifact was not completely inspected
npx tsx scripts/intent.ts post --type sell --desc "Offering web scraping service, any site" --category services --price 5
Referenced artifact was not completely inspected
npx tsx scripts/intent.ts post --type sell --desc "Offering web scraping service, any site" --category services --price 5
Referenced artifact was not completely inspected
npx tsx scripts/intent.ts post --type sell --desc "Offering web scraping service, any site" --category services --price 5
Referenced artifact was not completely inspected
npx tsx scripts/intent.ts post --type sell --desc "Offering web scraping service, any site" --category services --price 5
The code deliberately bypasses the SDK's public safety boundary by reading the TypeScript-private _identity field and returning the raw privateKey. Exposing a wallet private key is highly dangerous because any downstream caller, logger, plugin action, or compromised component can exfiltrate it and fully impersonate the wallet owner, irreversibly stealing funds or signing malicious actions.
The function accesses and exposes the most sensitive wallet credential without any user disclosure, consent flow, or obvious functional need for a marketplace trading/search skill. In this context, silent key extraction is especially suspicious because users would reasonably expect order posting or negotiation, not raw secret export, making covert credential theft or misuse much more dangerous.
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
"@libp2p/crypto": "^5.1.7",
"@libp2p/interface": "^3.1.0",
"@libp2p/kad-dht": "^16.1.0",
"@libp2p/keychain": "^6.0.5",
"@libp2p/logger": "^6.0.5",
"@libp2p/utils": "^7.0.5",
"interface-datastore": "^9.0.2",
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
"@libp2p/crypto": "^5.1.7",
"@libp2p/interface": "^3.1.0",
"@libp2p/kad-dht": "^16.1.0",
"@libp2p/keychain": "^6.0.5",
"@libp2p/logger": "^6.0.5",
"@libp2p/utils": "^7.0.5",
"interface-datastore": "^9.0.2",
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
"@libp2p/crypto": "^5.1.7",
"@libp2p/interface": "^3.1.0",
"@libp2p/kad-dht": "^16.1.0",
"@libp2p/keychain": "^6.0.5",
"@libp2p/logger": "^6.0.5",
"@libp2p/utils": "^7.0.5",
"interface-datastore": "^9.0.2",
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
"@libp2p/crypto": "^5.1.7",
"@libp2p/interface": "^3.1.0",
"@libp2p/kad-dht": "^16.1.0",
"@libp2p/keychain": "^6.0.5",
"@libp2p/logger": "^6.0.5",
"@libp2p/utils": "^7.0.5",
"interface-datastore": "^9.0.2",
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
"@libp2p/crypto": "^5.1.7",
"@libp2p/interface": "^3.1.0",
"@libp2p/kad-dht": "^16.1.0",
"@libp2p/keychain": "^6.0.5",
"@libp2p/logger": "^6.0.5",
"@libp2p/utils": "^7.0.5",
"interface-datastore": "^9.0.2",
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
"@libp2p/crypto": "^5.1.7",
"@libp2p/interface": "^3.1.0",
"@libp2p/kad-dht": "^16.1.0",
"@libp2p/keychain": "^6.0.5",
"@libp2p/logger": "^6.0.5",
"@libp2p/utils": "^7.0.5",
"interface-datastore": "^9.0.2",
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
"@libp2p/crypto": "^5.1.7",
"@libp2p/interface": "^3.1.0",
"@libp2p/kad-dht": "^16.1.0",
"@libp2p/keychain": "^6.0.5",
"@libp2p/logger": "^6.0.5",
"@libp2p/utils": "^7.0.5",
"interface-datastore": "^9.0.2",
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
"@libp2p/crypto": "^5.1.7",
"@libp2p/interface": "^3.1.0",
"@libp2p/kad-dht": "^16.1.0",
"@libp2p/keychain": "^6.0.5",
"@libp2p/logger": "^6.0.5",
"@libp2p/utils": "^7.0.5",
"interface-datastore": "^9.0.2",
The lockfile includes '@libp2p/kad-dht' version 16.1.3, which is flagged with a high-severity advisory for unvalidated PUT_VALUE records leading to unbounded disk exhaustion. In this skill's marketplace/networking context, libp2p-related optional dependencies can increase exposure to untrusted peer input, making denial-of-service against the host more plausible if the affected component is enabled.
The dependency tree contains 'ws' version 7.5.10, which is associated with a memory exhaustion DoS advisory. Because this skill negotiates and communicates over networked protocols and includes optional websocket-capable components, an attacker may be able to send crafted fragmented frames or chunks to degrade or crash the process if the vulnerable path is reachable.
The lockfile includes 'axios' 1.13.5 with multiple advisories, including SSRF-related and prototype-pollution-adjacent impacts. In a trading/marketplace skill that likely makes outbound requests and handles remote data, these issues could expose internal network resources, tamper with request behavior, or facilitate credential/response compromise if vulnerable axios features are exercised.
The presence of 'brace-expansion' 1.1.12 introduces several denial-of-service advisories related to pathological expansion behavior. While commonly triggered in tooling or pattern parsing rather than core runtime paths, it remains a real supply-chain risk if any reachable code processes attacker-influenced glob-like patterns.
No suspicious patterns detected.