Back to skill

Security audit

LegionSpace 大群空间版本查询

Security checks for vulnerabilities and agentic risk

Overview

This skill appears to do the advertised version check, but its launcher can automatically install unpinned packages and a browser runtime and bypass proxies without explicit confirmation.

Install only if you are comfortable with the launcher downloading Python packages and Chromium into the running environment and making direct outbound requests that ignore proxies. Prefer running it in a disposable virtual environment or container, preinstall pinned dependencies yourself, and avoid running the launcher with administrator privileges.

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

T08 · Insecure Dependencies

Warning
Location
scripts/大群空间版本查询.sh:30
Finding

Unpinned Automatic Dependency and Browser Installation

Content
View full analysis

Vulnerability Details

File Location: scripts/大群空间版本查询.sh, lines 30–47
Vulnerability Type: Unpinned third-party dependency and browser installation
Risk Level: Medium

Vulnerable Code

bash
# requests
if ! $PYTHON -c "import requests" 2>/dev/null; then
    echo "[*] 安装 requests ..."
    $PYTHON -m pip install requests --quiet
fi
echo "[OK] requests"

# playwright
if ! $PYTHON -c "from playwright.sync_api import sync_playwright" 2>/dev/null; then
    echo "[*] 安装 playwright ..."
    $PYTHON -m pip install playwright --quiet
    echo "[*] 安装 Chromium (playwright) ..."
    $PYTHON -m playwright install chromium --with-deps 2>/dev/null || \
    $PYTHON -m playwright install chromium 2>/dev/null
fi
echo "[OK] playwright + Chromium"

Technical Analysis

The documented entry script automatically installs the latest available versions of requests and playwright from the Python package index configured in the execution environment. It does not constrain package versions, verify artifact hashes, enforce a trusted repository, or use a locked dependency manifest.

It subsequently invokes Playwright to download a Chromium build. The --with-deps option may also invoke operating-system package-management operations to install browser dependencies. These mutable external components and installation procedures become executable parts of the Skill without having been included in the reviewed project.

An attacker who compromises a configured package index, a legitimate dependency release, its transitive dependency chain, or the browser distribution channel could cause malicious installation or runtime code to execute. A locally configured malicious index or package mirror could provide the same result. This is a supply-chain risk; the audited files do not themselves establish that any currently distributed dependency is malicious.

Attack Path

  1. The user or agent follows the document ...[truncated 1413 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove automatic dependency installation from the normal runtime path. If a dependency is missing, stop and provide explicit setup instructions.
  2. Define exact dependency versions in a lock file and verify downloaded artifacts using cryptographic hashes, such as with pip's --require-hashes.
  3. Install dependencies into a dedicated virtual environment rather than the invoking user's global Python environment.
  4. Configure an explicitly trusted package index and prevent unintended index or mirror overrides in controlled deployments.
  5. Pin the Playwright package and its compatible Chromium revision. Pre-provision and validate the browser artifact where practical.
  6. Move playwright install --with-deps into a separate, explicit setup step requiring informed user approval. Do not perform operating-system package installation during an ordinary version query.
  7. Run the query process as a non-privileged user in a sandbox or container with restricted filesystem and network access.
  8. Add dependency update and integrity-review procedures so version changes are reviewed before deployment.
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (9)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill instructs execution of scripts that use environment settings, write files, and access external networks, but it declares no explicit tool scope or permissions boundaries. This creates a confused-deputy risk where an agent may run capabilities broader than the user expects, including dependency installation and uncontrolled outbound requests.

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 description and title are primarily in Chinese and present the skill as operating in Chinese app-store context without stating any user language choice or opt-in. This can violate language/locale policy when a skill implicitly constrains interaction language rather than offering a choice.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The module docstring is written entirely in Chinese and the script's user-facing behavior also uses Chinese-only output, which imposes a fixed language/locale on users. The policy allows locale constraints only when they are justified or when users are given a choice, neither of which is stated here.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The script globally disables proxy use by setting NO_PROXY/no_proxy to '*', which alters process-wide network routing in a way unrelated to simple version checking. This can bypass enterprise monitoring, security controls, or required egress paths for all subsequent network requests in the process, making the skill more dangerous than its stated purpose suggests.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

All runtime status messages and the generated report content are hardcoded in Chinese, with no opt-in or alternate locale support. This is a natural-language policy concern because the script enforces one language for all users without documenting a justified regional limitation.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The script goes beyond a read-only version check by automatically installing Python packages and a Chromium browser runtime on the host. That creates unnecessary system modification and supply-chain exposure for a skill whose stated purpose is only to query app-store version data, making compromise of package sources or unintended host changes a meaningful risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script silently performs pip installs and Playwright browser installation without first warning the user that it will change the system and download executable components. In an agent-skill context, this is dangerous because invoking a simple query tool can unexpectedly modify the host, consume network and disk resources, and introduce unreviewed third-party code execution paths.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The manifest frames the skill as a version-checking utility for LegionSpace across app stores, which implies querying and returning version information. In addition to that, the code creates and writes a persistent local file LegionSpace_versions.txt, introducing a side effect not stated in the manifest description.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script's comments and displayed messages are written entirely in Chinese, which enforces a specific language for users without offering an alternative or indicating that the skill is intended only for a Chinese-speaking context. This can violate language or locale policy when no opt-in or justification is provided.

Content

No source excerpt is available for this finding.