Back to skill

Security audit

Weread Reading Recommender

Security checks for vulnerabilities and agentic risk

Overview

The skill appears purpose-built for WeRead recommendations, but it needs review because it uses a live WeRead cookie and stores detailed reading-history exports without strong secret-handling or file-permission safeguards.

Install only if you are comfortable letting the skill use a WeRead session cookie and create local files containing your reading history. Prefer a protected cookie file or carefully managed environment variable over --cookie, store exports in a private directory, review or delete raw exports when finished, and ask the agent to refresh data only when you explicitly want it to.

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

Warning
Location
scripts/export_weread.py:40
Finding

Authentication Cookie Exposure Through Command-Line Arguments

Content
View full analysis
tuple[str, CookieSource]: if args.cookie: cookie = args.cookie.strip() if not cookie: raise ExportError("--cookie was provided but is empty.") return cookie, CookieSource(source="cli") ``` ### Technical Analysis The exporter accepts a live WeRead authentication cookie directly through the `--cookie` command-line option. Command-line arguments are not a secure secret transport mechanism because they may be: - Recorded in shell history. - Exposed through process-listing utilities while the exporter is running. - Collected by local process-monitoring or endpoint telemetry. - Retained in command execution logs maintained by wrappers, terminals, or automation systems. Although the implementation does not print or deliberately persist the cookie in exported JSON, accepting it as an argument creates a separate local disclosure channel. The direct CLI method is also listed as a supported input in `SPEC.md`, increasing the likelihood that users will use it. The actual transmission of the cookie to the hard-coded first-party WeRead HTTPS endpoints is necessary for the declared export functionality. The vulnerability concerns how the credential is supplied to the script, not the authenticated first-party request itself. ### Attack Path 1. A user runs the documented exporter with a command such as: ```bash python3 scripts/export_weread.py --cookie "wr_skey=...; wr_vid=..." --out data/weread-raw.json ``` 2. The complete cookie is placed in the process argument vector and may also be saved in shell history. 3. A local attacker, monitoring agent, command logger, or another acco ...[truncated 995 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/export_weread.py:263
Finding

Unfiltered Authenticated API Responses Stored Without Enforced Restrictive Permissions

Content
View full analysis
None: out_path.parent.mkdir(parents=True, exist_ok=True) out_path.write_text( json.dumps(payload, ensure_ascii=False, indent=2) + "\n", encoding="utf-8", ) ``` ```python summary = build_summary(shelf_sync, notebook) payload: Dict[str, Any] = { "exported_at": utc_now_iso(), "source": "weread-local-cookie", "summary": summary, "shelf_sync": shelf_sync, "notebook": notebook, "book_info": book_info, } source_meta = {"cookie_source": cookie_source.source} if cookie_source.env_var: source_meta["cookie_env_var"] = cookie_source.env_var payload["source_meta"] = source_meta ``` ### Technical Analysis The exporter stores complete authenticated responses from the shelf, notebook, and optional book-information endpoints. It does not project those responses onto an allowlist of fields required for recommendation processing. This design means that any undocumented fields currently returned by WeRead, or fields added by the service in the future, are automatically persisted. Such fields could contain account identifiers, private archive names, timestamps, notebook metadata, or other information unnecessary for recommendation generation. The output is created through `Path.write_text()` and relies on the process’s current `umask`. The script does not enforce owner-only permissions such as `0600`. On systems configured with a permissive `umask`, the exported reading history may therefore be readable by other local users or processes. This behavior conflicts with the project’s stated privacy principle that the exporter should write only reading-record data necessary for downstream recommendation work. Th ...[truncated 1593 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • 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
Findings (14)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The skill is presented as local-first analysis and recommendation logic, but the described/exported behavior depends on using an authentication cookie to access remote WeRead services. That mismatch can mislead users about where their data is processed and what actions will occur, undermining informed consent around authenticated network access and privacy-sensitive reading-history export.

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 38)May include surrounding context.

md
4. If no local cookie source exists, ask the user to set one locally and stop there. Do not tell the user to edit `SKILL.md`.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
4. If no local cookie source exists, ask the user to set one locally and stop there. Do not tell the user to edit `SKILL.md`.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The entire skill description is written only in Chinese and does not indicate that users may interact in other languages or choose a preferred locale. Under the policy for natural-language constraints, a skill that effectively forces a specific language without opt-in should be flagged unless the locale restriction is clearly justified.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill declares no explicit tool scope while its documented workflow requires reading environment variables, reading and writing local files, and making authenticated network requests via the export script. Without a narrow permission boundary, an agent may invoke broader capabilities than users expect, increasing the risk of overreach or unintended access to sensitive local data and authenticated sessions.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The skill instructs users to use a local authentication cookie and run export commands, but it does not provide a prominent user-facing warning about the sensitivity of that cookie and the privacy implications of exporting reading history. In this context, the cookie may grant account access and the exported data may reveal personal interests, habits, and potentially sensitive topics.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The example shows setting the full authentication cookie directly in a shell environment variable without warning that command lines may be captured in shell history, terminal logs, process inspection, or remote session tooling. This creates a practical secret-handling weakness that could expose the user's WeRead session token to other local users, logs, or support systems.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The trigger description uses broad intents like 'analyze reading history' and 'recommend books from WeRead history' without narrowing context or giving negative examples. This can overlap with general book-analysis or recommendation requests and makes it unclear when this specific skill should activate versus other reading or recommendation skills.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The script accesses sensitive authentication material via --cookie, --cookie-file, or an environment variable, then sends it in the Cookie header for remote requests. While this is necessary for the tool's function, there is no visible warning that the user is supplying account credentials and that these will be used to access account data over the network.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

This code writes a raw JSON snapshot containing shelf, notebook, and optional book metadata to a user-specified file. Although the script description says it exports data, there is no explicit warning in code comments, prompts, or user-facing output that the file may contain sensitive personal reading activity and notes.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The script generates user-facing natural-language hints exclusively in Chinese via fixed string literals. There is no visible option, configuration, or documentation allowing the user to choose another language, so the skill appears to force a specific locale without opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

This JSON contains substantial Chinese-language fields and hints alongside English-language titles and metadata, but there is no natural-language indication that the user can choose a language or that the mixed locale is intentional. Under the stated policy, forcing or assuming a specific language/locale without opt-in can be a policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

This JSON file contains user-facing natural-language fields primarily in Chinese, but the entry for "The Psychology of Money" includes English title and intro text without any indication that mixed-language output is intentional or user-selected. Under the policy rule for language or locale constraints, this can be considered a locale inconsistency because the file presents content in multiple languages 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
84% confidence
Finding

This markdown file includes a natural-language example value (商业) that assumes a specific language/locale. The file does not indicate that the schema is region-specific or that language may vary, so it can be read as implicitly forcing a locale-specific output format.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.