← MCP server and skill grades

hypruse

IlyasKhallouki/hypruse

B
Type
MCP server
Scanned
Nov 17, 2026
Version
1ca642dbe266
Files read
124

hypruse is an MCP server, CLI, and agent skill that lets AI agents view and control a live Hyprland Linux desktop using compositor IPC, screenshots, accessibility trees, and virtual mouse and keyboard input. The biggest risk is that it grants full desktop control and shell launching, and a comma-injection flaw in its background keyboard path lets a tricked agent send keystrokes to out-of-scope windows or authentication prompts past its confinement and auth guards.

What it can reach

System
Reads the Hyprland window, workspace, layer, and keybind state over IPC; captures monitor and window screenshots via grim; reads and activates app controls via the AT-SPI accessibility D-Bus; injects mouse events over Wayland virtual pointer and keystrokes via wtype or sendshortcut; and reads or writes clipboard text when HYPRUSE_CLIPBOARD=1 is enabled.
Shell commands
Runs arbitrary shell commands in the Hyprland session through the launch tool (hyprctl dispatch exec) and triggers user-configured compositor keybinds through use_bind.
Files
Writes temporary screenshots, CLI state, and an activity beacon under XDG_RUNTIME_DIR/hypruse (or /tmp/hypruse), moves captures to caller-chosen paths via CLI --out, optionally appends audit logs to XDG_STATE_HOME/hypruse/journal.ndjson, and edits MCP client configs and agent skill directories when the user runs hypruse init or hypruse skill install.
Browser
Can view and operate open browser windows through screenshots, pointer and keyboard input, and the browser accessibility tree when enabled.

Findings

2 medium2 low
  1. MediumComma injection in background keyboard key combos bypasses confinement, background guarantee, and auth guard

    src/hypruse/hyprctl.py:337

    When keyboard(action='key', keys=..., window=...) runs in background mode (on by default for any unfocused window, and enforced under HYPRUSE_BACKGROUND=1), input.parse_combo splits only on '+' and accepts arbitrary characters in the final key name, including commas, colons, and regex pipes. _keyboard_in_background checks HYPRUSE_CONFINE, HYPRUSE_BACKGROUND, and HYPRUSE_AUTH_GUARD against the allowed window argument, then passes the unvalidated key string straight into send_shortcut, which builds a comma-delimited dispatcher string (and splits it with arg.split(',', 2) on Lua configs). A prompt-injected agent can pass a value such as keys='Return, class:hyprpolkitagent|' or 'ctrl+c, class:kitty|' with an allowed background window address; Hyprland treats the text after the comma as the target window regex (where '|' regex alternation ignores the trailing ', address:0x...') and delivers the keystroke to a system authentication prompt or an out-of-scope user window without allow_auth=true.

    Fix: Restrict key names in input.parse_combo (and before send_shortcut) to single characters or valid XKB keysym identifiers matching ^[A-Za-z0-9_]+$, rejecting commas and whitespace, and pass (mods, key, window) as separate arguments to _lua_sendshortcut instead of joining and re-splitting on commas.

  2. MediumInsecure /tmp/hypruse fallback and unchecked PID in hypruse stop on systems without XDG_RUNTIME_DIR

    src/hypruse/safety.py:46

    While session.py falls back to /run/user/<uid> and journal.py enforces 0700/0600 permissions, safety.state_path, server._runtime_dir, cli_state._dir, and verbs.lock_path fall back to /tmp/hypruse without 0700 permissions or ownership checks when XDG_RUNTIME_DIR is unset (or create a relative ./hypruse directory if XDG_RUNTIME_DIR is empty). In addition, cli.stop() never calls session.ensure_session_env() and does not check that the beacon PID is greater than 1 before calling os.kill(pid, signal.SIGTERM). On non-systemd multi-user systems where XDG_RUNTIME_DIR is unset—or when hypruse stop runs in a stripped environment—screenshots in /tmp/hypruse are world-readable under a standard umask, and another local user can pre-create /tmp/hypruse/state.json with pid -1 so running hypruse stop sends SIGTERM to every process owned by the victim.

    Fix: Resolve the runtime directory through a single helper that defaults to /run/user/<uid>, creates the hypruse directory with mode 0o700, verifies ownership and rejects symlinks, calls session.ensure_session_env() in cli.stop(), and validates pid > 1 before calling os.kill.

  3. LowAgent skill pre-approves unscoped Read access to all files on disk

    skills/hypruse/SKILL.md:17

    The packaged skill (also active by default in the Claude Code plugin) includes a bare 'Read' entry in its allowed-tools frontmatter so the agent can view screenshot files saved under XDG_RUNTIME_DIR/hypruse without prompting. Unlike a path-scoped rule, bare 'Read' pre-approves Claude Code's file reader for every file on the user's computer—including SSH keys, cloud credentials, and files outside the project folder—without an approval prompt whenever the skill is active, even though the README states that the skill pre-approves only observation verbs and reading capture files.

    Fix: Scope the Read entry in allowed-tools to the capture directories (for example Read(//run/user/*/hypruse/**)) instead of granting blanket unprompted Read access across the filesystem.

  4. LowObservation CLI verbs can overwrite arbitrary user files via --out even in read-only mode

    src/hypruse/verbs.py:482

    The CLI verbs screenshot, zoom, and marks are classified as read-only observation commands, so they remain enabled under HYPRUSE_READONLY=1 and HYPRUSE_DRYRUN=1 and are pre-approved without an approval prompt in SKILL.md via Bash(hypruse screenshot:*), Bash(hypruse zoom:*), and Bash(hypruse marks:*). However, all three accept --out PATH and call shutil.move(meta['path'], dest) without checking read-only or dry-run mode and without refusing existing destination files. A prompt-injected agent can invoke hypruse screenshot --out ~/.bashrc (or target another config or source file) to overwrite existing user files with image bytes without a prompt and even when HYPRUSE_READONLY=1 is set.

    Fix: Refuse --out when HYPRUSE_READONLY or HYPRUSE_DRYRUN is active, and open or move to the destination exclusively so existing files and symlinks cannot be overwritten.