Back to skill

Security audit

Windows Automation

Security checks for vulnerabilities and agentic risk

Overview

This Windows automation skill is mostly upfront about what it does, but it gives an agent broad PowerShell, app-launch, screen, clipboard, and GUI control with weak safety boundaries.

Install only if you are comfortable granting the skill broad control over your Windows session. Treat command execution, app launching, screenshots, clipboard reads, and GUI input as sensitive actions; require explicit confirmation for commands or actions that modify files, access private data, use the network, install software, or interact with privileged apps. Prefer a version that keeps PyAutoGUI failsafe enabled, pins dependencies, limits commands to an allowlist, and documents screenshot and clipboard handling.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (3)

T09 · Insecure Skill Coding Practices

Error
Location
__init__.py:90
Finding

Unrestricted PowerShell Command Execution

Content
View full analysis

Vulnerability Details

File Location: __init__.py:90-97
Vulnerability Type: Arbitrary command execution through an unrestricted PowerShell interface
Risk Level: High

Vulnerable Code

python
def windows_command(command: str) -> str:
    """Run a PowerShell or cmd command."""
    result = subprocess.run(
        ["powershell", "-Command", command],
        capture_output=True,
        text=True
    )
    return result.stdout if result.stdout else result.stderr

Technical Analysis

The command parameter is passed directly to powershell -Command. PowerShell treats this value as executable script text, including pipelines, command substitution, network operations, file-system changes, and invocation of additional programs.

The function does not enforce an operation allowlist, validate command structure, restrict executable targets, require approval for destructive operations, apply a timeout, or run the process in a sandbox. Although command execution is a documented feature, exposing an unrestricted interpreter as an agent-callable tool creates a high-impact confused-deputy boundary. Malicious instructions from untrusted task content could induce the agent to execute commands unrelated to the user's intended task.

This does not independently elevate privileges: commands execute with the permissions and security context of the process hosting the skill.

Attack Path

  1. An attacker supplies malicious instructions through content processed by the agent, or a user directly requests an unsafe operation.
  2. The agent passes attacker-controlled PowerShell text to windows_command.
  3. The function invokes powershell -Command without validation or confirmation.
  4. PowerShell interprets the complete value as executable code.
  5. The command may modify or delete accessible files, launch programs, access local data, perform network requests, or download and execute additional content un ...[truncated 531 chars]
Remediation
View remediation

Remediation Suggestions

  • Remove the generic command interpreter unless unrestricted shell access is essential to the skill.
  • Replace it with narrowly scoped functions that accept structured parameters and invoke fixed executables with explicit argument arrays.
  • Maintain an allowlist of permitted operations, executables, arguments, and target paths.
  • Reject shell metacharacters and script constructs where free-form text cannot be eliminated, while recognizing that filtering alone is not a reliable sandbox.
  • Require explicit user confirmation immediately before commands that write files, change configuration, install software, start processes, or access the network.
  • Run permitted operations in a sandboxed, non-administrative process with restricted file-system and network access.
  • Add execution timeouts, output limits, cancellation support, and security logging.
  • Clearly display the exact command and execution context to the user before approval.

T09 · Insecure Skill Coding Practices

Warning
Location
__init__.py:11
Finding

PyAutoGUI Emergency Failsafe Disabled Globally

Content
View full analysis

Vulnerability Details

File Location: __init__.py:11-12
Vulnerability Type: Disabled operational safety control
Risk Level: Medium

Vulnerable Code

python
# Disable failsafe for smoother operation
pyautogui.FAILSAFE = False

Technical Analysis

PyAutoGUI normally provides an emergency interruption mechanism that raises a failsafe exception when the pointer is moved to a screen corner. Setting pyautogui.FAILSAFE to False disables that mechanism globally as soon as this module is imported.

This weakens the user's ability to interrupt erroneous, runaway, or attacker-influenced GUI automation. The implementation also exposes keyboard and mouse primitives capable of interacting with whichever application currently has focus. Consequently, a faulty or malicious sequence can continue issuing input after the user attempts to invoke PyAutoGUI's standard emergency stop.

Attack Path

  1. Erroneous coordinates, repeated operations, or attacker-influenced instructions cause the agent to initiate an unsafe GUI sequence.
  2. The skill sends mouse clicks, keyboard input, or hotkeys to the active desktop.
  3. The user moves the pointer to a screen corner to activate PyAutoGUI's standard emergency interruption.
  4. Because the failsafe is globally disabled, no failsafe exception is raised.
  5. Automation continues until another external termination mechanism succeeds, potentially interacting with sensitive dialogs or applications.

Impact Assessment

The issue does not grant additional operating-system privileges. Its impact is loss of a safety boundary and increased likelihood of unintended actions within applications available to the current desktop user. Depending on the active application and automation sequence, consequences can include accidental data modification, unintended command execution, disclosure through typed or copied content, or destructive GUI actions.

Remediation
View remediation

Remediation Suggestions

  • Keep pyautogui.FAILSAFE enabled.
  • Do not change process-wide PyAutoGUI safety settings merely to make automation smoother.
  • Add a separate, reliable cancellation mechanism monitored during all multi-step automation.
  • Bound click counts, keystroke counts, movement durations, and overall operation time.
  • Require user confirmation before sensitive keyboard shortcuts, destructive actions, or interactions with privileged applications.
  • Pause between actions and verify expected screen state before continuing a sequence.
  • Document the emergency-stop procedure and test it before enabling desktop automation.

T08 · Insecure Dependencies

Warning
Location
SKILL.md:18
Finding

Unpinned Third-Party Dependency Installation

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:18-25 and README.md:15-19
Vulnerability Type: Unpinned and integrity-unverified dependencies
Risk Level: Medium

Vulnerable Code

SKILL.md:

markdown
The required packages are already installed:
- `pyautogui` - Core automation engine
- `pywin32` - Windows API access
- `pyperclip` - Clipboard operations

If needed, install manually:
```bash
pip install pyautogui pywin32 pyperclip
text

`README.md`:

```markdown
## Installation

```bash
pip install pyautogui pywin32 pyperclip
text

### Technical Analysis

The installation instructions request packages by name without pinning reviewed versions or verifying package hashes. Installation therefore resolves mutable releases from the user's configured package index at installation time.

This makes installations non-reproducible and exposes them to future dependency compromise, unsafe upstream releases, or substitution through an untrusted package-index configuration. No evidence was found that the named packages are currently malicious; the finding concerns the absence of supply-chain controls.

### Attack Path

1. A user follows the documented installation command.
2. `pip` resolves the latest compatible packages from the configured index.
3. A compromised upstream release, package-index account, mirror, or index configuration supplies altered package content.
4. The package is installed without comparison against a reviewed version and integrity hash.
5. Malicious package installation hooks or imported module code execute with the privileges of the user performing installation or running the skill.

### Impact Assessment

A compromised dependency could execute arbitrary Python code during installation or import with the installing or hosting user's privileges. Potential scope includes theft or modification of accessible files, process execution, network communication, and c
...[truncated 182 chars]
Remediation
View remediation

Remediation Suggestions

  • Pin every direct dependency to a specifically reviewed version.
  • Maintain a lock file containing resolved transitive dependencies.
  • Require cryptographic hashes, such as through pip install --require-hashes.
  • Use a trusted, explicitly configured package index or an internally controlled package mirror.
  • Generate and review a software bill of materials.
  • Scan dependencies for known vulnerabilities and review updates before changing pinned versions.
  • Install dependencies in an isolated virtual environment under a non-administrative account.
  • Update both SKILL.md and README.md so their installation instructions reference the same reviewed lock file.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (11)

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

Arbitrary shell/PowerShell execution is far beyond normal GUI automation and effectively turns the skill into a remote code execution interface. Given the skill context, this materially increases danger because an agent can perform hidden non-UI actions that users would not expect from a desktop automation tool.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill exposes arbitrary command execution without any safety warning or user-facing consent, making a highly dangerous capability easy to invoke silently. In an automation skill, lack of disclosure worsens the risk because callers may not realize they are granting full host command execution rather than simple GUI control.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The README advertises high-risk capabilities including screenshots, clipboard access, application launch, and arbitrary command execution without any warning, consent expectations, or safety boundaries. In an automation skill, these features can expose sensitive data, alter the user environment, or execute harmful actions, and presenting them as routine functionality lowers the barrier to unsafe use.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill includes screenshot capture and clipboard read/write capabilities but does not provide a clear privacy warning that these features may expose sensitive on-screen data, passwords, tokens, personal information, or copied secrets. In desktop automation contexts, these primitives are especially sensitive because they can access information outside the immediate task scope.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill explicitly exposes application launching and arbitrary system command execution but does not warn users that these actions can change system state, execute destructive commands, or open untrusted programs. In an agent setting, this increases the chance of unsafe delegation or prompt-induced misuse because the capability is presented as routine automation without clear user-consent boundaries.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The screenshot function writes image data to disk without any warning, path controls, or minimization of captured content. Screenshots can contain sensitive on-screen information, and persistent storage increases exposure if files are left behind or written to predictable locations.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

Allowing arbitrary application launch extends the skill from input automation into unrestricted process spawning. In this context, that broadens the attack surface significantly because a caller can invoke tools that enable further code execution, network access, or credential access.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
94% confidence
Finding

The skill exposes application launching through a user-controlled argument passed into a Windows shell start invocation. Even without shell=True, this enables arbitrary program execution and can be abused to launch scripting hosts, admin tools, browsers to attacker-controlled URLs, or other binaries outside the stated desktop automation scope.

Content

Scanner excerpt · __init__.py (reported line 86)May include surrounding context.

python
def windows_launch_app(name: str) -> str:
    """Launch a Windows application."""
    subprocess.Popen(["cmd", "/c", "start", "", name])
    return f"Launched: {name}"

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
99% confidence
Finding

This function directly executes arbitrary PowerShell commands supplied at runtime, giving the caller full command-execution capability on the host. In an agent skill, this is especially dangerous because it bypasses the claimed PyAutoGUI-only automation boundary and can be used for data theft, persistence, downloading payloads, or system tampering.

Content

Scanner excerpt · __init__.py (reported line 92)May include surrounding context.

python
def windows_command(command: str) -> str:
    """Run a PowerShell or cmd command."""
    result = subprocess.run(
        ["powershell", "-Command", command],
        capture_output=True,
        text=True

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

Reading the clipboard can expose passwords, tokens, personal data, or copied documents without user awareness. In a desktop automation context, clipboard access is particularly sensitive because users often treat it as transient, not as a data source for agent collection.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

Writing to the clipboard overwrites potentially valuable or sensitive user data and may disrupt workflows. While less severe than code execution or clipboard reading, it still modifies user state silently and could be abused to stage phishing text, commands, or exfiltration workflows.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.