Back to skill

Security audit

Xdotool Control

Security checks for vulnerabilities and agentic risk

Overview

This skill is mostly a real desktop-automation helper, but it can control the live GUI and save screenshots with too few safety boundaries.

Review before installing. Use only in a dedicated desktop/browser session, keep sensitive pages hidden, verify the target window before any action, and be aware that screenshots may remain in /tmp and that click/type/close-tab actions can affect real applications immediately.

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 (1)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/snap_verify_click.sh:12
Finding

Predictable and Insecure Temporary Screenshot Files

Content
View full analysis
/dev/null echo "$SNAP_FILE" ;; screenshot_window) # Screenshot just the Chrome window area WIN_GEOM=$(xdotool getwindowgeometry "$WIN" 2>/dev/null) WIN_X=$(echo "$WIN_GEOM" | grep Position | awk -F'[,: ]' '{print $4}') WIN_Y=$(echo "$WIN_GEOM" | grep Position | awk -F'[,: ]' '{print $5}') WIN_W=$(echo "$WIN_GEOM" | grep Geometry | awk -F'x' '{print $1}' | awk '{print $2}') WIN_H=$(echo "$WIN_GEOM" | grep Geometry | awk -F'x' '{print $2}') scrot -a "${WIN_X},${WIN_Y},${WIN_W},${WIN_H}" "$SNAP_FILE" 2>/dev/null echo "$SNAP_FILE" ;; click) X="${ARG3:-960}" Y="${ARG4:-540}" xdotool mousemove "$X" "$Y" click 1 sleep 0.5 scrot "$SNAP_FILE" 2>/dev/null echo "clicked $X $Y — screenshot: $SNAP_FILE" ;; scroll_down) TIMES="${ARG3:-3}" for i in $(seq 1 "$TIMES"); do xdotool key Page_Down sleep 0.2 done scrot "$SNAP_FILE" 2>/dev/null echo "scrolled down ${TIMES}x — screenshot: $SNAP_FILE" ;; back) xdotool key Alt+Left sleep 1 scrot "$SNAP_FILE" 2>/dev/null echo "navigated back — screenshot: $SNAP_FILE" ;; ``` `scripts/click_extension.sh:12, 68-83`: ```bash SNAP="/tmp/xdotool_toolbar_$(date +%s).png" # Snapshot the toolbar right side for visual inspection scrot -a "$((SCREEN_W-350)),0,350,72" "$SNAP" 2>/dev/null echo "Toolbar snapshot: $SNAP" echo "Read it with Claude to identify ico ...[truncated 3879 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (12)

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The code broadly aligns with the stated theme of xdotool-based mouse/keyboard desktop automation and includes screenshots, clicking, typing, and tab-related actions. However, the implementation is materially narrower and more browser-specific than the description suggests: it requires a running Google Chrome window and targets Chrome exclusively, not general GUI apps. It also performs an undeclared capability of navigating to arbitrary URLs by opening a new tab, focusing the address bar, typing the URL, and loading it. Additional actions like browser back and close_tab are not called out in the description. While some of these are adjacent to the declared purpose, the Chrome-specific control and URL navigation make the description not fully accurate.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The trigger phrases are broad enough to activate this skill for many ordinary desktop requests, which increases the chance of unintended mouse/keyboard automation in the wrong context or window. Because xdotool sends real system-wide input, accidental invocation can cause clicks, typing, or navigation against sensitive applications without additional confirmation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This skill performs screenshots and global GUI automation but does not warn about capture of sensitive on-screen data or interaction with unintended windows. In this context, the lack of privacy and safety guardrails is more dangerous because the skill is specifically designed to click, type, and inspect desktop state outside a constrained browser relay.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · SKILL.md (reported line 187)May include surrounding context.

bash
# Required
sudo apt-get install xdotool scrot

# Optional — enables template matching in find_and_click.sh
sudo apt-get install imagemagick

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The type action sends arbitrary text to the currently focused Chrome window with no validation, destination check, or safety interlock. In a desktop-automation skill, this is risky because keystrokes can be injected into sensitive fields, web apps, terminals embedded in browser tabs, or unintended pages if focus/navigation is not exactly as expected.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The script can close the active Chrome tab via xdotool key ctrl+w, which may discard in-progress work or close user content. Although the script prints a result after the action, there is no prior confirmation prompt, safety check, or warning comment indicating that a destructive browser action will occur.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · SKILL.md (reported line 190)May include surrounding context.

md
# Dependency checks
for dep in xdotool scrot; do
  if ! command -v "$dep" &>/dev/null; then
    echo "ERROR: $dep not installed. Run: sudo apt-get install $dep" >&2
    exit 1
  fi
done

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · scripts/browser_action.sh (reported line 20)May include surrounding context.

sh
# Dependency checks
for dep in xdotool scrot; do
  if ! command -v "$dep" &>/dev/null; then
    echo "ERROR: $dep not installed. Run: sudo apt-get install $dep" >&2
    exit 1
  fi
done

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · scripts/click_extension.sh (reported line 16)May include surrounding context.

sh
# Dependency checks
for dep in xdotool scrot; do
  if ! command -v "$dep" &>/dev/null; then
    echo "ERROR: $dep not installed. Run: sudo apt-get install $dep" >&2
    exit 1
  fi
done

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · scripts/click_extension.sh (reported line 20)May include surrounding context.

sh
# Dependency checks
for dep in xdotool scrot; do
  if ! command -v "$dep" &>/dev/null; then
    echo "ERROR: $dep not installed. Run: sudo apt-get install $dep" >&2
    exit 1
  fi
done

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · scripts/find_and_click.sh (reported line 16)May include surrounding context.

sh
# Dependency checks
for dep in xdotool scrot; do
  if ! command -v "$dep" &>/dev/null; then
    echo "ERROR: $dep not installed. Run: sudo apt-get install $dep" >&2
    exit 1
  fi
done

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · scripts/find_and_click.sh (reported line 21)May include surrounding context.

sh
# Dependency checks
for dep in xdotool scrot; do
  if ! command -v "$dep" &>/dev/null; then
    echo "ERROR: $dep not installed. Run: sudo apt-get install $dep" >&2
    exit 1
  fi
done

Static analysis

No suspicious patterns detected.