T09 · Insecure Skill Coding Practices
- Location
scripts/mcp_client.py:288- Finding
Nonce API Key Is Exposed Through AI Conversations and Command-Line Arguments
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill’s mining-farm purpose is coherent, but it asks users to expose a powerful API key in chat or CLI and can trigger miner operations without a code-enforced confirmation gate.
Review before installing. Use only narrowly scoped, revocable Nonce keys, avoid pasting production secrets into ordinary chat, rotate any key shared this way, and treat write operations such as reboot, firmware update, network scan, and pool configuration as admin actions that need explicit out-of-band confirmation.
scripts/mcp_client.py:288Nonce API Key Is Exposed Through AI Conversations and Command-Line Arguments
scripts/mcp_client.py:142Privileged Nonce Credential Is Forwarded to a Third-Party MCP Relay
scripts/mcp_client.py:253Operational Write Actions Do Not Enforce the Documented Secondary Confirmation
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
notes: |
Thin MCP client wrapper — all Nonce API logic runs on Antalpha MCP Server.
User provides their own Nonce API Key per request (not stored server-side).
Get API Key from: https://app.nonce.app → Settings → API Keys
---
# Easy Mining Skill 🦐
The README explicitly instructs users to paste a live Nonce API key into AI chat, which is a sensitive secret that may be logged, retained, exposed to other tools, or mishandled by the agent framework. This is especially dangerous because the skill can perform operational actions on mining infrastructure, so compromise of the key could expose farm telemetry and enable unauthorized write operations such as rebooting miners or changing power modes.
The setup instructions tell the user to reveal the API key in natural-language conversation, which creates unnecessary secret exposure through chat transcripts, telemetry, prompt history, and possible downstream tool access. In this skill's context, the key is tied to mining-farm management and can likely grant access to operational data and privileged actions, increasing the consequences of leakage beyond simple read-only account access.
The English instructions repeat the same insecure pattern by asking the user to provide the API key directly to the AI, normalizing unsafe handling of credentials. Because this skill supports write operations on miners and farm configuration, a leaked key could allow unauthorized monitoring, task creation, miner reboot, firmware actions, or other disruptive changes depending on key scope.
The skill exposes networked MCP capabilities, including both read and write operations, but does not declare an explicit allowlist or permissions boundary. In an agent environment, missing tool scope increases the chance of overbroad invocation or unintended access to sensitive farm-management actions.
The activation text is very broad and includes many generic natural-language phrases around mining, status, revenue, and reboot operations. This can cause the skill to activate in unintended contexts, increasing the chance that sensitive farm data is queried or operational actions are proposed when the user did not intend to use this skill.
The skill explicitly tells users to paste their Nonce API key into chat for verification. Chat channels are often logged, retained, or exposed to other tools and model context, so collecting credentials this way creates a real risk of credential leakage and subsequent unauthorized access to mining-farm data and controls.
The document claims write actions require explicit confirmation, yet it provides a directly executable CLI example that invokes the write tool without any technical confirmation gate. Users or downstream agents may treat the example as approved procedure and perform disruptive miner operations immediately.
The file lists write-capable operations such as reboot, power mode changes, firmware update, pool configuration, and network scanning without any warning that they can disrupt miners, reduce hashrate, interrupt revenue, or alter fleet behavior. In this skill context, natural-language access to operational controls makes missing safety prompts more dangerous because an agent could translate an ambiguous request into a costly batch action.
The reference exposes miner.network.scan and miner.pool.config, which extend beyond passive farm monitoring into infrastructure discovery and miner reconfiguration. In a mining-management skill, these actions can materially alter device connectivity or enumerate internal network assets, so documenting them without clear scope justification increases the risk of misuse or over-privileged agent behavior.
The script accepts a sensitive Nonce API key from the CLI and forwards it to a remote MCP server for every tool call, but the execution path does not present a clear user-facing warning that credentials are being sent to a third-party endpoint (mcp-skills.ai.antalpha.com). In this skill context, that is especially sensitive because the same key enables visibility and potentially control over mining-farm infrastructure, so users need explicit notice and trust boundaries before transmission.
The CLI exposes write-capable operations beyond the manifest's stated batch actions, including miner.pool.config, miner.network.scan, and miner.light.flash. In a mining-farm management skill, undocumented operational commands are more dangerous because they can change pool settings or trigger network-wide actions on production hardware without users or reviewers understanding the full control surface. Pool reconfiguration in particular can redirect mining rewards or disrupt operations, making the impact materially higher than a simple documentation mismatch.
Several task descriptions and the warning note are presented in Chinese, while the rest of the document is in English, with no indication that the skill is intentionally region-specific or that users may choose their preferred language. This can violate language/locale policy when a specific language is imposed without opt-in or justification.
The code exposes an additional capability, easy-mining-list-agents, that is not disclosed in the skill description. Hidden or undocumented functionality weakens user consent and reviewability because operators may authorize a mining-management skill without realizing it can also enumerate agents/infrastructure components. In this context the risk is limited because the function appears read-only, but it still expands the accessible attack surface beyond the declared scope.