Back to skill

Security audit

Unikraft Cloud Sandbox

Security checks for vulnerabilities and agentic risk

Overview

This sandbox skill is coherent in purpose, but its local shell scripts have unsafe path and SSH handling that can affect user files and credentials.

Install only if you trust the publisher and UKC environment, and avoid using it on sensitive workspaces until the scripts validate sandbox names, store state in a private directory, verify sandbox host identity, and make destructive sync/delete behavior explicit and controlled.

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 (3)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/delete-sandbox.sh:7
Finding

Path Traversal in Sandbox State Paths Can Cause Arbitrary Directory Deletion

Content
View full analysis
` state directory. The deletion script then passes that path to `rm -rf`. Because `rm` resolves traversal components, it may recursively delete an attacker-selected directory writable by the process. The same weakness in `create-sandbox.sh` can cause SSH keys and the `fqdn` state file to be created outside the intended state directory. ### Attack Path 1. An attacker or untrusted caller supplies a sandbox name containing traversal components, such as `../path/to/target`. 2. The script constructs `/tmp/../path/to/target`, which resolves outside the intended sandbox state namespace. 3. For deletion, the selected directory must contain a readable `fqdn` file so execution reaches the API request. 4. If the UKC deletion request succeeds, the script executes `rm -rf` on the tr ...[truncated 696 chars]
Remediation
View remediation
&2 exit 1 fi ``` 2. Explicitly reject `/`, `\`, `.` and `..` path components. 3. Use a dedicated state root with restrictive permissions instead of the shared `/tmp` namespace: ```bash STATE_ROOT="${XDG_RUNTIME_DIR:-/run/user/$(id -u)}/unikraft-sandboxes" install -d -m 700 "${STATE_ROOT}" ``` 4. Resolve the candidate path with `realpath` and verify that its parent is exactly the approved state root before creating or deleting it. 5. Use `mktemp -d` for unique state directories and persist the exact generated path in trusted process state. 6. Before deletion, verify ownership, permissions, expected marker files, and that the resolved target is neither the state root nor any parent directory. 7. Consider removing files individually or using a file-descriptor-relative deletion mechanism rather than applying unrestricted `rm -rf` to a caller-derived path. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
scripts/sync-to-sandbox.sh:6
Finding

State-Controlled FQDN Is Embedded in an SSH Command String

Content
View full analysis
/dev/null'" \ "${LOCAL_DIR%/}/" \ "root@${FQDN}:/workspace/" ``` ```bash # scripts/sync-from-sandbox.sh:6-14 SANDBOX_NAME="${1:?sandbox name required}" LOCAL_DIR="${2:?local dir required}" FQDN="$(cat "/tmp/${SANDBOX_NAME}/fqdn")" KEY="/tmp/${SANDBOX_NAME}/id_ed25519" rsync -az \ -e "ssh -i ${KEY} -o StrictHostKeyChecking=no -o ConnectTimeout=10 -o ProxyCommand='openssl s_client -quiet -connect ${FQDN}:2222 2>/dev/null'" \ "root@${FQDN}:/workspace/" \ "${LOCAL_DIR%/}/" ``` ### Technical Analysis The scripts read `FQDN` from a local state file and interpolate it into rsync's `-e` remote-shell command string. The private-key path is also constructed from an unvalidated sandbox name and inserted into that string. Although the Bash variable expansions are quoted at the initial script layer, rsync subsequently treats the `-e` value as a remote-shell command specification. SSH also interprets the supplied `ProxyCommand`. Consequently, quote characters, whitespace, SSH options, or shell metacharacters in attacker-controlled state can alter downstream command parsing. This issue becomes directly reachable when an attacker can modify the state file or exploit the sandbox-name path traversal weakness to select a crafted `fqdn` file. ### Attack Path 1. The attacker creates or modifies a state directory reachable through `/tmp/`, or uses travers ...[truncated 992 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/sync-to-sandbox.sh:11
Finding

Disabled SSH Host Verification Permits Sandbox Endpoint Impersonation

Content
View full analysis
/dev/null'" \ "${LOCAL_DIR%/}/" \ "root@${FQDN}:/workspace/" ``` ```bash # scripts/sync-from-sandbox.sh:11-14 rsync -az \ -e "ssh -i ${KEY} -o StrictHostKeyChecking=no -o ConnectTimeout=10 -o ProxyCommand='openssl s_client -quiet -connect ${FQDN}:2222 2>/dev/null'" \ "root@${FQDN}:/workspace/" \ "${LOCAL_DIR%/}/" ``` ```bash # SKILL.md:71-74 ssh -i /tmp//id_ed25519 \ -o StrictHostKeyChecking=no \ -o ProxyCommand="openssl s_client -quiet -connect $(cat /tmp//fqdn):2222 2>/dev/null" \ root@"$(cat /tmp//fqdn)" ``` ### Technical Analysis All documented and scripted SSH connections set `StrictHostKeyChecking=no`. The SSH client therefore does not require a previously trusted host key before accepting the remote endpoint. The TLS wrapper uses `openssl s_client` without explicit certificate-chain and hostname verification options such as `-verify_return_error` and `-verify_hostname`. The combination means neither layer provides dependable, pinned authentication of the expected sandbox endpoint. Encryption alone does not prevent an active network, DNS, routing, or endpoint-substitution attacker from impersonating the sandbox. ### Attack Path 1. An attacker gains the ability to redirect or intercept traffic for the sandbox FQDN, such as through DNS manipulation, routing control, or modification of the local state file. 2. The attacker presents a TLS-wrapped SSH endpoint under their control. 3. The TLS wrapper does not explicitly reject an untrusted or hostname-mis ...[truncated 919 chars]
Remediation
View remediation
/known_hosts -o StrictHostKeyChecking=yes ``` 4. If TLS wrapping is required, invoke `openssl s_client` with certificate-chain verification and hostname verification using the correct CA bundle: ```bash openssl s_client \ -verify_return_error \ -verify_hostname "${FQDN}" \ -CAfile /path/to/trusted-ca.pem \ -quiet -connect "${FQDN}:2222" ``` 5. Validate the FQDN against the expected UKC service domain before connecting. 6. Fail closed if either TLS certificate validation or SSH host-key validation fails. 7. Remove the documentation that recommends `StrictHostKeyChecking=no` and replace it with the pinned-host-key workflow. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (15)

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding

The declared description says the skill runs agent tasks inside an isolated UKC sandbox VM and implies sandbox provisioning/use tied to specific UKC configuration variables. The provided code does not provision or manage a sandbox at all. Instead, it is a thin client that posts a command to /exec on an arbitrary fully qualified domain name over HTTPS and relays the response. While this may be a supporting component of a larger sandbox system, by itself it does not substantiate the declared primary purpose of spinning up or ensuring execution in an isolated UKC environment. The mismatch is therefore material.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The declared description centers on creating or using an isolated sandbox to run tasks safely. The provided code does not run tasks, provision a sandbox, or manage isolated execution. Its primary function is to pull data from an existing sandbox back onto the local machine, which is a materially different capability. While syncing artifacts could be a supporting part of a broader sandbox workflow, this specific skill description does not mention exporting data from the sandbox to the host or handling SSH/rsync-based retrieval using local key material and temporary files.

Content

No source excerpt is available for this finding.

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
100% confidence
Finding

The script deletes a filesystem path derived from a user-controlled argument using rm -rf. Although it is prefixed with /tmp/ and quoted, path traversal values such as '../../somewhere' will resolve outside /tmp, allowing unintended recursive deletion of arbitrary directories accessible to the script.

Content

Scanner excerpt · scripts/delete-sandbox.sh (reported line 20)May include surrounding context.

sh
-d "${PAYLOAD}"

# --- 2. Remove tmp dir (keys + state) ---
rm -rf "/tmp/${SANDBOX_NAME}"

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill invokes shell-capable scripts and commands but does not declare any tool scope restrictions such as allowed tools or permissions. That makes the skill's execution surface broader and less auditable, increasing the chance an agent will run powerful local commands without explicit review or policy gating.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The trigger condition activates on any case where isolation is 'necessary,' which is subjective and overly broad for a high-impact skill that provisions infrastructure, syncs files, and executes commands. Overbroad triggering can cause the agent to invoke this skill in unintended contexts, unnecessarily exposing credentials, local files, and remote execution capability.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · references/ukc_api.md (reported line 8)May include surrounding context.

md
| Var | Purpose |
|-----|---------|
| `UKC_TOKEN` | Bearer auth token |
| `UKC_METRO` | Base URL, e.g. `https://api.unikraft.io/v1/metro/fra0` |
| `UKC_USER` | Username / org identifier |
| `UKC_SANDBOX_IMAGE` | Image to use for sandbox instances |

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The script generates a private SSH key and stores it under /tmp, a shared world-searchable location that is commonly accessible to other local users for filename discovery and vulnerable to symlink/race handling mistakes. Although the private key file itself is chmod 600, placing sensitive credentials in /tmp without secure mktemp-style directory creation, cleanup, or user disclosure can expose sandbox access material on multi-user systems.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · scripts/create-sandbox.sh (reported line 25)May include surrounding context.

sh
# --- 2. Create tmp dir and SSH keypair ---
mkdir -p "${TMP_DIR}"
ssh-keygen -t ed25519 -N "" -f "${TMP_DIR}/id_ed25519" -C "${SANDBOX_NAME}" -q
chmod 600 "${TMP_DIR}/id_ed25519"
PUBKEY="$(cat "${TMP_DIR}/id_ed25519.pub")"

# --- 3. Create UKC instance ---

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The script provisions not only SSH access on port 2222 but also exposes an HTTPS service on port 443 that is not necessary for the stated purpose of creating a sandbox VM and returning its FQDN. In a sandboxing skill intended to run untrusted code, exposing an additional public web endpoint increases attack surface and may unintentionally publish services running inside the sandbox to the internet.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
70% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/create-sandbox.sh (reported line 48)May include surrounding context.

sh
autostart: true
  }')

RESPONSE=$(curl \
  --silent \
  -X POST \
  -H "Authorization: Bearer ${UKC_TOKEN}" \

External Transmission

Medium
Category
Data Exfiltration
Confidence
70% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/delete-sandbox.sh (reported line 13)May include surrounding context.

sh
# --- 1. Delete UKC instance ---
PAYLOAD=$(jq -n --arg name "${SANDBOX_NAME}" '[{name: $name}]')

curl --silent --fail -X DELETE \
  -H "Authorization: Bearer ${UKC_TOKEN}" \
  -H "Content-Type: application/json" \
  "${UKC_METRO}/instances" \

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

This shell script performs two safety-critical actions: it sends a DELETE request to remove a sandbox instance and then forcefully deletes the corresponding local directory with rm -rf. While comments describe the steps, there is no user-facing prompt, visible warning, or runtime disclosure before these irreversible actions execute.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The script performs an rsync pull from the remote /workspace into a user-supplied local directory, which can modify or overwrite files locally. There is no confirmation prompt, visible warning, or explanatory comment describing this data-affecting behavior beyond the terse usage line.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The script runs rsync with the --delete flag, which can remove files from the destination, but there is no confirmation prompt, visible logging, or warning comment describing that destructive behavior. Although syncing is the script's purpose, the deletion aspect is safety-critical and not disclosed to the user in the script text shown here.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The script sends the bearer token in Authorization headers and posts instance-creation data, including the generated public key, to a remote API via curl. While network provisioning is part of the script's purpose, there is no explicit warning in comments or output that sensitive authentication material and instance metadata are being sent to an external service.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.