Back to skill

Security audit

Xia Desktop Agent

Security checks for vulnerabilities and agentic risk

Overview

This desktop automation skill is openly powerful, but it also exposes remote-access credentials, can send WeChat messages/files, and permits overly broad desktop and command execution without adequate confirmation or enforcement.

Review carefully before installing. Only use this in a controlled Windows environment where you trust the operator and local LLM service, and do not use it to handle ToDesk passwords, private screenshots, or WeChat file/message sending unless the workflow adds explicit confirmation, recipient verification, command allowlisting, and screenshot cleanup.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/desktop_agent.py:257
Finding

Shell Command Injection in Arbitrary Application Launching

Content
View full analysis
bool: """打开应用程序""" try: # 常见应用名映射 app_map = { "notepad": "notepad.exe", "记事本": "notepad.exe", "calc": "calc.exe", "计算器": "calc.exe", "explorer": "explorer.exe", "chrome": "start chrome", "edge": "start msedge", "微信": r"WeChat\WeChat.exe", "wechat": r"Weixin\Weixin.exe", "weixin": r"Weixin\Weixin.exe", "code": "code", } cmd = app_map.get(app_name.lower(), app_name) subprocess.Popen(cmd, shell=True) ``` ### Technical Analysis When `app_name` is not present in `app_map`, the value is used directly as `cmd`. It is then passed to `subprocess.Popen` with `shell=True`. On Windows, this causes the command to be interpreted by the command shell, including metacharacters such as `&`, `|`, `>`, and command grouping syntax. The value can originate from either: - The command-line interface in `scripts/desktop_agent.py`, where `sys.argv[2]` is passed to `open_app`. - An LLM-generated `open_app` step in `scripts/task_executor.py`, where the `app` field is not constrained to an allowlist. Although `SAFE_APPS` exists in `scripts/safety.py`, it is never enforced. Therefore, neither direct callers nor planner-generated steps are restricted to known executables. ### Attack Path 1. An attacker supplies a crafted application name through the direct CLI or a natural-language task. 2. For a direct invocation, the attacker can request an application value containing shell syntax, such as an otherwise valid program name followed by an additional command. 3. For natural-language execution, the local LLM can return a plan similar to: ` ...[truncated 1214 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/safety.py:28
Finding

Safety Checks Warn About Dangerous Operations but Explicitly Permit Them

Content
View full analysis
bool: """检查任务描述是否包含危险操作""" task_lower = task.lower() for pattern in DANGEROUS_PATTERNS: if re.search(pattern, task_lower): logger.warning(f"任务包含危险操作关键词: {pattern}") # 不直接拒绝,但记录警告 logger.warning(f"⚠️ 任务可能包含危险操作: {task}") return True # 允许但警告 return True def check_plan(self, steps: list[dict]) -> bool: """检查执行计划是否安全""" if len(steps) > self.max_steps: logger.error(f"计划步数 {len(steps)} 超过最大限制 {self.max_steps}") return False for i, step in enumerate(steps): action = step.get("action", "") app = step.get("app", "").lower() # 检查是否有危险操作 for key in ("text", "key", "app"): val = str(step.get(key, "")).lower() for pattern in DANGEROUS_PATTERNS: if re.search(pattern, val): logger.warning(f"步骤 {i+1} 包含危险操作: {pattern}") return True ``` A purported application allowlist is also declared but never used: ```python SAFE_APPS = { "notepad", "calc", "explorer", "chrome", "msedge", "code", "微信", "weixin", "钉钉", "dingtalk", } ``` ### Technical Analysis Both task-level and plan-level safety checks fail open: - `check_task()` returns `True` even when a dangerous pattern is detected. - `check_plan()` logs dangerous fields but still returns `True`. - `SAFE_APPS` is not consulted when validating `open_app` actions. - The `action` variable and normalized `app` value are assigned but not meaningfully validated. - There is no requirement for user confirmation before dangerous or externally visible actions. - The checks rely on a small keyword blacklist, which is inherently bypassable through alternate command forms, encoding ...[truncated 1734 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/presets.py:15
Finding

Remote-Access Identifier and Credential-Bearing Screenshot Stored at a Predictable Plaintext Path

Content
View full analysis
dict: """ToDesk标准4步流程:启动→截图→AI识别→返回凭证 Returns: dict: {"device_code": str, "temp_password": str} """ if agent is None: agent = DesktopAgent() # Step 1: 启动ToDesk subprocess.Popen([TODESK_PATH]) logger.info("ToDesk已启动") time.sleep(3) # Step 2: 截图 agent.screenshot(str(SCREENSHOT_PATH)) logger.info(f"截图已保存: {SCREENSHOT_PATH}") # Step 3 & 4 由调用方用 image 工具识别 # 返回截图路径供AI识别 return { "screenshot_path": str(SCREENSHOT_PATH), "device_code": "401315614", # 固定设备代码 "password_needs_recognition": True } ``` ### Technical Analysis The preset launches ToDesk and captures the desktop to a fixed, predictable path. The intended workflow is to extract the temporary remote-access password from that image. Consequently, the file can contain: - The temporary ToDesk password. - The ToDesk device identifier. - Other sensitive information visible anywhere on the desktop when the full-screen screenshot is taken. The screenshot is not assigned restrictive permissions, encrypted, randomized, or deleted after processing. Reusing a fixed filename also leaves the most recent credential-bearing image at a known location. In addition, a fixed device code is embedded directly in source code and returned to callers. No caller authentication, user-presence check, approval prompt, or disclosure restriction is implemented by the preset itself. ### Attack Path 1. A user or process invokes `todesk_connect`. 2. ToDesk is launched an ...[truncated 1397 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/presets.py:108
Finding

WeChat Message and File Transmission Occurs Without Recipient Verification or Final Confirmation

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
Findings (32)

Tp4

High
Category
MCP Tool Poisoning
Confidence
87% confidence
Finding

This mismatch includes an undeclared dependency on a local HTTP LLM endpoint, which changes the skill's trust boundary and may expose prompts, screenshots, or task data to another service without clear disclosure. Hidden external processing is security-relevant even if the rest of the mismatch is mostly documentation debt.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

This mismatch includes an undeclared dependency on a local HTTP LLM endpoint, which changes the skill's trust boundary and may expose prompts, screenshots, or task data to another service without clear disclosure. Hidden external processing is security-relevant even if the rest of the mismatch is mostly documentation debt.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

This mismatch includes an undeclared dependency on a local HTTP LLM endpoint, which changes the skill's trust boundary and may expose prompts, screenshots, or task data to another service without clear disclosure. Hidden external processing is security-relevant even if the rest of the mismatch is mostly documentation debt.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill description omits clear warnings that it may capture screenshots, send WeChat messages/files, and handle remote-connection credentials, all of which affect privacy and system security. In a desktop-automation context, lack of user-facing warnings materially increases the risk of uninformed consent and misuse of high-impact capabilities.

Content

No source excerpt is available for this finding.

Ssd 3

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The workflow explicitly instructs the agent to capture a ToDesk screen, extract a dynamically generated temporary password, and disclose it. That is direct handling and transmission of remote-access credentials, which could grant an unauthorized party interactive access to the user's machine if triggered improperly or intercepted.

Content

No source excerpt is available for this finding.

Ssd 3

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

This natural-language workflow again directs the agent to recognize remote-access credentials from an image and send them back, turning the skill into an extractor and courier for authentication secrets. In the context of remote desktop software, that creates a clear path to unauthorized access and severe privacy compromise.

Content

No source excerpt is available for this finding.

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
98% confidence
Finding

Popen(cmd, shell=True) turns a nominal application-launch parameter into a general command-execution primitive. In this skill context, that substantially elevates risk because an agent that can already click, type, and capture the screen could be driven to perform end-to-end malicious operations on the host.

Content

Scanner excerpt · scripts/desktop_agent.py (reported line 273)May include surrounding context.

python
"code": "code",
            }
            cmd = app_map.get(app_name.lower(), app_name)
            subprocess.Popen(cmd, shell=True)
            logger.info(f"启动应用: {app_name} -> {cmd}")
            return True
        except Exception as e:

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
98% confidence
Finding

Popen(cmd, shell=True) turns a nominal application-launch parameter into a general command-execution primitive. In this skill context, that substantially elevates risk because an agent that can already click, type, and capture the screen could be driven to perform end-to-end malicious operations on the host.

Content

Scanner excerpt · scripts/desktop_agent.py (reported line 273)May include surrounding context.

python
"code": "code",
            }
            cmd = app_map.get(app_name.lower(), app_name)
            subprocess.Popen(cmd, shell=True)
            logger.info(f"启动应用: {app_name} -> {cmd}")
            return True
        except Exception as e:

Ssd 3

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The function is explicitly designed to obtain ToDesk connection credentials by launching the remote-access tool, capturing its screen, and enabling AI-based recognition of the temporary password. In a desktop automation skill, this is highly dangerous because it operationalizes credential harvesting for remote control, which can directly enable unauthorized access to the machine.

Content

No source excerpt is available for this finding.

Ssd 3

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The registered task description instructs the agent to retrieve and disclose a device code and temporary password, normalizing credential collection as a built-in capability. Because this skill controls the desktop and can interact with remote-access software, the task metadata itself materially increases risk by directing autonomous secret extraction and disclosure.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
86% confidence
Finding

The skill advertises and documents capabilities that invoke local scripts and use packages such as requests without declaring any tool scope or permission boundaries. For a desktop-control skill, missing explicit permissions makes it harder to constrain shell/network use and increases the chance of unintended or over-privileged execution.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The invocation condition 'use when user asks to control desktop ... or automate any Windows GUI task' is extremely broad for a capability that can click, type, screenshot, message, and support remote connection. In this context, broad routing increases the chance the skill is selected for ambiguous requests, enabling sensitive desktop actions without sufficiently specific consent.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Using broad everyday phrases like '连接你' to trigger a remote-access workflow creates a high risk of accidental invocation or prompt-triggered activation in unrelated conversations. In a desktop/remote-control skill, overly permissive triggering can lead directly to exposure of remote-access credentials or initiation of sensitive actions without clear user intent.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The screenshot function captures the full screen and writes it to a predictable local directory without any consent, redaction, or retention controls. Because desktop screens commonly contain secrets, messages, tokens, or personal data, this can create unintended sensitive-data collection and persistence.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The fallback typing path copies arbitrary text into the system clipboard and pastes it, exposing that text to other processes, clipboard history, or the user unintentionally. If the text includes credentials, API keys, or private messages, this creates a confidentiality leak beyond the intended target application.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The open_app API is documented as opening applications, but its implementation permits arbitrary command launch for any unrecognized app_name. In the context of a powerful desktop agent, this broadens the tool from GUI automation into unrestricted process execution, materially increasing abuse potential.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Launching commands through the shell without confirmation or restriction allows actions far beyond benign app opening, including script execution and chained shell operations. Within a desktop automation skill, the lack of warning or approval makes accidental or induced misuse significantly more dangerous.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
98% confidence
Finding

open_app falls back to user-controlled app_name and passes it directly to subprocess.Popen(..., shell=True). In a desktop-control skill, this enables arbitrary shell command execution rather than merely opening approved applications, so an attacker or prompt-injected instruction could execute OS commands with the agent's privileges.

Content

Scanner excerpt · scripts/desktop_agent.py (reported line 273)May include surrounding context.

python
"code": "code",
            }
            cmd = app_map.get(app_name.lower(), app_name)
            subprocess.Popen(cmd, shell=True)
            logger.info(f"启动应用: {app_name} -> {cmd}")
            return True
        except Exception as e:

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

函数文档在L030-L033声明该流程会“AI识别”并返回包含"temp_password"的凭证字典,但实际实现只启动ToDesk、截图,并返回截图路径、固定设备代码以及需要识别密码的标记。该注释/文档对调用方造成了能力预期上的直接误导,属于文档与实现相矛盾。

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/presets.py (reported line 39)May include surrounding context.

python
agent = DesktopAgent()

    # Step 1: 启动ToDesk
    subprocess.Popen([TODESK_PATH])
    logger.info("ToDesk已启动")
    time.sleep(3)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The function captures and stores a screenshot of a remote-access application screen that may contain connection credentials, then returns the path for later recognition. In this skill's context, persisting such screenshots without clear consent or secure handling exposes sensitive remote-access secrets and enables unauthorized access if the file is read by another process or actor.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/presets.py (reported line 59)May include surrounding context.

python
def wechat_ensure_running():
    """确保微信在运行"""
    import subprocess as sp
    r = sp.run(['tasklist'], capture_output=True, text=True)
    if 'Weixin' not in r.stdout:
        sp.Popen([WECHAT_PATH])
        import time; time.sleep(5)

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/presets.py (reported line 61)May include surrounding context.

python
import subprocess as sp
    r = sp.run(['tasklist'], capture_output=True, text=True)
    if 'Weixin' not in r.stdout:
        sp.Popen([WECHAT_PATH])
        import time; time.sleep(5)
        logger.info('微信已启动')

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This function can transmit an arbitrary local file to an external WeChat contact with no confirmation, destination preview, or authorization gate. In a desktop-agent context, that creates a straightforward path for unintended or malicious data exfiltration from the host.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

TASKS 中的描述与步骤写明“获取ToDesk远程连接凭证(设备代码+临时密码)”以及“AI识别密码,返回凭证”,但绑定的处理函数todesk_get_credentials并未执行识别,也未返回临时密码。这里的内联元数据与真实代码行为存在明确偏差。

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.