Back to skill

Security audit

Peekaboox

Security checks for vulnerabilities and agentic risk

Overview

This skill openly provides broad Linux desktop control, but it lacks guardrails for actions that can expose screen contents or change real applications.

Install only if you are comfortable giving the skill broad control over an X11 desktop. Use it in a dedicated test session or VM when possible, avoid running it while sensitive apps or unsaved work are visible, inspect screenshots before acting, and require explicit user approval before hotkeys, typing, clicking destructive controls, or closing windows. The click and screenshot scripts should be hardened before use in adversarial or shared-user environments.

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

Error
Location
click.sh:115
Finding
Command Injection Through Unvalidated Arithmetic Expressions<![CDATA[ ## Vulnerability Details **File Location**: `click.sh:16-22, 110-116` **Vulnerability Type**: Command injection through Bash arithmetic expansion **Risk Level**: High ### Vulnerable Code ```bash --x) X="$2" shift 2 ;; --y) Y="$2" shift 2 ;; ``` ```bash # Get window position GEOM=$(xdotool getwindowgeometry --shell "$WIN_ID") WIN_X=$(echo "$GEOM" | grep "^X=" | cut -d= -f2) WIN_Y=$(echo "$GEOM" | grep "^Y=" | cut -d= -f2) # Calculate absolute coordinates X=$((WIN_X + X)) Y=$((WIN_Y + Y)) ``` ### Technical Analysis The `--x` and `--y` arguments are accepted as arbitrary strings and are not validated as decimal integers. When window-relative clicking is enabled, these values are evaluated inside Bash arithmetic expansions. Bash arithmetic evaluation parses operands as arithmetic expressions rather than inert numeric strings. Values referenced through arithmetic variables may be evaluated recursively. Crafted expressions can therefore trigger additional shell expansion, including command substitution in constructs such as array subscripts. This flaw is reachable only through the window-relative branch, because the vulnerable arithmetic expressions are evaluated when `--window` is supplied. Quoting the original assignment does not make subsequent arithmetic evaluation safe. ### Attack Path 1. An attacker causes the script to be invoked with a valid window name and a malicious `--x` or `--y` expression. 2. The script stores the expression without numeric validation. 3. `xdotool` locates the requested X11 window and returns its geometry. 4. The script evaluates the attacker-controlled value in: ```bash X=$((WIN_X + X)) ``` or: ```bash Y=$((WIN_Y + Y)) ``` 5. A crafted arithmetic expression containing command substitution is evaluated by Bash. 6. The injected command executes with the identity and environment of the user running the skil ...[truncated 964 chars]
Remediation
<![CDATA[ ## Remediation Suggestions Validate all coordinate values as integers before using them in arithmetic expansion: ```bash if ! [[ "$X" =~ ^-?[0-9]+$ ]] || ! [[ "$Y" =~ ^-?[0-9]+$ ]]; then echo "ERROR: --x and --y must be decimal integers" >&2 exit 1 fi ``` Perform validation before both direct `xdotool` use and window-relative arithmetic. Validate values obtained from `xdotool` as well: ```bash if ! [[ "$WIN_X" =~ ^-?[0-9]+$ ]] || ! [[ "$WIN_Y" =~ ^-?[0-9]+$ ]]; then echo "ERROR: invalid window geometry" >&2 exit 1 fi ``` Additional hardening should include: 1. Enforce sensible upper and lower coordinate bounds. 2. Apply strict integer validation to `--amount`, `--delay`, `--width`, `--height`, and other numeric parameters in the remaining scripts. 3. Avoid evaluating untrusted strings as arithmetic expressions. 4. Add regression tests using arithmetic metacharacters, command substitutions, array syntax, whitespace, signs, and oversized values. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
capture.sh:52
Finding
Predictable Screenshot Filename Enables Symlink-Based File Overwrite<![CDATA[ ## Vulnerability Details **File Location**: `capture.sh:52-81` **Vulnerability Type**: Unsafe predictable temporary file creation **Risk Level**: Medium ### Vulnerable Code ```bash # --- Default output path --- if [ -z "$OUTPUT" ]; then OUTPUT="/tmp/linux-desktop-capture-$(date +%s).png" fi # --- Capture --- if [ -n "$WINDOW_NAME" ]; then # Find the window ID by name WIN_ID=$(xdotool search --name "$WINDOW_NAME" | head -1) if [ -z "$WIN_ID" ]; then if $JSON_OUTPUT; then echo "{\"success\": false, \"output\": null, \"error\": \"Window not found: $WINDOW_NAME\"}" else echo "ERROR: Window not found: $WINDOW_NAME" >&2 fi exit 1 fi # Try import (ImageMagick) first for window-specific capture, fall back to scrot if command -v import &>/dev/null; then import -window "$WIN_ID" "$OUTPUT" else # Focus the window then use scrot -u (focused window) xdotool windowactivate --sync "$WIN_ID" sleep 0.3 scrot -u "$OUTPUT" fi else # Full screen capture scrot "$OUTPUT" fi ``` ### Technical Analysis The default screenshot path is placed in the globally shared `/tmp` directory and contains only the current Unix timestamp in seconds. This filename is predictable and provides a large race window because every invocation within the same second uses the same path. The script does not atomically reserve the destination, create a private temporary directory, reject symbolic links, or confirm that the destination is a newly created regular file owned by the invoking user. If the screenshot backend follows an existing symbolic link when writing its output, a local attacker can redirect the write to another file writable by the victim. The same naming strategy can also cause collisions between concurrent legitimate executions. ### Attack Path 1. A local attacker predicts the timestamp at which the victim will run `capture.sh`. 2. The ...[truncated 1256 chars]
Remediation
<![CDATA[ ## Remediation Suggestions Create default screenshot files using an unpredictable, atomically reserved name with restrictive permissions: ```bash if [ -z "$OUTPUT" ]; then umask 077 OUTPUT=$(mktemp --suffix=.png /tmp/linux-desktop-capture-XXXXXX) fi ``` Where supported, prefer a private runtime directory owned by the user: ```bash BASE_DIR="${XDG_RUNTIME_DIR:-/tmp}" umask 077 OUTPUT=$(mktemp "$BASE_DIR/linux-desktop-capture-XXXXXX.png") ``` Additional hardening should include: 1. Verify that `XDG_RUNTIME_DIR`, if used, is owned by the current user and is not writable by other users. 2. For caller-supplied output paths, reject symbolic links and unsafe file types. 3. Avoid check-then-write logic where possible; retain and use an atomically created file. 4. Document overwrite behavior explicitly and require an opt-in flag before replacing an existing output file. 5. Add concurrent-execution and symbolic-link regression tests. 6. Consider creating a private temporary directory with `mktemp -d`, writing the screenshot inside it, and cleaning it up when appropriate. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (15)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding
The description presents a comprehensive X11 desktop GUI automation skill, but the supplied code chunk implements only screenshot capture functionality. It can capture the full screen or a specific window by name and depends on X11 tools such as xdotool, scrot, and optionally ImageMagick import. There is no evidence in this chunk of input automation, UI clicking, text entry, shortcut sending, scrolling, or general window management beyond activating a window as part of capture fallback. This is a material description-to-behavior mismatch because the declared purpose substantially overstates the capabilities demonstrated by the code provided.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding
The description promises a broad desktop automation and control skill for X11, including interaction and manipulation of GUI elements and windows. The supplied code chunk does not implement those capabilities. It only queries window metadata and the active window using wmctrl, xdotool, and xprop, then formats the results as JSON. While window inspection could be a supporting component of a larger automation skill, this code chunk by itself materially differs from the declared purpose because it lacks the core automation behaviors described.

Tool Parameter Abuse

High
Category
Tool Misuse
Content
elif command -v dnf &>/dev/null; then
    sudo dnf install -y xdotool wmctrl scrot xorg-x11-utils ImageMagick python3 python3-pip
elif command -v pacman &>/dev/null; then
    sudo pacman -S --noconfirm xdotool wmctrl scrot xorg-xwininfo imagemagick python python-pip
else
    echo "ERROR: Unsupported package manager. Install manually: xdotool wmctrl scrot" >&2
    exit 1
Confidence
85% confidence
Finding
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The guide explicitly instructs taking screenshots of the live desktop but provides no warning that screenshots may capture sensitive information such as emails, chats, credentials, documents, or other user data visible on screen. In a desktop automation skill, this creates a real privacy and data-exposure risk because users may test against their normal session rather than an isolated environment.

Missing User Warnings

Medium
Confidence
92% confidence
Finding
The document directs users to click, type, send hotkeys, scroll, and manipulate windows in a live GUI session without warning that these actions can affect real applications, trigger unintended commands, or alter user data. Because the skill is specifically designed to control the desktop, misuse or accidental execution in the wrong window can cause data loss, unintended actions, or interaction with privileged prompts.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The README advertises full desktop automation capabilities that can click, type, send hotkeys, and manage windows, but it does not warn users that these actions can change system state, dismiss dialogs, or trigger unintended operations. In a GUI automation skill, lack of safety guidance materially increases the chance of accidental destructive use, especially by agents acting autonomously from screenshots and coordinates.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The README explicitly documents hotkeys and window-management features including close operations, but provides no warning that closing windows or sending shortcuts like Alt+F4/Ctrl+C may terminate processes or discard unsaved work. Because this skill is intended for active desktop control, documenting destructive capabilities without caution makes accidental harmful use more likely.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
The skill enables arbitrary GUI interaction including typing, hotkeys, window closing, and clicking, which can cause destructive actions, credential entry into the wrong window, or unintended command execution if used without prominent safety constraints. In this context, broad desktop-control capability increases risk because X11 automation can affect any visible application in the session, making operator mistakes or misuse materially more dangerous.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The script passes an attacker-controlled key sequence directly to xdotool, allowing arbitrary hotkeys to be injected into the active X11 session. In the context of a desktop-control skill, this can trigger destructive actions such as closing applications, invoking terminal shortcuts, locking/logging out the session, approving dialogs, or driving privileged UI flows without any confirmation or policy checks.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
# Detect package manager and install system packages
if command -v apt-get &>/dev/null; then
    sudo apt-get update -q
    sudo apt-get install -y xdotool wmctrl scrot x11-utils imagemagick python3 python3-venv python3-pip
elif command -v dnf &>/dev/null; then
    sudo dnf install -y xdotool wmctrl scrot xorg-x11-utils ImageMagick python3 python3-pip
Confidence
70% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
# Detect package manager and install system packages
if command -v apt-get &>/dev/null; then
    sudo apt-get update -q
    sudo apt-get install -y xdotool wmctrl scrot x11-utils imagemagick python3 python3-venv python3-pip
elif command -v dnf &>/dev/null; then
    sudo dnf install -y xdotool wmctrl scrot xorg-x11-utils ImageMagick python3 python3-pip
Confidence
70% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
# Detect package manager and install system packages
if command -v apt-get &>/dev/null; then
    sudo apt-get update -q
    sudo apt-get install -y xdotool wmctrl scrot x11-utils imagemagick python3 python3-venv python3-pip
elif command -v dnf &>/dev/null; then
    sudo dnf install -y xdotool wmctrl scrot xorg-x11-utils ImageMagick python3 python3-pip
Confidence
70% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
# Detect package manager and install system packages
if command -v apt-get &>/dev/null; then
    sudo apt-get update -q
    sudo apt-get install -y xdotool wmctrl scrot x11-utils imagemagick python3 python3-venv python3-pip
elif command -v dnf &>/dev/null; then
    sudo dnf install -y xdotool wmctrl scrot xorg-x11-utils ImageMagick python3 python3-pip
Confidence
70% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Autonomous Decision Making

Medium
Category
Excessive Agency
Content
elif command -v dnf &>/dev/null; then
    sudo dnf install -y xdotool wmctrl scrot xorg-x11-utils ImageMagick python3 python3-pip
elif command -v pacman &>/dev/null; then
    sudo pacman -S --noconfirm xdotool wmctrl scrot xorg-xwininfo imagemagick python python-pip
else
    echo "ERROR: Unsupported package manager. Install manually: xdotool wmctrl scrot" >&2
    exit 1
Confidence
65% confidence
Finding
Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The `close` action can terminate an application window and potentially cause loss of unsaved user work, but this code path provides no confirmation prompt or explicit user-facing warning before executing `wmctrl -c` or `xdotool windowclose`. While the help text lists the action, it does not disclose the risk of data loss associated with closing a window.

Static analysis

No suspicious patterns detected.