Back to skill

Security audit

微信读书 AI 阅读助手

Security checks for vulnerabilities and agentic risk

Overview

This WeRead assistant is mostly coherent, but it stores reusable login cookies and private reading exports locally while also using a risky shell command during QR login.

Review this carefully before installing, especially in a shared, synced, backed-up, or source-controlled workspace. Treat profile/weread-cookies.json like a password, and treat books/, output/, screenshots, notes, metadata, and chat files as private reading data. The QR-code download should be replaced with a shell-free, host-validated implementation before use in higher-risk 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 (2)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/login.js:123
Finding

Shell Command Injection Through a Remote QR-Code URL

Content
View full analysis
{ const img = document.querySelector('.js_qrcode_img'); return img ? img.getAttribute('src') : null; }); if (!qrCodeUrl) { throw new Error('未找到二维码图片 URL'); } const fullQrUrl = qrCodeUrl.startsWith('http') ? qrCodeUrl : `https://open.weixin.qq.com${qrCodeUrl}`; console.log(`[weread] 二维码 URL: ${fullQrUrl}`); // 直接下载二维码图片 const { execSync } = require('child_process'); execSync(`curl -sL "${fullQrUrl}" -o "${QR_CODE_FILE}"`, { timeout: 10000 }); ``` ### Technical Analysis The QR-code URL is obtained from an externally rendered WeChat login iframe and interpolated directly into a command string executed by `child_process.execSync`. This API invokes a command through a system shell. Placing the URL inside double quotes does not make the command safe. Shell constructs such as command substitution—`$(command)` or backticks—can still execute inside double-quoted strings. The validation only checks whether the value starts with `http`; it neither restricts the destination to `open.weixin.qq.com` nor prevents shell metacharacters. Because the iframe-derived value crosses a remote-content trust boundary before reaching a shell execution sink, compromised or manipulated iframe content could result in arbitrary command execution. ### Attack Path 1. An attacker gains the ability to alter the QR-code image `src`, such as through compromised remote login content, a malicious upstream response, or another mechanism capable of changing the rendered iframe content. 2. The attacker supplies a value that begins with `http` but contains shell command substitution, for example a URL containing `$(attacker_command)`. 3. The script reads the malicious value through `getAttribute('src')`. 4. The `startsWith('ht ...[truncated 817 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/login.js:47
Finding

Reusable Authentication Cookies Stored in Unprotected Plaintext

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (27)

Missing User Warnings

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

Persistent login cookies are effectively bearer credentials: anyone who obtains them may be able to access the user's WeRead session without scanning a QR code again. Because this skill is built around automated login and saves cookies to disk, the absence of a strong warning and storage-hardening guidance makes credential theft or accidental disclosure materially more dangerous in this context.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The documented purpose understates the actual capabilities of the skill, while the content itself indicates broad extraction, archival, and handling of protected reading content and related local processing. A description-behavior mismatch is dangerous because reviewers and users may grant trust or permissions based on an incomplete understanding, especially for a skill that logs in, persists cookies, extracts rendered text, and stores user/content data on disk.

Content

No source excerpt is available for this finding.

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
通过拦截微信读书网页版 API 请求,自动获取用户在该书上的全部划线(高亮)和笔记。每次 `read-chapter.js` 执行时会自动拉取,也可单独运行 `get-notes.js` 刷新。

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
通过拦截微信读书网页版 API 请求,自动获取用户在该书上的全部划线(高亮)和笔记。每次 `read-chapter.js` 执行时会自动拉取,也可单独运行 `get-notes.js` 刷新。

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
通过拦截微信读书网页版 API 请求,自动获取用户在该书上的全部划线(高亮)和笔记。每次 `read-chapter.js` 执行时会自动拉取,也可单独运行 `get-notes.js` 刷新。

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
通过拦截微信读书网页版 API 请求,自动获取用户在该书上的全部划线(高亮)和笔记。每次 `read-chapter.js` 执行时会自动拉取,也可单独运行 `get-notes.js` 刷新。

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
通过拦截微信读书网页版 API 请求,自动获取用户在该书上的全部划线(高亮)和笔记。每次 `read-chapter.js` 执行时会自动拉取,也可单独运行 `get-notes.js` 刷新。

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
通过拦截微信读书网页版 API 请求,自动获取用户在该书上的全部划线(高亮)和笔记。每次 `read-chapter.js` 执行时会自动拉取,也可单独运行 `get-notes.js` 刷新。

Lp1

High
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The script has shell-execution capability via child_process.execSync to run curl, which expands its privilege surface beyond browser automation. Even though the current command uses an internally derived URL and fixed output path, introducing undeclared shell access increases risk because future changes or unexpected input could turn it into command injection or unauthorized command execution.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The script persists authenticated Weread cookies to a JSON file on disk, which can enable session hijacking if the file is read by another local user, malware, or included in backups or repositories. Because cookies represent active authenticated state, compromise of this file may allow unauthorized access to the user's reading account without reauthentication.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The README explicitly advertises persistent storage of cookies, screenshots, notes, and chat records, which are all sensitive artifacts that can expose account sessions, reading history, personal annotations, and potentially private conversations if the local machine, repository, or backup storage is accessed. In this skill context, the data is collected from a real user account via browser automation, which increases the likelihood that highly personal content will be retained longer than users expect.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill persists authentication cookies to disk, but the description does not present this as a clear security warning. Disk-stored session material can be copied or reused by other local users, malware, backups, or unintended tooling, potentially allowing account access without re-authentication.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill automatically collects and archives reading progress, chapter text, screenshots, notes, and chat history, but the description lacks a strong privacy warning about the breadth and persistence of this data collection. This creates risk of sensitive behavioral, intellectual, or personal data being retained unexpectedly and later exposed through local compromise, syncing, sharing, or misuse.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

This code file reads authentication cookies from a local profile file and later injects them into a browser context for requests to weread.qq.com. Although the header describes functionality and output files, it does not explicitly warn that the script uses stored authenticated session data to access account content, which is a privacy-relevant operation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The script writes extracted reading notes and metadata to books/<书名>/notes.md and metadata.json, which may contain private reading history and personal annotations. While the header states where files are saved, it does not clearly warn that potentially sensitive personal content will be persisted locally.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The browser context is hard-coded to use locale: 'zh-CN', which is a natural-language/locale policy constraint. The file does not indicate that users can opt in to this locale or configure an alternative, so it imposes a specific language setting by default.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script stores login cookies unencrypted on disk in a predictable local path, creating a reusable authentication artifact. If another local user, process, backup system, or malware can read that file, they may hijack the user's WeRead session without re-authenticating.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

Invoking curl through execSync introduces unnecessary shell execution in a login flow handling authentication artifacts. While the QR URL is sourced from the WeChat login iframe rather than direct user input, the pattern is still dangerous because shelling out creates command-execution risk and trusts external page-controlled data when a safer in-process download method is available.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The script intercepts network responses for bookmark, review, and reading-info APIs, then later persists that data locally. User annotations and notes can reveal personal beliefs, interests, and habits, so silently collecting and storing them increases privacy exposure beyond merely automating reading.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script captures screenshots of the active reading page and stores them locally without a warning or confirmation step. Screenshots can contain copyrighted book text, reading progress, account UI state, and other sensitive context, making unintended disclosure more likely if the files are accessed or synced elsewhere.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script writes extracted reading content, annotations, and notes to local files under the books directory without any explicit runtime notice, consent prompt, or data minimization. This creates a privacy risk because highly sensitive personal reading history and intellectual activity can persist on disk and later be exposed to other local users, backups, malware, or accidental sharing.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The package description is written only in Chinese ("微信读书 AI 阅读助手"), which indicates a language-specific presentation without any accompanying opt-in or multilingual alternative. Under the policy criteria, forcing a specific language without user choice can be a natural-language locale violation unless it is clearly justified as region-specific.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
89% confidence
Finding

Using a caret version for Playwright allows automatic installation of newer minor/patch releases, which can introduce supply-chain risk, unexpected behavior changes, or breakage if an upstream release is compromised or flawed. In a browser-automation skill that handles login flows and reading data, dependency integrity matters because the package runs code with access to authenticated sessions.

Content

Scanner excerpt · package.json (reported line 15)May include surrounding context.

json
"notes": "node scripts/get-notes.js"
  },
  "dependencies": {
    "playwright": "^1.60.0"
  }
}

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script hard-codes locale: 'zh-CN', which imposes a specific language/locale behavior on all executions. There is no user opt-in, configuration option, or documented rationale showing that this locale restriction is required.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The browser context is created with locale set to 'zh-CN', which imposes a specific language/locale behavior on all users. The file does not provide opt-in, configurability, or a documented justification that this skill is intended only for a Chinese-locale environment.

Content

No source excerpt is available for this finding.

Static analysis

Detected: suspicious.dangerous_exec

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
scripts/login.js:149