Back to skill

Security audit

superrare-mint

Security checks for vulnerabilities and agentic risk

Overview

The skill matches its NFT minting purpose, but it needs Review because it can reuse Bankr credentials and submit media or credential-bearing requests to configurable endpoints without strong destination controls.

Install only if you are comfortable with this skill uploading the media and metadata you select and using your Bankr API key to submit mint transactions. Prefer explicit command-line contract and deploy receipt paths, verify the printed contract and chain before broadcasting, keep API endpoints at the official defaults, and avoid running it in an environment where untrusted files can modify Bankr or SuperRare config.

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
scripts/mint-via-bankr.sh:139
Finding
Unvalidated Network Endpoints Can Receive Bankr Credentials or User-Selected Media<![CDATA[ ## Vulnerability Details **File Locations**: - `scripts/lib.sh:130-145` - `scripts/mint-via-bankr.sh:139-154` - `scripts/lib.sh:60-61` - `scripts/mint-art.sh:102-104` - `scripts/pin-metadata.mjs:89-108` - `scripts/pin-metadata.mjs:181-183` **Vulnerability Type**: Unvalidated credential and media transmission destinations **Risk Level**: Medium ### Vulnerable Code The Bankr API URL is read from external configuration without validating its scheme or hostname: ```bash resolve_bankr_api_url() { local config_path for config_path in \ "$HOME/.openclaw/skills/bankr/config.json" \ "$HOME/.openclaw/workspace/skills/bankr/config.json" \ "$HOME/.bankr/config.json" do if [ -f "$config_path" ]; then local value value="$(jq -r '.apiUrl // empty' "$config_path")" if [ -n "$value" ]; then echo "$value" return fi fi done echo "https://api.bankr.bot" } ``` The resolved URL receives the real Bankr API key in an HTTP header: ```bash BANKR_API_KEY="$(resolve_bankr_api_key)" BANKR_API_URL="$(resolve_bankr_api_url)" REQUEST_PAYLOAD="$(jq -n \ --arg to "$COLLECTION_CONTRACT" \ --argjson chainId "$CHAIN_ID" \ --arg data "$CALLDATA" \ --arg description "$DESCRIPTION" \ '{ transaction: { to: $to, chainId: $chainId, value: "0", data: $data }, description: $description, waitForConfirmation: true }')" RESPONSE="$(curl -sS --max-time "$BANKR_SUBMIT_TIMEOUT_SECONDS" -X POST "$BANKR_API_URL/agent/submit" \ -H "X-API-Key: $BANKR_API_KEY" \ -H "Content-Type: application/json" \ -d "$REQUEST_PAYLOAD")" ``` The SuperRare-compatible media API endpoint is also configurable without destination validation: ```bash CONFIG_API_BASE_URL="$(jq -r '.apiBaseUrl // "https://api.superrare.org"' "$CONFIG_FILE")" ``` ```bash PIN_ARGS=(--name "$NAME" --description "$DESCRIPTION" --image "$IMAGE" --api-base-url "$CONFIG_API_BASE_URL") ``` The media upload implementat ...[truncated 5459 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. **Pin credential-bearing requests to a trusted endpoint** - Use `https://api.bankr.bot` as the only default destination. - Maintain an explicit allowlist of approved Bankr hostnames. - Do not send `X-API-Key` to an endpoint outside that allowlist without a separate, explicit opt-in intended for development environments. 2. **Enforce secure URL parsing** - Parse URLs rather than validating them with substring or prefix comparisons. - Require the `https:` scheme. - Reject URLs containing embedded usernames or passwords. - Validate the normalized hostname and effective port. - Disable unexpected redirects for credential-bearing requests, or verify every redirect destination before forwarding the authorization header. 3. **Separate endpoint trust from credential discovery** - Do not automatically combine an API key from the environment with an API URL from a different configuration source. - Store trusted endpoint selection in a protected setting or require the key and endpoint to come from the same explicitly selected profile. - Check ownership and permissions of credential-bearing configuration files where practical. 4. **Validate media API and upload destinations** - Require HTTPS for `apiBaseUrl`. - Default to and allowlist `api.superrare.org` for production use. - Validate each returned presigned URL against expected storage-provider hostnames and schemes before uploading. - Resolve and reject loopback, link-local, private-network, and cloud metadata destinations unless an explicit development mode requires them. 5. **Add explicit user confirmation for non-default endpoints** - Display the normalized API hostname before reading or uploading media. - Require a dedicated flag such as `--allow-custom-api-endpoint` for custom destinations. - Clearly warn that selected files and metadata will be transmitted to that host. 6. **Minimize credential exposure** - Use `curl ...[truncated 606 chars]
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (8)

Lp3

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding
The skill advertises shell and network-capable behavior but does not declare any explicit tool scope such as permissions or allowed-tools. In an agent environment, that weakens containment and makes it harder to restrict or review what the skill may invoke, especially since it performs uploads, API calls, and blockchain transaction submission.

Session Persistence

Medium
Category
Rogue Agent
Content
- If neither `receiver` nor `royaltyReceiver` is set, the skill calls `addNewToken(string)`.
- If either receiver field is provided, the skill calls `mintTo(string,address,address)`.
- If only one of `receiver` or `royaltyReceiver` is set, the other defaults to the same address.
- Successful broadcasts write receipts into `receipts/`.

## Deploy receipt auto-resolution
Confidence
60% confidence
Finding
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Context-Inappropriate Capability

Medium
Confidence
94% confidence
Finding
The script searches for a Bankr API key and API URL in user-level locations outside this skill, including another skill's workspace and a global ~/.bankr config. That creates cross-skill trust and ambient credential access: running this skill may silently consume credentials intended for a different tool, and if an attacker can influence those files they can redirect API usage or cause unauthorized actions under the user's Bankr account.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
The code accesses sensitive Bankr credentials from environment, systemd user environment, and external config files without any user-facing warning or consent step. In an agent skill context, that is especially risky because the operator may not realize this minting helper can reach beyond its own config and automatically leverage existing credentials to perform privileged API-backed actions.

Context-Inappropriate Capability

Medium
Confidence
92% confidence
Finding
The receipt resolver auto-discovers deploy receipts from sibling directories, another workspace skill, and the user's home directory, then uses the newest matching file. This can bind minting to the wrong collection or to attacker-planted metadata without an explicit user choice, especially in a multi-skill/shared-workspace environment where file placement influences behavior.

Missing User Warnings

Medium
Confidence
89% confidence
Finding
This script uploads user-provided artwork and metadata by invoking `pin-metadata.mjs` with an API base URL, but it does not present any explicit warning or confirmation that local files and descriptive content will be transmitted to a remote service. In a minting workflow this network transfer is expected, but the lack of a clear user-facing disclosure can still cause unintended publication of sensitive, private, or embargoed media.

External Transmission

Medium
Category
Data Exfiltration
Content
waitForConfirmation: true
  }')"

RESPONSE="$(curl -sS --max-time "$BANKR_SUBMIT_TIMEOUT_SECONDS" -X POST "$BANKR_API_URL/agent/submit" \
  -H "X-API-Key: $BANKR_API_KEY" \
  -H "Content-Type: application/json" \
  -d "$REQUEST_PAYLOAD")"
Confidence
70% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Context-Inappropriate Capability

Low
Confidence
82% confidence
Finding
The documented API key resolution searches systemd user environment and several external config locations beyond the skill directory. That broad secret discovery behavior expands the trust boundary and can cause the skill to consume credentials the operator did not intend to expose to this specific skill, increasing risk of secret misuse or accidental cross-skill credential access.

Static analysis

No suspicious patterns detected.