← MCP server and skill grades

windows-computer-use-mcp

sandraschi/windows-computer-use-mcp

D
Type
MCP server
Scanned
Nov 17, 2026
Version
1fda162413a8
Files read
472

This tool lets AI assistants view your Windows screen, click buttons, type keystrokes, and open programs directly on your PC. Because its human-approval and emergency-stop safeguards can be bypassed and its web mode runs without a password, a tricked AI assistant, malicious website, or attacker on your local network could take full control of your computer.

What it can reach

System
Views and controls your live Windows desktop by moving and clicking the mouse, typing keystrokes, managing windows, reading and writing the clipboard, listing running programs, taking screenshots, and accessing the webcam, keystroke recording, or PC lock.
Shell commands
Starts any program, executable, or command on your computer, including background screen-recording and desktop app processes.
Files
Reads and writes local files such as screenshots, screen recordings, CSV exports, saved macros, face profiles, logs, databases, and PNG images in your Documents folder.
Network
Opens local web and control servers on ports such as 10788, 10789, and 11238, and makes outbound HTTP connections including to local AI services.

Findings

2 high3 medium3 low
  1. HighUnauthenticated HTTP API and MCP endpoint allow cross-site and network remote code execution

    src/windows_computer_use_mcp/server.py:63

    When run in HTTP mode (via start.ps1, the recommended Tauri desktop app, or uvicorn), the FastAPI server exposes /api/v1/tools/call, /api/v1/windows/*, /api/v1/shutdown, and /mcp with no authentication, despite SECURITY.md and .env.example mentioning API keys/JWT. FastAPI has no Host header check (TrustedHostMiddleware) and no Origin check on requests, so any website the user visits can use DNS rebinding to call POST /api/v1/tools/call with automation_system(start_app) and run arbitrary commands, or use simple no-CORS POST requests to shut down the server or close windows. In addition, the CORS regex hardcodes the developer's hostname 'goliath' with allow_credentials=True (which an attacker on a local network can claim via mDNS/LLMNR/NetBIOS on any PC not named goliath), and .env.example / config.py set HOST=0.0.0.0, which server.py honors when MCP_HOST is unset, exposing full desktop control to the entire LAN.

    Fix: Require a random bearer token on all /api/v1/* and /mcp HTTP routes, enforce TrustedHostMiddleware restricting Host to 127.0.0.1 and localhost, remove 'goliath' from CORS origins, validate Origin headers on state-changing requests, and change HOST defaults in config.py and .env.example to 127.0.0.1.

  2. HighHuman-in-the-loop (HITL), kill switch, dry-run, and app allowlist safeguards are systematically bypassed

    src/windows_computer_use_mcp/app.py:126

    The documentation promises that mutating actions require human approval (HITL) and that KILL_SWITCH=1, DRY_RUN=1, and ALLOWED_APPS block unwanted actions. In practice, approve_automation shows no OS confirmation prompt to the human user—it is an ordinary MCP tool (marked destructiveHint: False) that sets an in-memory timer, and blocked tool messages explicitly tell the AI agent to call approve_automation(5) itself. Furthermore, automation_elements(click/set_text), automation_dialog(submit_path), automation_shortcut(send), automation_task(run), automation_smart(click), and automation_system(start_app/clipboard_set) never check approval_state.is_approved(), and automation_system(start_app), automation_dialog, automation_task, and automation_smart do not call before_mutation() at all—bypassing KILL_SWITCH=1, DRY_RUN=1, rate limits, and ALLOWED_APPS.

    Fix: Show a native OS confirmation dialog inside approve_automation (requiring physical user interaction rather than letting the LLM self-approve), and enforce both approval_state.is_approved() and before_mutation() across every mutating tool including start_app, elements, dialog, shortcut, task, smart, windows, and mission replay.

  3. MediumDynamic module import in automation_mission and automation_macro bypasses opt-in gates for keylogger and webcam tools

    src/windows_computer_use_mcp/tools/portmanteau_mission.py:159

    Both global_keylogger and automation_face are documented as strictly opt-in and unregistered unless WINDOWS_COMPUTER_USE_MCP_ENABLE_KEYLOGGER=1 or ENABLE_FACE=1 is set at startup. However, neither module checks those flags internally; they rely only on tools/__init__.py skipping their import. In automation_mission (_call_tool) and automation_macro (_call_tool_by_name), passing tool='keylogger' or tool='face' calls importlib.import_module on portmanteau_keylogger or portmanteau_face at runtime, which executes @app.tool() and permanently registers the keylogger and face/webcam tools on the live server (and immediately invokes automation_face). Passing a dotted tool_name also imports any arbitrary Python module on sys.path.

    Fix: Replace dynamic importlib.import_module dispatch with an explicit allowlist of already-registered MCP tools on the app instance, and check is_keylogger_tool_enabled() and is_face_tool_enabled() inside global_keylogger and automation_face at call time.

  4. MediumUnescaped pywinauto SendKeys syntax in set_text fallback allows OS hotkey and command injection

    src/windows_computer_use_mcp/tools/portmanteau_elements.py:640

    When automation_elements(operation='set_text') writes text into modern UIA, WPF, or Electron controls where direct WM_SETTEXT fails, it falls back to element.type_keys(request.text, with_spaces=True) (and POST /api/v1/windows/type calls type_keys directly). In pywinauto, type_keys interprets SendKeys metacharacters (^ for Ctrl, % for Alt, + for Shift, ~ for Enter, and {VK_LWIN} for the Windows key) rather than literal text. If an agent copies untrusted text from a webpage, issue, or email into a text box using set_text, embedded sequences such as '{VK_LWIN}rcmd{ENTER}' trigger the Windows Run dialog and execute arbitrary commands even though the agent only intended to enter plain text.

    Fix: Escape SendKeys special characters (+, ^, %, ~, (, ), {, }) before passing user or agent text to element.type_keys(), or paste literal text safely.

  5. MediumTools annotated readOnlyHint: True send live keystrokes, scroll windows, and overwrite arbitrary files

    src/windows_computer_use_mcp/tools/portmanteau_analyze.py:464

    analyze_winapp is registered with _READONLY_LOCAL (readOnlyHint: True), which tells MCP clients such as Claude Code and Cursor that the tool makes no changes and is safe to run automatically without asking the user. In reality, analyze_winapp brings windows to the foreground, writes files to ./winapp_analysis, scrolls the mouse wheel (crawl_scroll), and in operation='discover' sends live F1, F5, Alt, Ctrl+O, Ctrl+S, Ctrl+P, and Escape keystrokes to the target application. Similarly, automation_visual and automation_assert advertise readOnlyHint: True even though their output_path parameter writes image or MP4/GIF files to any path on disk.

    Fix: Change analyze_winapp to _MUTATING_LOCAL (readOnlyHint: False) and restrict or re-annotate file-writing operations on automation_visual and automation_assert so MCP clients prompt the user appropriately.

  6. LowHardcoded encryption key, unsafe pickle deserialization, and path traversal in face recognition storage

    src/windows_computer_use_mcp/tools/portmanteau_face.py:64

    SECURITY.md and the automation_face tool description state that biometric face encodings are stored in an encrypted local database. However, both portmanteau_face.py and face_recognition.py hardcode the Fernet key in source code as b'your-32-byte-encryption-key-here' with no way to configure a real secret key, providing no protection if face files are read. In addition, load_known_faces falls back to pickle.loads() on unencrypted bytes when decryption fails (allowing arbitrary code execution if a crafted .pkl file is placed in data/known_faces), and profile names in add/enroll/delete are not sanitized for path separators, allowing path traversal when writing or deleting .pkl files.

    Fix: Generate and store a per-user random Fernet key via Windows DPAPI/Credential Manager (or require an environment key), serialize face encodings as JSON/base64 instead of pickle, and validate profile names against a strict alphanumeric pattern.

  7. LowEvidence download HTTP endpoint recursively exposes all PNG files inside the user's Documents folder

    src/windows_computer_use_mcp/api/v1/endpoints/evidence.py:33

    GET /api/v1/download/{filename} is meant to serve task evidence screenshots by basename, but _evidence_roots() adds the user's entire ~/Documents directory and _resolve_evidence_file() runs root.rglob(filename) across all subdirectories. When the HTTP server is running, any local caller can download any .png file from anywhere in ~/Documents by name, and any external website can probe for the existence and pixel dimensions of private .png files in ~/Documents via cross-origin <img> tags.

    Fix: Remove Path.home() / 'Documents' from _evidence_roots() so only dedicated evidence directories (%LOCALAPPDATA%/cua-mcp/evidence) are served, avoid recursive rglob over broad user folders, and require authentication.

  8. LowOptional Tesseract installer script runs downloaded executable without checksum verification

    web_sota/scripts/install-tesseract.ps1:133

    During optional Tesseract setup (bundled in the NSIS desktop installer post-install hook and also in scripts/install-tesseract.ps1), the script downloads tesseract-ocr-w64-setup-5.5.0.20251114.exe from GitHub Releases and immediately executes it silently with /S without verifying a SHA-256 hash or Authenticode signature. If the upstream release asset were replaced or intercepted via a trusted corporate proxy, unverified code would run.

    Fix: Verify the downloaded installer with Get-FileHash -Algorithm SHA256 against a pinned expected hash for the pinned version before calling Start-Process.