Back to skill

Security audit

Windows-health

Security checks for vulnerabilities and agentic risk

Overview

This Windows cleanup skill is coherent and mostly read-first, with clear confirmation gates before deleting, moving, or changing system state.

Install only if you are comfortable with a Chinese-language Windows maintenance skill that may inspect local system metadata such as disk usage, running processes, startup entries, Recent Items, and large-file candidates. Do not run cleanup actions unless the agent shows the exact paths and action, and prefer removing the ExecutionPolicy Bypass from the PowerShell command in managed 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 (1)

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:106
Finding

PowerShell Execution Policy Is Unnecessarily Bypassed

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 106–107
Vulnerability Type: PowerShell security-control bypass
Risk Level: Medium

Vulnerable Code

powershell
PowerShell -ExecutionPolicy Bypass -File scripts/scan.ps1
PowerShell -ExecutionPolicy Bypass -File scripts/scan.ps1 -Deep

The same invocation pattern also appears in usage comments at scripts/scan.ps1, lines 2–3:

powershell
# 用法:powershell -ExecutionPolicy Bypass -File scan.ps1          快速扫描
#       powershell -ExecutionPolicy Bypass -File scan.ps1 -Deep    深度诊断(大文件 + node_modules)

Technical Analysis

The documented commands start PowerShell with ExecutionPolicy set to Bypass. This suppresses execution-policy checks for the new PowerShell process, even though the bundled diagnostic script only performs ordinary read-only operations and has no demonstrated requirement for this setting.

PowerShell execution policy is not a complete security boundary, but it can enforce organizational script-signing or provenance requirements and prevent accidental execution of untrusted scripts. Explicitly overriding it defeats that defense-in-depth control. The risk becomes exploitable if scripts/scan.ps1 is modified or replaced after review but before invocation.

The audit found no malicious behavior in the current script: it does not download payloads, establish persistence, transmit information, or execute destructive commands. The vulnerability concerns the insecure invocation mechanism rather than the present script contents.

Attack Path

  1. An attacker gains write access to the project directory or otherwise replaces scripts/scan.ps1.
  2. The attacker inserts PowerShell commands that execute with the invoking user's privileges.
  3. The user or Agent follows the instructions in SKILL.md.
  4. PowerShell starts with execution-policy checks bypassed.
  5. The tampered script executes without the signing or policy restriction that might otherwise have blocked or ...[truncated 778 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove -ExecutionPolicy Bypass from all documented commands:
powershell
PowerShell -File scripts/scan.ps1
PowerShell -File scripts/scan.ps1 -Deep
  1. Resolve and validate the script path before execution so an unintended working directory cannot select another file:
powershell
$script = (Resolve-Path ".\scripts\scan.ps1").Path
PowerShell -File $script
  1. For managed environments, sign the script with a trusted code-signing certificate and retain the organization's configured execution policy, such as AllSigned.

  2. Verify the script's publisher or cryptographic hash before invoking it when distributed outside a trusted package channel.

  3. Remove the bypass examples from scripts/scan.ps1, lines 2–3, to prevent users from continuing to follow the unsafe pattern.

  4. Avoid automatically elevating execution. If a future operation requires administrator privileges, isolate that operation, explain why elevation is needed, and request explicit authorization.

Vulnerability Patterns
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (8)

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill advertises very broad trigger phrases such as “清理一下”, “电脑卡”, and “运行慢”, which are common everyday utterances that can cause the agent to invoke this powerful system-maintenance skill in situations where the user did not intend disk, file, or system-health operations. Because the skill can progress from diagnosis toward deletion, migration, startup inspection, and other sensitive local-system actions, overbroad activation increases the risk of inappropriate tool use and privacy-invasive scanning.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The quick-scan and deep-diagnosis sections define fuzzy activation criteria like '帮我看看', '感觉慢', '彻底整理', and '全面大扫除' without clear invocation boundaries. This ambiguity can cause the agent to select a deeper and more intrusive scan than the user intended, exposing directory structure, installed software, startup items, recent items, and other sensitive metadata even when the request was casual or underspecified.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The eval case uses the very broad prompt '帮我清理一下电脑' as an activation-positive example, which can train or validate the skill to trigger on vague everyday language without enough task scoping or authorization boundaries. In a system-health skill that may lead to file deletion, cleanup, or system changes, overbroad triggering increases the chance of unsafe activation on ambiguous user intent.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This PowerShell file contains natural-language comments and all user-facing Write-Host messages in Chinese, but there is no indication that the skill is intended only for Chinese-speaking users or that language selection is configurable. That can violate language/locale policy where skills must not force a specific language without user opt-in.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The trigger phrase "帮我清理一下电脑" is overly broad everyday language that can activate a high-impact system maintenance skill without the user clearly requesting diagnostics versus cleanup. In this skill context, that ambiguity is more dangerous because the skill deals with disk cleanup, file deletion or migration, and system tuning, so an imprecise invocation could lead an agent to propose or initiate risky maintenance flows beyond the user's intent.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The file contains natural-language prompts in Chinese, but there is no surrounding text indicating that the skill or eval suite is intentionally limited to Chinese-language interactions or that users can choose another language. This can reflect a locale-specific assumption without documented opt-in or justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

SQP-3 applies to all file types and covers language or locale policy violations. This markdown file forces a specific language for the skill reference content, and there is no opt-in, alternative language option, or justification that the skill is intentionally limited to Chinese-speaking users.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
74% confidence
Finding

All user-facing scenario content and expected behavior are written only in Chinese, with no indication that users may choose another language or locale. Under the policy rule, language constraints should be optional or explicitly justified rather than implicitly fixed.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.