Back to skill

Security audit

DOSBox

Security checks for vulnerabilities and agentic risk

Overview

This DOSBox helper is mostly purpose-aligned, but its bundled generators can produce unsafe commands or config files when given untrusted paths or arguments.

Install only if you will use it with trusted game paths, ISO paths, executable names, and config options. Review generated launch commands and .conf files before running them, especially when working with downloaded archives or paths supplied by someone else.

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

Warning
Location
scripts/resolve_dosbox.py:33
Finding

Shell Command Injection in Generated DOSBox Launch Commands

Content
View full analysis
str: return '"' + value.replace('"', '\\"') + '"' def build_folder_command(binary: str, game_path: Path) -> str: return ( f"{quote(binary)} " f"-c \"mount c {game_path}\" " f"-c \"c:\" " f"-c \"dir\"" ) def build_iso_command(binary: str, game_path: Path | None, iso_path: Path) -> str: parts = [quote(binary)] if game_path: parts.append(f'-c "mount c {game_path}"') parts.append(f'-c "imgmount d {iso_path} -t iso"') if game_path: parts.append('-c "c:"') else: parts.append('-c "d:"') parts.append('-c "dir"') return " ".join(parts) ``` ### Technical Analysis The command-building functions interpolate `game_path` and `iso_path` directly into shell-ready command strings. These paths are placed inside nested double-quoted arguments without escaping embedded quotes, shell metacharacters, command separators, or control characters. The `quote()` function is only applied to the detected DOSBox binary, not to either user-controlled path. Furthermore, replacing a quote with `\"` is not a portable command-line serialization strategy because escaping rules differ between POSIX shells, Windows `cmd.exe`, and PowerShell. The script only prints these commands and does not execute them itself. Exploitation therefore requires a user or an Agent to copy or execute the generated command. This is nevertheless a meaningful trust-boundary issue because the Skill explicitly presents the output as a launch command suitable for use. ### Attack Path 1. An attacker supplies a game directory or ISO whose path contains a quote followed by shell syntax. 2. A user or Agent invokes `resolve_dosbox.py` with that path. ...[truncated 1064 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/make_dosbox_conf.py:12
Finding

DOSBox Configuration and Autoexec Command Injection

Content
View full analysis
str: return str(path.resolve()).replace('\\', '/') def choose_binary() -> str | None: binaries = find_binaries() if not binaries: return None return next((b for b in binaries if 'dosbox-x' in b.lower()), binaries[0]) def build_conf(game_path: Path, iso_path: Path | None, exe: str | None, fullscreen: bool, output: str, cycles: str, binary: str | None) -> str: autoexec = [ f"mount c \"{quote_autoexec_path(game_path)}\"", ] if iso_path: autoexec.append(f"imgmount d \"{quote_autoexec_path(iso_path)}\" -t iso") autoexec.append("c:") autoexec.append("dir") if exe: autoexec.append(exe) full = "true" if fullscreen else "false" binary_comment = binary or "NOT FOUND" return f"""# Generated by make_dosbox_conf.py # Preferred emulator: {binary_comment} [sdl] fullscreen={full} output={output} [render] aspect=true scaler=normal2x [cpu] core=auto cputype=auto cycles={cycles} cycleup=500 cycledown=500 [mixer] rate=44100 blocksize=1024 prebuffer=20 [sblaster] sbtype=sb16 sbbase=220 irq=7 dma=1 hdma=5 mixer=true oplmode=auto oplemu=default oplrate=44100 [autoexec] {"\n".join(autoexec)} """ ``` ### Technical Analysis Several command-line values are inserted directly into an executable DOSBox configuration: - `game_path` and `iso_path` are placed inside quoted `[autoexec]` commands, but embedded quotes and line breaks are not escaped or rejected. - `exe` is appended verbatim to `[autoexec]`. Although this option intentionally identifies a command to run, embedded line breaks allow it to introduce an arbitrary sequence of additional DOSBox commands. - `output` and `cycles` are placed directly into configuration ...[truncated 2149 chars]
Remediation
View remediation
Vulnerability Patterns
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (1)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill references helper scripts that can generate configuration files, which implies file write capability, but it does not declare any tool scope or permissions boundary. This can lead to overbroad agent behavior where file creation or modification occurs without explicit authorization, increasing the risk of unintended writes to user-controlled paths.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.