Skip to content

Terminal Security & Oversight ​

Mise includes a clipboard-mediated terminal handshake designed to protect users from malicious web scripts, hidden pastejacking commands, and unverified remote code execution.


The Risk of Web Terminal Execution ​

Many developer documentation sites and tutorials feature one-click terminal commands (such as curl | bash or complex setup one-liners). Malicious websites frequently employ pastejacking techniques, injecting invisible newlines or hidden payloads into the system clipboard that execute immediately upon pasting into a terminal window.


How the Clipboard-Mediated Handshake Works ​

When you select a script or run command within Mise:

  1. Script Extension & Risk Inspection: Mise's internal parser identifies commands containing executable script extensions or high-risk system prefixes:

    text
    .sh, .bash, .zsh, .ksh, .fish, .py, .rb, .pl, .lua, .c, .rs, .go, .js, .ts
    sudo, curl, wget, raw web URLs
  2. Decoupled Clipboard Staging:

    • Rather than executing the script directly in a background shell process or passing it blindly to a child process, Mise stages the command onto your system clipboard.
    • To eliminate clipboard pastejacking risks where newline characters trigger immediate command execution upon pasting into a shell, Mise sanitises all terminal command strings via security.sanitiseTerminalCommand. All line breaks (\r\n, \n, \r) and null bytes are neutralised into spaces, trailing whitespace is trimmed, and payload length is bounded to 4096 characters.
    • If risky patterns are detected, Mise prefixes the staged clipboard text with oversight to trigger the external scanner if present.
    • Mise then spawns a fresh, unmanaged, empty terminal instance.
  3. Manual Execution:

    • Because the terminal opens empty, no code executes automatically.
    • You must deliberately paste the clipboard contents into your terminal prompt and press Enter.

Standalone Oversight Utility (Optional) ​

The Command & Script security scanner and interactive pager used in this workflow is an independent external utility created by the same author:

Important: Optional Tool & User Responsibility ​

Oversight is strictly optional and is not bundled into the Mise Browser application package:

  • With Oversight Installed: When you paste and execute a command prefixed with oversight, the tool intercepts the command, analyses Shannon entropy for obfuscated payloads, checks for CVE vulnerabilities via the OSV.dev database, and renders an interactive TUI pager allowing line-by-line inspection before confirming execution.
  • Without Oversight Installed (Running at Your Own Risk): If you choose not to install the standalone Oversight tool, any commands staged to the clipboard and executed in the terminal will run without safety checks, warnings, or heuristic auditing. You execute them entirely at your own risk.

Installation & Integration ​

If you wish to enable active security scanning and paging:

  1. Clone the repository:
    bash
    git clone https://github.com/Rakosn1cek/oversight.git
  2. Build and place the oversight executable within your system PATH (e.g. ~/.local/bin/ or /usr/local/bin/).

Supported Input Methods ​

You can trigger terminal command execution from either primary interface:

  1. Status Bar Address Bar (Ctrl + L / o):
    • Type commands directly (e.g. pacman -Syu, btop, git status).
    • Use explicit shell prefixes: $ ls -la, > btop, :sh cargo check, or term fastfetch.
    • Scripts and high-risk commands automatically receive the oversight prefix.
    • Live upward suggestions display a Run in terminal option with a dedicated terminal indicator badge.
  2. Command Palette (Ctrl + P / :):
    • Any query not matching an internal Mise command displays a Run in terminal fallback action.
    • Pressing Enter or clicking Execute triggers clipboard staging and terminal launching.

Terminal Emulator Detection ​

Mise detects your host platform and terminal emulator dynamically:

  • Linux: Respects your $TERMINAL environment variable first, then prioritises installed emulators across Wayland and X11: $TERMINAL -> kitty -> alacritty -> foot -> ghostty -> wezterm -> konsole -> gnome-terminal -> terminator -> xfce4-terminal -> st -> xterm -> xdg-terminal-exec.
  • macOS: Automatically interfaces with the native Terminal.app.
  • Windows: Prefers Windows Terminal (wt.exe) with graceful fallback to cmd.exe.

Released under the GNU General Public Licence v3.0. • Follow on Mastodon • Discuss on Reddit