Back to skill

Security audit

Lanzou Downloader V1.0.9

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent Lanzou downloader, but it needs review because it executes JavaScript received from the network and does not enforce its stated domain boundary.

Install only if you are comfortable running a downloader that makes network requests and writes files, and avoid using it on untrusted or non-Lanzou links. The main issue is not the downloader purpose itself, but that remote page JavaScript can run inside the Node process with the agent user's access; this should be fixed before broad use.

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

Error
Location
scripts/download.js:383
Finding

Remote Code Execution Through Unsafe Evaluation of Network-Supplied JavaScript

Content
View full analysis

Vulnerability Details

File Location: scripts/download.js, lines 383–388 and 674–684
Vulnerability Type: Unsafe execution of untrusted remote JavaScript in a Node.js VM context
Risk Level: Critical

Vulnerable Code

js
function computeAcw(body, cookieJar) {
  const scriptMatch = body.match(/<script>([\s\S]*?)<\/script>/);
  if (!scriptMatch || !body.includes('arg1=')) return cookieJar;
  const fakeDoc = { cookie: '', location: { reload: () => {} } };
  const ctx = vm.createContext({ document: fakeDoc, Date, console: { log: () => {}, error: () => {}, warn: () => {} } });
  try { vm.runInContext(scriptMatch[1], ctx, { timeout: 5000 }); } catch (e) {}
  if (fakeDoc.cookie) {

The main download path repeats the same unsafe operation:

js
const scriptMatch = body.match(/<script>([\s\S]*?)<\/script>/);
if (!scriptMatch) throw new Error('无法提取 JS 脚本');

const fakeDoc = { cookie: '', location: { reload: () => {} } };
const ctx = vm.createContext({
  document: fakeDoc,
  Date: Date,
  console: { log: () => {}, error: () => {}, warn: () => {} },
});

vm.runInContext(scriptMatch[1], ctx, { timeout: 5000 });

Technical Analysis

The downloader retrieves HTML from a remote endpoint, extracts the first script block when the response contains arg1=, and executes that script using vm.runInContext.

The evaluated script is network-controlled code rather than locally trusted code. Node.js VM contexts are not designed to be a security boundary for hostile input. More importantly, the context explicitly exposes the host-realm Date constructor. A hostile script may traverse the exposed constructor chain to obtain the host Function constructor and then recover Node.js objects such as process. A representative escape primitive is conceptually:

js
const processObject =
  Date.constructor.constructor('return process')();

Once process is obtained, the script can access environment variables, load Node.js modules through reachabl ...[truncated 2637 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove remote JavaScript evaluation entirely. Implement the acw_sc__v2 calculation as a fixed local algorithm operating only on narrowly validated challenge values. Do not execute script text extracted from a response.

  2. Enforce the documented network boundary in code.

    • Require HTTPS for share, API, iframe, redirect, and download URLs.
    • Validate every destination and every redirect against an explicit hostname allowlist.
    • Normalize hostnames before comparison and use exact names or dot-boundary suffix checks.
    • Reject credentials in URLs, unexpected ports, non-HTTP protocols, and redirects outside the permitted domain set.
  3. Do not treat node:vm as a hostile-code sandbox. Removing Date and other explicit host objects would reduce this particular escape route but would not make arbitrary remote-code evaluation safe.

  4. If script execution is operationally unavoidable, isolate it outside the downloader process. Use a disposable, least-privileged container or worker with:

    • No host filesystem mounts.
    • No inherited environment variables or credentials.
    • No child-process capability.
    • No outbound network access.
    • Strict CPU, memory, and execution-time limits.
    • A minimal structured input and output protocol.
  5. Add regression tests using hostile challenge pages to verify that response scripts are never evaluated and that cross-origin, plain-HTTP, and non-allowlisted redirects are rejected before response content is processed.

Vulnerability Patterns
  • 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
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (16)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 27)May include surrounding context.

md
node scripts/download.js <蓝奏云分享链接> [输出文件路径] [密码] [--select 目标1,目标2] [--list] [--insecure]

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 41)May include surrounding context.

md
node scripts/download.js <蓝奏云分享链接> [输出文件路径] [密码] [--select 目标1,目标2] [--list] [--insecure]

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 44)May include surrounding context.

md
node scripts/download.js <蓝奏云分享链接> [输出文件路径] [密码] [--select 目标1,目标2] [--list] [--insecure]

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 47)May include surrounding context.

md
node scripts/download.js <蓝奏云分享链接> [输出文件路径] [密码] [--select 目标1,目标2] [--list] [--insecure]

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 56)May include surrounding context.

md
node scripts/batch.js --urls "<url1>" "<url2>" ...

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 57)May include surrounding context.

md
node scripts/batch.js --urls "<url1>" "<url2>" ...

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 60)May include surrounding context.

md
node scripts/batch.js --urls "<url1>" "<url2>" ...

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 61)May include surrounding context.

md
node scripts/batch.js --urls "<url1>" "<url2>" ...

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 62)May include surrounding context.

md
node scripts/batch.js --urls "<url1>" "<url2>" ...

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 103)May include surrounding context.

md
node scripts/batch.js --urls "<url1>" "<url2>" ...

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding

The skill explicitly describes network access and possible environment-controlled behavior (LANZOU_INSECURE_TLS=1), but it does not declare an explicit tool scope such as allowed tools or permissions. That mismatch weakens sandbox/policy enforcement because an agent may execute the skill with broader capabilities than reviewers expect, especially for outbound requests and security-sensitive TLS opt-out behavior.

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 descriptive comments and command usage are written entirely in Chinese, and the script continues this with Chinese-only runtime messages. Because the skill does not provide any user opt-in, alternative language, or justification that it is intentionally region-specific, this is a natural-language locale policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The request headers hard-code Accept-Language: zh-CN,zh;q=0.9,en;q=0.8, which imposes a specific language/locale preference in network interactions. The policy allows locale constraints only when users are given a choice or the constraint is clearly documented and justified as region-specific; this file does not present that as a user-selectable option.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The streaming request path separately sets Accept-Language: zh-CN,zh;q=0.9, again enforcing a Chinese locale for requests. Because this behavior is duplicated in a second code path and not exposed as a user choice, it constitutes the same natural-language locale policy issue.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest context describes the skill as version V1.0.9, but this file declares version 1.0.8. This is a direct documentation/metadata contradiction about the skill's identity and release state, even though it is not a behavioral security issue.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

The manifest's human-readable reason field is written only in Chinese (纯 Node.js 实现...) with no indication that language choice is optional or localized. This creates a natural-language locale policy issue because the skill metadata implicitly assumes a specific language for all users.

Content

No source excerpt is available for this finding.