Back to skill

Security audit

0xscada

Security checks for vulnerabilities and agentic risk

Overview

This skill is mostly a disclosed local wrapper, but it can run an external npm project with weak validation and asks users to configure sensitive blockchain credentials without enough safety guidance.

Install only if you trust the local 0xSCADA repository that SCADA_DIR points to and understand that starting the skill may run that repository's npm dev script. Keep PRIVATE_KEY and FLUX_AUTH_TOKEN out of committed files and shared shells, prefer read-only or test credentials, and review the target package.json before starting the server.

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

Error
Location
scripts/0xscada.sh:8
Finding

Arbitrary External Project Execution Through Insufficient Directory Validation

Content
View full analysis

Vulnerability Details

File Location: scripts/0xscada.sh, lines 8 and 25–36
Vulnerability Type: Untrusted external project execution
Risk Level: High

bash
SCADA_DIR="${SCADA_DIR:-$(cd "$SKILL_DIR/../../.." && pwd)}"

cmd_start() {
  if is_running; then
    echo "0xSCADA already running on $BASE_URL"
    return 0
  fi

  # Security validation: Ensure we are running the actual 0xSCADA project
  if [[ ! -f "$SCADA_DIR/server/index.ts" || ! -f "$SCADA_DIR/package.json" ]]; then
    echo "Error: SCADA_DIR ($SCADA_DIR) does not appear to contain the 0xSCADA project."
    echo "Expected to find server/index.ts and package.json."
    echo "Please set the SCADA_DIR environment variable to the correct 0xSCADA repository root."
    exit 1
  fi

  echo "Starting 0xSCADA from $SCADA_DIR..."
  cd "$SCADA_DIR"
  npm run dev &

Technical Analysis

The script accepts SCADA_DIR from an environment variable and uses it as the working directory for npm run dev. Its validation only verifies that server/index.ts and package.json exist. These filename checks do not establish repository identity, integrity, ownership, trustworthiness, or whether the selected directory is within an approved path.

An attacker who can influence SCADA_DIR or control the referenced directory can create the two expected files and define an arbitrary dev lifecycle script in package.json. The subsequent npm run dev command then executes that attacker-controlled script with the privileges and environment of the user running the skill.

This is not shell metacharacter injection through SCADA_DIR, because the variable is quoted. The vulnerability instead arises from treating an insufficiently authenticated external project and its package script as trusted executable code.

Attack Path

  1. The attacker creates or controls a directory accessible to the skill.
  2. The attacker places a server/index.ts file in that directory.
  3. The attacker creates a `package.jso ...[truncated 1442 chars]
Remediation
View remediation

Remediation Suggestions

  1. Do not execute package scripts from an environment-selected, unauthenticated directory.
  2. Bundle the required server implementation with the reviewed artifact where practical, or configure an administrator-controlled canonical path that ordinary callers cannot override.
  3. Resolve the selected path with realpath and verify that it is located beneath an explicitly approved root directory.
  4. Verify repository identity and integrity before execution, such as by pinning an expected commit or release and validating cryptographic hashes or signatures.
  5. Validate trusted ownership and permissions on the repository, package.json, relevant source files, and parent directories. Reject locations writable by untrusted users.
  6. Do not rely only on the existence of expected filenames. Validate expected package identity and ensure the invoked command is fixed and reviewed.
  7. Prefer invoking a specific audited executable with fixed arguments instead of running a mutable npm lifecycle script.
  8. Remove or tightly restrict the SCADA_DIR environment override. If configurability is necessary, require explicit administrator approval during setup rather than accepting it at every invocation.
  9. Run the external service with least privilege, a minimal environment, restricted filesystem access, and constrained network permissions.
  10. Require clear user confirmation before executing code from any repository outside the audited skill package.
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 (3)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The declared description presents a substantial industrial/SCADA platform with blockchain, memory integration, telemetry, geometry classification, and verifiable state features. The supplied code does not implement any of those capabilities directly. Instead, it is only a local operational wrapper script for starting and checking the status of a server on localhost:5000. While such a wrapper could support a larger SCADA project, this code chunk itself only manages process startup/status and performs a health check, which is a materially narrower and different behavior than the declared product-level description.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill explicitly documents shell-based setup and execution (npm install, ./scripts/0xscada.sh start) but does not declare any tool scope such as allowed-tools or permissions. That mismatch can cause the skill to obtain or imply broader execution capability than users expect, which is especially risky because it launches a local SCADA-related server and interacts with developer tooling and local repositories.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The documentation instructs users to provide a PRIVATE_KEY for blockchain transaction signing but gives no explicit warning about secure secret handling, irreversible on-chain actions, or financial/operational consequences. In a SCADA-adjacent skill, combining industrial-state workflows with blockchain signing increases the chance that users expose high-value credentials or trigger sensitive transactions without informed consent.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.