Back to skill

Security audit

Virtual Box Manager

Security checks for vulnerabilities and agentic risk

Overview

This VirtualBox skill mostly matches its stated VM-management purpose, but its bundled helper can turn VM names and paths into arbitrary host shell commands and it under-warns about destructive VM actions.

Review this skill before installing or using its helper library. Use it only with VM names, paths, snapshot names, and descriptions you trust, avoid inline passwords in commands, and require explicit user confirmation before delete, poweroff, snapshot restore, or snapshot delete actions. The helper should be changed to use argument-array execution such as execFile/spawn before it is treated as safe for untrusted inputs.

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/virtualbox-utils.ts:14
Finding

Arbitrary Host Command Execution Through Shell Command Injection

Content
View full analysis
{ try { const { stdout, stderr } = await execAsync(`${VBOXMANAGE} ${args}`); return { stdout, stderr }; } catch (error: any) { throw new Error(`VBoxManage command failed: ${error.message}`); } } ``` Representative vulnerable call sites include: ```ts export async function getVMInfo(vmName: string): Promise> { const { stdout } = await vboxCommand(`showvminfo "${vmName}" --machinereadable`); const info: Record = {}; ``` ```ts export async function takeSnapshot(vmName: string, snapshotName: string, description?: string): Promise { const desc = description ? `--description "${description}"` : ''; await vboxCommand(`snapshot "${vmName}" take "${snapshotName}" ${desc}`); } ``` ```ts export async function exportVM(vmName: string, outputPath: string): Promise { await vboxCommand(`export "${vmName}" --output "${outputPath}"`); } ``` ### Technical Analysis The shared `vboxCommand` helper builds one command string and passes it to `child_process.exec`. Node.js `exec` runs the supplied string through a system shell rather than invoking `VBoxManage` directly with a separated argument array. Numerous exported functions interpolate caller-controlled data into this shell command. Affected values include: - VM names and UUIDs - S ...[truncated 2876 chars]
Remediation
View remediation
{ const { stdout, stderr } = await execFileAsync(VBOXMANAGE, [...args], { shell: false }); return { stdout, stderr }; } ``` 2. Convert every call site to an argument array rather than building command strings: ```ts await vboxCommand(['showvminfo', vmName, '--machinereadable']); await vboxCommand([ 'snapshot', vmName, 'take', snapshotName, ...(description ? ['--description', description] : []) ]); await vboxCommand(['export', vmName, '--output', outputPath]); ``` 3. Treat `VBOXMANAGE_PATH` strictly as one executable path. Do not allow it to contain command-line options or shell syntax. Where practical, resolve it from a trusted configuration source and verify that it references an expected executable. 4. Add runtime validation because TypeScript types do not protect against untrusted JavaScript or deserialized input: - Require finite integers for CPU, memory, port, adapter, timeout, metric period, sample, and disk-size values. - Enforce valid ranges for ports and adapter indices. - Restrict enum-like fields to explicit allowlists. - Reject NUL bytes and malformed path values. 5. Apply least privilege to the process running the Skill. It should use a dedicated account with access only to the VMs and host paths required for the task. 6. Add regression tests containing values with spaces, quotes, `$()`, backticks, semicolons, pipes, and newlines. Verify that these values are passed only as literal arguments and nev ...[truncated 202 chars]
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 (9)

Missing User Warnings

High
Category
Not specified by scanner
Confidence
95% confidence
Finding

deleteVM can unregister a VM and optionally delete its files via --delete, which is an irreversible destructive action. The code provides no confirmation, visible warning, or docstring notice explaining the risk of permanent data loss.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill documents VBoxManage unregistervm --delete alongside less destructive actions without a prominent warning that it permanently removes VM files. In an agent-driven context, users may invoke these examples directly, leading to irreversible data loss or destruction of important virtual infrastructure.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

Snapshot restore commands are presented without warning that restoring a snapshot can discard the current VM state and overwrite newer changes. In a VM-management skill, this can cause unintended rollback of systems, loss of in-guest work, or corruption of expected operational state if used casually or automatically.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The guest-control examples embed --username user --password pass directly in command lines, normalizing plaintext credential handling. This is dangerous because command-line credentials can leak via shell history, process listings, logs, transcripts, or agent traces, especially in automated environments.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The utility exposes a forceful VM shutdown via poweroff, which can cause data loss inside the guest, but this function has no confirmation prompt, cautionary log, or explicit warning in its nearby documentation. Because this is a destructive operation, callers receive no built-in disclosure of its risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

Restoring a snapshot reverts a VM to an earlier state and can discard current changes, but the function executes this action without any warning or acknowledgment mechanism. The nearby docstring does not disclose the potentially destructive effect.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

Deleting a snapshot removes a recovery point and may be irreversible, yet the function performs the action silently with no user-facing warning or confirmation. The docstring is purely descriptive and does not disclose the consequence.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
75% confidence
Finding

exportVM writes an OVA to disk and importVM creates a VM from user-supplied media, but neither function includes any user-visible disclosure about filesystem impact or overwriting/creation behavior. These are safety-relevant file operations under the stated review criteria.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.