Back to skill

Security audit

Windows packag manager installer

Security checks for vulnerabilities and agentic risk

Overview

This skill gives Windows package-manager installation guidance, including powerful Chocolatey setup commands that users should review before running.

Install only if you want the agent to help with Windows package-manager setup. Before running any generated PowerShell, check that it matches your goal, understand whether it needs administrator rights, and be comfortable with installing Chocolatey and changing Chocolatey package sources to the Tsinghua mirror.

Vulnerability Patterns
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Findings (1)

T03 · Remote Payload Retrieval and Execution

Error
Location
SKILL.md:140
Finding
Unverified Remote PowerShell Script Download and Execution## Vulnerability Details **File Location**: `SKILL.md`, lines 140-146 **Vulnerability Type**: Remote payload retrieval and execution **Risk Level**: High **Vulnerable Code**: ```powershell Set-ExecutionPolicy Bypass -Scope Process -Force [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072 iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) ``` ### Technical Analysis The documented Chocolatey installation workflow downloads a PowerShell script from an external URL and passes its contents directly to `iex` (`Invoke-Expression`). The downloaded payload is therefore executed immediately without first being saved for inspection, pinned to a reviewed version, checked against a trusted cryptographic digest, or validated through an Authenticode signature. The preceding `Set-ExecutionPolicy Bypass -Scope Process -Force` command removes execution-policy restrictions for the current PowerShell process. Although HTTPS protects the connection in transit under normal conditions, it does not make the retrieved content immutable or ensure that it matches the code reviewed during this audit. The effective payload can change whenever the remote script changes. Exploitation would require malicious control or compromise of the remote content delivery path, such as compromise of the upstream origin, its publishing process, or a relevant TLS trust boundary. An attacker able to alter the returned script could place arbitrary PowerShell instructions in the response, which `iex` would then execute in the current security context. ### Attack Path 1. A user requests installation of Chocolatey, a Windows package-management environment, or software for which the skill selects Chocolatey. 2. The workflow determines that Chocolatey is missing and instructs the user to launch the installation flow, potentially from an elevated PowerShell sessi ...[truncated 1249 chars]
Remediation
## Remediation Suggestions Replace the download-and-`iex` pattern with a verifiable, reviewable installation process: 1. Download the installer script or version-pinned Chocolatey package to a local file rather than executing an in-memory response. 2. Pin the artifact to a specific reviewed release and an official, immutable distribution location where available. 3. Obtain the expected SHA-256 digest through a separate trusted channel and compare it with the downloaded file before execution. 4. Validate the file's Authenticode signature and require an expected trusted publisher when an officially signed artifact is available. 5. Stop installation if the hash, signature, publisher, or expected version does not match. 6. Show the artifact source and verification results to the user and require explicit approval before execution. 7. Avoid changing PowerShell execution policy unless strictly necessary. If a process-scoped change is unavoidable, explain its effect and ensure that installation terminates safely on any verification failure. 8. Run installation with the least privileges possible and request elevation only for operations that genuinely require administrative rights. 9. Prefer a trusted, locally available Windows package-management mechanism for installing Chocolatey when such a mechanism supports authenticated and versioned artifacts.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (2)

Natural-Language Policy Violations

Medium
Confidence
98% confidence
Finding
The skill mandates ending responses in Chinese regardless of the user's language preference. This is not a classic security flaw, but it can impair user comprehension of privileged installation steps and warnings, which indirectly raises the chance of unsafe execution or misunderstanding.

Missing User Warnings

Medium
Confidence
89% confidence
Finding
The skill includes system-altering installation commands, including remote-script execution for Chocolatey and package source reconfiguration, but does not consistently require an explicit warning or confirmation before the user runs them. In a security context, this increases the risk of users executing privileged changes they do not fully understand, especially because the commands modify package manager state and trust sources.

Static analysis

No suspicious patterns detected.