Back to skill

Security audit

windows-agent

Security checks for vulnerabilities and agentic risk

Overview

This Windows desktop automation skill is mostly coherent, but it grants broad control of the user's desktop and includes unsafe process/window termination behavior that can destroy unrelated unsaved work.

Install only if you are comfortable giving the agent real control over your Windows desktop. Use explicit targets and PID-based process actions, avoid name-based kill/close operations, review screenshots and clipboard contents as sensitive data, and require manual confirmation before clicks, typing, submits, deletions, clipboard overwrites, or any process/window termination.

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
scripts/window.ps1:389
Finding

Closing One Window Can Force-Terminate Unrelated Application Instances

Content
View full analysis

Vulnerability Details

File Location: scripts/window.ps1:389-404
Vulnerability Type: Overbroad process termination
Risk Level: High

Vulnerable Code

powershell
$closed = $proc.WaitForExit(3000)
...
if($closed){
    Write-Output "Closed: ""$($win.Title)"" (PID=$($win.WinPID))"
} else {
    $procName = $proc.ProcessName
    Write-Warning "Graceful close failed ($procName is UWP or has unsaved content?). Force-closing PID=$($win.WinPID)."
    taskkill /PID $($win.WinPID) /F /T 2>&1 | Out-Null
    Start-Sleep -Milliseconds 300
    Get-Process -Name $procName -ErrorAction SilentlyContinue | Where-Object { $_.Id -ne $PID } | ForEach-Object {
        try { taskkill /PID $($_.Id) /F /T 2>&1 | Out-Null } catch {}
    }
    Start-Sleep -Milliseconds 400
}

Technical Analysis

The close action first requests graceful termination and waits for only three seconds. If the process does not exit during that interval, the script automatically escalates to taskkill /F /T, forcibly terminating the selected process and its process tree.

After that, it enumerates every process with the same image name and force-terminates those processes as well. The only excluded PID is the PowerShell process running the Skill. There is no verification that the additional processes are descendants of, or otherwise associated with, the selected window.

A normal unsaved-content dialog, slow shutdown, or temporarily unresponsive application can therefore trigger termination of unrelated application instances. This behavior also conflicts with the documented rule requiring confirmation before destructive window or process operations.

Attack Path

  1. A user or Agent invokes the close action for one application window.
  2. The selected application displays an unsaved-content prompt, takes longer than three seconds to exit, or does not respond to the graceful close request.
  3. The script force-terminates the selected PID and its child processes.
  4. The script ...[truncated 787 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove automatic forced termination from the ordinary close action.
  2. If graceful closure times out, return an error explaining that the application may have unsaved content.
  3. Introduce a separate, explicitly named force-close action that requires clear user confirmation.
  4. Remove the same-image-name cleanup logic entirely.
  5. If child-process cleanup is necessary, identify and terminate only verified descendants of the selected PID.
  6. Do not use executable-name equality as evidence that processes belong to the same application session.
  7. Increase observability by reporting the selected PID, window title, timeout, and pending confirmation before any forced termination.
  8. Preserve save prompts and allow the user to decide whether unsaved content should be discarded.

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/process.ps1:88
Finding

Name-Based Process Termination Uses Ambiguous Wildcard Matching Without Confirmation

Content
View full analysis

Vulnerability Details

File Location: scripts/process.ps1:88-105
Vulnerability Type: Overbroad wildcard process termination
Risk Level: Medium

Vulnerable Code

powershell
if ($ProcId -gt 0) {
    $chk = Get-Process -Id $ProcId -EA SilentlyContinue
    if ($chk) { $targets += $chk }
} elseif ($Name) {
    $targets += Get-Process -Name "*$Name*" -EA SilentlyContinue
}
...
} elseif ($Name) {
    $ps = Get-Process -Name "*$Name*" -EA SilentlyContinue
    if (-not $ps) { Write-Error "No match: '$Name'"; exit 1 }
    $ps | Select-Object -First 8 | ForEach-Object {
        Write-Output "  PID=$($_.Id) Name=$($_.ProcessName)"
    }
    $ps | ForEach-Object {
        if($Force){
            Stop-Process -Id $_.Id -Force
        }else{
            Stop-Process -Id $_.Id
        }
    }
}

Technical Analysis

The kill action surrounds the supplied process name with wildcards and terminates every matching process. An abbreviated value can therefore match several distinct process names and multiple instances of each application.

Although the script displays some matched processes before termination, this output is informational and does not create a confirmation boundary. Termination begins immediately afterward. The protected-process denylist reduces the probability of terminating selected Windows components, but it does not protect ordinary applications or user data and cannot reliably represent every security-sensitive process.

Attack Path

  1. A user or Agent invokes process.ps1 -Action kill with a short, partial, or ambiguous -Name value.
  2. The script expands the value into the pattern *$Name*.
  3. Multiple unrelated process names or application instances match the pattern.
  4. The script prints up to eight matches but does not pause for approval.
  5. It immediately terminates every matched process.
  6. Affected applications may lose unsaved data or interrupt ongoing user tasks.

Impact Assessment

The operation is limite ...[truncated 381 chars]

Remediation
View remediation

Remediation Suggestions

  1. Require exact process-name matching by default.
  2. Prefer PID-based termination for all destructive operations.
  3. If a name resolves to multiple PIDs, stop and return the candidate list without terminating anything.
  4. Require an explicit -AllMatches switch before permitting multi-process termination.
  5. Add a confirmation boundary at the Agent layer before terminating multiple processes.
  6. Consider requiring both an exact process name and an expected executable path to reduce ambiguity.
  7. Report every target PID rather than truncating the displayed list.
  8. Retain the protected-process checks as defense in depth, but do not treat a static denylist as the primary safety control.
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
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (26)

Vague Triggers

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill advertises extremely broad trigger phrases such as viewing the screen, clicking, typing, opening apps, and controlling windows using common everyday wording. Because this skill can perform powerful desktop actions, overly generic invocation language increases the chance of accidental or inappropriate activation in unrelated conversations, which could lead to unintended UI manipulation, data entry, or destructive actions on the user's Windows desktop.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The close path escalates from graceful close to forced termination with taskkill /F /T, then kills additional processes with the same image name, which can destroy unsaved user data and terminate unrelated app instances. In a high-privilege desktop-control skill, this creates a dangerous destructive primitive that can be triggered without confirmation and with broader blast radius than the targeted window.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The heading and introductory text are written in Chinese, and the document does not indicate that other languages are supported or that Chinese is required for a region-specific purpose. This can constitute a language/locale policy violation because the skill documentation appears to assume a fixed language without user opt-in.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The manifest describes desktop control features such as screen viewing, screenshots, window control, mouse/keyboard simulation, UI automation, and process management, but it does not mention recording the screen. This changelog states the skill includes a record capability producing MP4 recordings, which is a materially broader surveillance/data-capture behavior than the declared description.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The skill name, description, and operational guidance are written entirely in Chinese and the trigger examples are Chinese-only, indicating a fixed language expectation. There is no visible statement that users may choose another language or that the Chinese-only scope is intentional and justified for a specific locale.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script accepts externally supplied action sequences and directly performs mouse movement, clicks, drags, typing, scrolling, and key combinations on the host without any confirmation, allowlist, focus verification, or safety interlock. In the context of a Windows desktop control skill, this enables arbitrary UI actions against whatever window is active, which can be abused to send commands, approve prompts, alter settings, or exfiltrate data through simulated input.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The script provides explicit clipboard read, write, and clear functionality, but the skill description does not disclose clipboard access. In a desktop-control agent, undisclosed clipboard access is security-relevant because clipboards commonly contain passwords, tokens, PII, wallet addresses, or copied files, and users may not realize the agent can inspect or alter that data.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The get action reads and outputs clipboard contents directly with no warning, consent gate, or sensitivity check. This is dangerous because clipboard contents frequently include secrets or personal data, and this skill's remote desktop-control context makes covert collection more plausible and more harmful than in a local-only utility.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · scripts/clipboard.ps1 (reported line 21)May include surrounding context.

text
"get" {
        # 先检测非文本内容(图片/文件等), 避免只读文本而误报"(空)"导致备份/覆盖丢内容
        $hasImg = [System.Windows.Forms.Clipboard]::ContainsImage()
        $hasFile = [System.Windows.Forms.Clipboard]::ContainsFileDropList()
        $hasData = [System.Windows.Forms.Clipboard]::ContainsData("FileDrop")
        $t = [System.Windows.Forms.Clipboard]::GetText()
        if($t){ "CLIPBOARD: $t" }

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · scripts/clipboard.ps1 (reported line 27)May include surrounding context.

text
"get" {
        # 先检测非文本内容(图片/文件等), 避免只读文本而误报"(空)"导致备份/覆盖丢内容
        $hasImg = [System.Windows.Forms.Clipboard]::ContainsImage()
        $hasFile = [System.Windows.Forms.Clipboard]::ContainsFileDropList()
        $hasData = [System.Windows.Forms.Clipboard]::ContainsData("FileDrop")
        $t = [System.Windows.Forms.Clipboard]::GetText()
        if($t){ "CLIPBOARD: $t" }

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The set and clear actions overwrite or erase clipboard contents without warning that existing data may be lost. This can destroy user data, disrupt workflows, or facilitate social engineering by replacing copied values such as payment addresses, commands, or account details with attacker-chosen content.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The script includes user-facing guidance in Chinese in the help output, and similar Chinese-only text appears in later errors/comments tied to runtime behavior. This imposes a specific language on users without opt-in or documentation that the skill is intended only for a Chinese-speaking or region-specific environment.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script enumerates all descendant UI Automation elements from either a user-specified window or the currently focused window and prints discovered text, including Text, Edit, and Document content. This enables collection of sensitive data such as messages, notes, form inputs, and other window text without any restriction to a trusted application set or explicit consent boundary.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The code outputs all collected text directly with no warning, preview, or minimization, so any sensitive on-screen content in the matched or focused window is immediately disclosed to the caller. Because it defaults to the focused element path when no target is provided, accidental over-collection is especially plausible during normal desktop use.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

Semantically, this script is a generic text-harvesting capability for arbitrary windows: it walks the full UI tree and extracts visible names and editable/document text, including user-entered content. In the context of a Windows desktop control skill, that broad read capability materially increases risk because the same agent that can manipulate windows can also collect and disclose their contents.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script's descriptive comments and help/output strings are written in Chinese, including the primary help text and error messages. This creates a language/locale constraint for users without any opt-in, alternative locale, or documentation that the skill is intentionally limited to a Chinese-speaking environment.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This script enables direct UI interaction—clicking controls, invoking actions, and entering text—without any built-in confirmation, allowlisting, or user-consent guardrails. In the context of a Windows desktop control skill, that means a caller can drive arbitrary application workflows, including security-sensitive dialogs, data submission, or destructive actions, making misuse materially dangerous even if the feature is intentional.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The script captures the full screen or a target window and explicitly instructs downstream analysis of the resulting image, but provides no user-facing warning, consent checkpoint, or redaction guidance for potentially sensitive on-screen data. In the context of a desktop-control skill, screenshots may contain passwords, personal messages, tokens, financial data, or unrelated application content, so silent capture materially increases privacy and data-exposure risk.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file's user-facing comments and outputs are written in Chinese, and the help/usage text later in the script is also Chinese-only. This creates a language/locale policy issue because the skill imposes a specific language without any opt-in, fallback, or indication that it is intentionally limited to a Chinese-speaking environment.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The comment explicitly states the smart-open flow is '按名字, 不靠猜坐标' and describes a robust non-coordinate strategy. However, the UI Automation and taskbar fallback branches derive screen coordinates from bounding rectangles and invoke mouse-move/mouse-click actions, so the documentation materially misstates how the action operates.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

Comments and user-visible outputs in the open flow and several error/help messages include Chinese text, and the shell/application matching logic is keyed to Chinese names such as 此电脑, 控制面板, and 回收站. This effectively imposes a specific language/locale behavior without opt-in, which can violate organizational language/locale policy for general-purpose skills.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
73% confidence
Finding

The manifest presents the skill as a Windows desktop controller focused on screenshots, windows, input, UI automation, and processes. The changelog's repeated references to 12 modules and a record module indicate the implemented scope extends beyond the user-facing description, suggesting the manifest understates actual capabilities.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

Multiple user-facing strings, comments, and help examples are presented in Chinese, effectively forcing a specific language for users who invoke the script. The file does not provide an English alternative, a language selection mechanism, or justification that the skill is intentionally limited to a Chinese-speaking or region-specific environment.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script's natural-language strings, usage help, and error messages are consistently presented in Chinese, with no option for users to select another language. This can violate a language/locale policy when skills must not force a specific language without user opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

User-facing descriptions and guidance are written exclusively in Chinese, including the operational instructions presented by the script. There is no indication that the skill is region-specific or that users may opt into another language, which can violate language/locale policy requirements.

Content

No source excerpt is available for this finding.