Back to skill

Security audit

書籍推薦引擎

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent book recommendation and wishlist skill, with ordinary local storage and web lookups, but users should note the exact external sites and generated files are not fully spelled out.

Install only if you are comfortable with book queries, topics, and ISBNs being sent to external book/search sites and with reading preferences being stored locally under ~/.bookshelf-plus/recommendations. Treat generated web snippets and Open Library descriptions as untrusted text, and choose export/output paths carefully because existing files may be overwritten.

Vulnerability Patterns
  • 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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Findings (2)

T01 · Skill Instruction Hijacking

Warning
Location
scripts/booklist_generator.py:249
Finding

Untrusted DuckDuckGo Search Content Is Inserted into Agent-Visible Booklists

Content
View full analysis
list[dict]: """Use DuckDuckGo HTML search without an API key.""" url = f"https://duckduckgo.com/html/?q={urllib.parse.quote(query)}" try: req = urllib.request.Request(url, headers={"User-Agent": "Mozilla/5.0"}) with urllib.request.urlopen(req, timeout=10) as resp: html = resp.read().decode("utf-8", errors="replace") # Extract snippets results = [] for match in re.finditer( r']*>(.*?)', html, re.DOTALL ): snippet = re.sub(r"<[^>]+>", "", match.group(1)).strip()[:150] if snippet: results.append({"snippet": snippet}) if len(results) >= limit: break return results except Exception: return [] ``` ```python if include_web and books: lines.append("\n---\n## 🌐 網路延伸閱讀\n") for b in books[:3]: query = f"{b['title']} {b.get('author','')} book summary" web = _web_search(query, 1) if web: snippet = web[0].get("snippet","") lines.append(f"- **{b['title']}**:{snippet}") else: lines.append(f"- **{b['title']}**:{b.get('why','')}") ``` ```python if args.web: query = f"best books about {args.topic} reading list" web_results = _web_search(query, 5) for r in web_results: data["books"].append({ "title": r.get("snippet","")[:60], "author": "搜尋結果", "why": r.get("snippet",""), "难度": 2, "required": False, }) ``` ### Technical Analysis The `--web` feature ...[truncated 2312 chars]
Remediation
View remediation

T01 · Skill Instruction Hijacking

Warning
Location
scripts/openlibrary_client.py:321
Finding

Untrusted Open Library Metadata Is Printed Directly into Agent-Visible Output

Content
View full analysis
dict | None: if params: url += "?" + urllib.parse.urlencode(params) try: req = urllib.request.Request(url, headers={"User-Agent": "QClaw-Reader/1.0"}) with urllib.request.urlopen(req, timeout=15) as resp: return json.loads(resp.read().decode("utf-8", errors="replace")) except Exception as e: print(f"⚠️ 網路請求失敗:{e}", file=sys.stderr) return None ``` ```python if book.get("description"): desc = book["description"] if isinstance(desc, dict): desc = desc.get("value","") log(f"\n 簡介:{str(desc)[:200]}") ``` ```python elif args.cmd == "book-info": info = get_book_details(args.key) if not info: log("❌ 找不到"); return log(f"\n📖 《{info.get('title','?')}》") if info.get("description"): desc = info["description"] if isinstance(desc, dict): desc = desc.get("value","") log(f" {desc[:300]}") ``` ### Technical Analysis Book descriptions and other metadata are retrieved from Open Library and printed directly to standard output. The code truncates descriptions but does not escape Markdown, identify the content as untrusted, or prevent instruction-like natural language from being interpreted by an AI agent. Open Library is a remote, mutable data source. Consequently, the effective text returned by this skill can change after package review. This is not remote payload execution because the response is parsed as JSON and is not evaluated or executed by Python. The relevant risk is indirect instruction hijacking when an agent consumes the output. ### Attack Path 1. An attacker adds or modif ...[truncated 1361 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 (21)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This mismatch is especially concerning because it alleges the skill actually scrapes prices from third-party websites rather than using the declared Open Library API. Undisclosed scraping and a shifted primary purpose from recommendation to wishlist/price tracking create higher risk of policy, privacy, and trust violations, since users are not informed of the real external interactions.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This mismatch is especially concerning because it alleges the skill actually scrapes prices from third-party websites rather than using the declared Open Library API. Undisclosed scraping and a shifted primary purpose from recommendation to wishlist/price tracking create higher risk of policy, privacy, and trust violations, since users are not informed of the real external interactions.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This mismatch is especially concerning because it alleges the skill actually scrapes prices from third-party websites rather than using the declared Open Library API. Undisclosed scraping and a shifted primary purpose from recommendation to wishlist/price tracking create higher risk of policy, privacy, and trust violations, since users are not informed of the real external interactions.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This mismatch is especially concerning because it alleges the skill actually scrapes prices from third-party websites rather than using the declared Open Library API. Undisclosed scraping and a shifted primary purpose from recommendation to wishlist/price tracking create higher risk of policy, privacy, and trust violations, since users are not informed of the real external interactions.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The primary descriptive text and section labels are written in Traditional Chinese, and the README does not indicate that the skill is region-specific or that users may choose another language. Under the policy rule, imposing a specific language without opt-in is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill advertises code-driven functionality that implies file read/write and network access, but it does not declare any explicit tool scope or permissions. This is dangerous because users and hosting systems cannot easily constrain or review what resources the skill may access, increasing the risk of unintended data access or outbound requests.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The description omits an up-front warning that the skill may access external services or perform web fetching. Without clear notice, users may not understand that their queries can trigger outbound requests, which matters for privacy, compliance, and trust, especially given the larger uncertainty about the skill's real implementation.

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 manifest and instructions are presented in Traditional Chinese and the trigger phrases are Chinese-only, which effectively forces a specific language experience. The file does not offer an opt-in language choice or explain that the skill is intentionally region- or locale-specific.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The trigger list contains broad everyday phrases like asking what to read or finding books, which can cause the skill to activate unintentionally in contexts where the user did not explicitly request it. Unintended invocation becomes more dangerous here because the skill also appears to support network and file actions, so accidental activation could lead to undesired requests or local changes.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The module docstring states the tool is a '主題書單生成器' and describes its behavior entirely in Chinese, while the renderer and CLI also emit Chinese-only user-facing content. This imposes a specific language/locale by default with no user opt-in or configuration path, which matches the language-policy violation criteria.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill description explicitly says it provides real-time book search via the Open Library API. In this file, the only network lookup uses DuckDuckGo's HTML search endpoint and extracts snippets with regex, which is materially different from the declared data source and behavior.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This code file contains user-facing natural-language content entirely in Traditional Chinese, including the module description and later CLI help/output strings. Under the policy, forcing a specific language without user opt-in is a locale-policy violation because users are not given any language selection or justification for the constraint.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The manifest describes capabilities beyond recommendation algorithms, including 8 built-in themed lists, live Open Library API search, and wishlist tracking with price monitoring. In this file, the CLI only supports recommend, rate, add-book, and list using local JSON files, with no themed-list provisioning, external API access, wishlist logic, or price monitoring behavior.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The inline naming/comment context says this helper is a Kinokuniya price extractor, and _book also documents source values including kinunya, but the implementation builds a URL for https://www.books.com.tw/product/{isbn}. This is an active contradiction between the function's stated intent and its actual behavior, which can mislead maintainers about which store is being queried.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The export function writes the full wishlist JSON, which includes titles, notes, ratings, and tracking history, to a user-supplied file path. Although the CLI reports success afterward, there is no prior confirmation or warning that this action persists potentially sensitive personal reading data to disk and may overwrite an existing file.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The examples show generating reading lists into local markdown files, but the description does not warn users that running the skill can create or modify files. This is a transparency and safety issue because even benign file output can overwrite content or leave artifacts on the host system without clear user expectation.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

The manifest describes a recommendation engine supporting collaborative filtering, content similarity, bestseller ranking, and tag expansion. This script instead contains hard-coded topical reading lists and, for unknown topics, builds lists from generic web search snippets, which does not match the claimed recommendation mechanisms.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
96% confidence
Finding

The module docstring says it provides '暢銷書榜、書評摘要', which implies bestseller rankings and review-summary functionality. In the actual code, there is no implementation for review retrieval/summarization, and the only list-style feature is Open Library trending data rather than a distinct bestseller list.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

The manifest description centers on recommendation algorithms, live Open Library search, and wishlist/price tracking. This file also creates and writes a persistent cache under the user's home directory, which is additional local-state behavior not mentioned in the description of this search client.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

The top-level documentation states support for four recommendation algorithms: collaborative filtering, content similarity, popular/bestseller, and tag expansion. However, the code defines an additional random_discovery recommender at L235-L240 that is not mentioned in the documentation, creating a smaller but real intent/behavior mismatch.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The docstring and all CLI help and output strings are written in Traditional Chinese, indicating a fixed language experience. There is no indication that the skill is intentionally region-specific or that users can opt into another language, which may violate language/locale policy requirements.

Content

No source excerpt is available for this finding.