Back to skill

Security audit

TXT电子书清洗修复

Security checks for vulnerabilities and agentic risk

Overview

This TXT ebook cleaner needs Review because it can search local files, upload book contents to cloud/public URLs, send text through a broad OpenClaw agent, and persist AI-learned rules without strong consent or scoping.

Install only if you are comfortable with the skill searching for TXT files, uploading ebook contents outside the device, using an OpenClaw LLM subagent, and saving learned cleanup rules that affect future files. Prefer an explicit local file path, fast/local-only processing, disabled auto_learn, and only process documents you have rights to modify.

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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
Findings (6)

T01 · Skill Instruction Hijacking

Error
Location
scripts/utils/llm_client.py:166
Finding

Untrusted ebook content is passed directly to the privileged main agent

Content
View full analysis
Remediation
View remediation

T02 · Agent Memory Poisoning

Error
Location
scripts/ai_modules/mojibake_fixer.py:440
Finding

Model-generated mojibake mappings are persisted and applied to future documents

Content
View full analysis
0.9: self._learn_from_fix(ai_result) ``` ```python def _learn_from_fix(self, result: MojibakeFixResult) -> None: """Learn new rules from a repair result.""" for change in result.changes: before = change.get('before', '') after = change.get('after', '') if before and len(before) <= 10: if before not in self.learned_rules: self.learned_rules[before] = after logger.info(f"Learning new rule: '{before}' -> '{after}'") self._save_learned_rules() ``` ```python def _save_learned_rules(self) -> None: rules_file = os.path.join( os.path.dirname(__file__), '..', '..', 'references', 'learned_mojibake_rules.json' ) try: os.makedirs(os.path.dirname(rules_file), exist_ok=True) with open(rules_file, 'w', encoding='utf-8') as f: json.dump(self.learned_rules, f, ensure_ascii=False, indent=2) ``` The persisted rules are later merged into global replacement rules: ```python all_rules = {**mojibake_map, **self.learned_rules} for mojibake, correct in all_rules.items(): if mojibake in fixed_text: fixed_text = fixed_text.replace(mojibake, correct) ``` ### Technical Analysis The learning mechanism trusts the model-provided `changes` array and the model-provided confidence score. It does not verify that: - `before` appeared in the submitted source text; - `after` is a plau ...[truncated 1422 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/ai_enhanced_cleaner.py:67
Finding

The documented fast mode may continue to invoke AI processing

Content
View full analysis
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
SKILL.md:84
Finding

Local documents are unnecessarily uploaded to cloud storage through a URL workflow

Content
View full analysis
Found: /storage/.../Three Body.txt 2. upload_file(fileInfos=[{"mediaUri": "file://docs/..."}]) -> Obtain a public URL 3. curl -o "Three Body.txt" "URL" -> Download into the working directory ``` ### Technical Analysis The cleanup scripts accept ordinary local paths and can read files directly. Uploading the selected file to cloud storage and downloading it again is therefore not necessary for the declared cleanup function. The instructions do not identify the cloud provider, retention period, access-control model, deletion process, or whether the resulting URL is private and short-lived. The example explicitly describes obtaining a public URL. This exceeds the minimum data-transfer privileges needed to clean a local TXT file. ### Attack Path 1. A user asks the Skill to clean a local ebook or other TXT document. 2. The Skill searches the user's device and identifies the selected file. 3. Following `SKILL.md`, it uploads the file to cloud storage. 4. A URL is generated and then passed to `curl`. 5. The document now exists outside the user's local trust boundary and may remain available according to unspecified provider behavior. ### Impact Assessment The primary impact is confidentiality loss. Private documents, annotations, personal writing, or copyrighted content can be disclosed to a cloud provider or anyone able to access the generated URL. No evidence establishes that the URL is securely scoped or that u ...[truncated 47 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/ai_enhanced_cleaner.py:381
Finding

Report path construction can overwrite the cleaned output file

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Note
Location
SKILL.md:76
Finding

Runtime dependencies are installed without version or integrity pinning

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
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (43)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

This finding is especially concerning because it describes a generic prompt-execution path via a local/external agent (openclaw agent) and subprocess invocation, which is far broader than ebook cleanup. That means the skill may act as a general agent wrapper with shell-mediated execution and external interaction, materially increasing risk of command abuse, unintended data exposure, and capability escalation beyond the declared purpose.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

This finding is especially concerning because it describes a generic prompt-execution path via a local/external agent (openclaw agent) and subprocess invocation, which is far broader than ebook cleanup. That means the skill may act as a general agent wrapper with shell-mediated execution and external interaction, materially increasing risk of command abuse, unintended data exposure, and capability escalation beyond the declared purpose.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This finding is especially concerning because it describes a generic prompt-execution path via a local/external agent (openclaw agent) and subprocess invocation, which is far broader than ebook cleanup. That means the skill may act as a general agent wrapper with shell-mediated execution and external interaction, materially increasing risk of command abuse, unintended data exposure, and capability escalation beyond the declared purpose.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The workflow explicitly says files are uploaded to the cloud and processed with AI-enhanced components, but the description does not clearly warn users that ebook contents may leave the device and be sent to external services. This is a significant privacy and consent issue, especially for potentially copyrighted, personal, or sensitive text files, and the risk is amplified by the hidden LLM/agent behavior suggested by other findings.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
94% confidence
Finding

This module launches an external CLI agent to process arbitrary prompts, giving the skill a broad execution and delegation capability that is not justified by the advertised TXT-cleaning purpose. In the context of a narrowly scoped ebook repair skill, spawning a general-purpose local agent expands the attack surface, may expose local data to another toolchain, and can enable unintended capabilities beyond simple text cleanup.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The design adds external LLM/API processing to a skill whose primary purpose is local TXT cleanup, creating a new data-exfiltration path for user-supplied book content. Because the document explicitly configures third-party providers and sends paragraphs, corrupted text, and chapter samples for analysis without strong scope limitation or privacy controls, sensitive or copyrighted content could be transmitted off-device unexpectedly.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The design describes sending text to external LLM APIs for ad detection, mojibake repair, and chapter analysis, but it does not provide a clear user warning or informed-consent step. In this skill context, users reasonably expect local text cleaning; omitting disclosure increases the risk of silent transmission of private, sensitive, or copyrighted material to third-party services.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This markdown file documents AI-enhanced behavior including LLM-based text analysis and 'high-confidence repairs automatically saved as new rules,' but it does not include any warning about potential privacy implications of sending text to an LLM or about persistent modification of rule data. Under the markdown-file criteria, behaviors that could affect user data or privacy should be disclosed to users.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding

The skill describes capabilities that require file access, shell execution, and network transfer, but it does not declare any explicit tool scope or permission boundaries. This creates a hidden-capability problem: reviewers and users cannot easily see what the skill is allowed to do, increasing the chance of over-privileged execution or unsafe invocation paths.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The trigger phrases are broad enough to match ordinary requests about cleaning or fixing text files, which can cause the skill to activate unexpectedly in contexts the user did not intend. Over-broad triggering becomes more dangerous here because the skill also appears to use file access, uploads, shell steps, and AI processing, so accidental activation can expose local content or initiate external processing without clear user intent.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
82% confidence
Finding

This manifest/config file contains user-facing natural-language comments entirely in Chinese, including operational descriptions such as processing modes and feature explanations. Under the policy, forcing a specific language without opt-in or justification is a natural-language locale violation, and no alternative language or opt-in mechanism is documented here.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill is described as a local TXT cleaning/repair tool, but this configuration enables AI enhancement through an LLM subagent provider. That creates a capability mismatch: user book content may be transmitted to another model-backed component, introducing confidentiality and trust-boundary risks that are not obvious from the stated purpose.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

Using an external/provider-backed LLM is not clearly necessary for the advertised TXT repair function, especially when handling potentially copyrighted or sensitive ebook text. If paragraphs are sent to a provider or subagent, users may unknowingly expose local file contents, and the added dependency expands the attack surface beyond simple text cleanup.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The trigger phrases are broad enough to match common requests like '去广告' or '修乱码' without requiring clear TXT/ebook context, which can cause the skill to activate outside its intended scope. In an agent environment, overbroad activation can lead to unintended file discovery or processing on the user's device, especially because the skill supports local file search workflows.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill permits ambiguous fuzzy requests like '清理一本txt' and instructs the agent to search the user's device for candidate files. This expands the skill from acting on a user-specified file to proactively enumerating local files, which increases privacy risk and creates opportunities for unintended activation from vague user language.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The script initializes an LLM client and routes book content through AI modules for ad detection, mojibake fixing, and chapter parsing. That means user-provided text may be transmitted to an external model provider, which is a meaningful data exposure/security behavior not obvious from a simple 'txt cleaner/repair' description.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The cleaning pipeline sends the full text through LLM-backed modules without any clear user-facing warning, consent gate, or privacy notice. Because ebooks and txt files may contain personal notes, proprietary material, or sensitive text, silent network transmission to a third-party provider creates a real confidentiality risk.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The _normalize_punctuation logic automatically converts ASCII punctuation to Chinese punctuation based on Chinese-character context, which imposes a specific locale convention on processed text. The file does not provide any user opt-in, toggle, or documented justification for this language-specific transformation.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The detector sends user book paragraphs to an external LLM service for ad classification, which introduces data exfiltration beyond simple local text cleanup. In this skill context, users are likely supplying full pirated or personal ebook content, so transmitting raw paragraphs off-device creates a real privacy and scope-expansion risk even if the feature is intended for functionality.

Content

No source excerpt is available for this finding.

Ssd 1

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The batch prompt combines multiple untrusted paragraphs in one context, allowing one malicious sample to influence classification of other samples or the format of the whole response. In this skill, the input text is precisely the kind of messy, externally sourced content that may contain adversarial strings, making cross-item prompt contamination more likely.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The batch detection path performs network-backed LLM analysis on paragraph content without this being clearly necessary from the declared skill scope of text cleaning and repair. Because the skill processes ebook text at scale, this can expose substantial user-provided content to a third party and broadens the trust boundary.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This code sends paragraph content to an LLM but contains no visible user-facing warning, consent check, or policy gate near the transmission point. In a text-repair skill, silent remote submission is dangerous because users may reasonably expect local processing of their ebooks and not third-party inspection.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

Single-paragraph detection also transmits raw paragraph text to the LLM, creating the same external data exposure risk as the batch path. Even though only one paragraph is sent at a time, sensitive or copyrighted text can still be disclosed without clear necessity or user awareness.

Content

No source excerpt is available for this finding.

Ssd 1

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

User-controlled paragraph text is inserted directly into the prompt, so a crafted paragraph can contain instruction-like content that attempts to override the ad-classification task or distort the JSON output. This is a real prompt-injection risk because the code trusts a general-purpose LLM to follow the surrounding instructions while processing adversarial text.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The single-paragraph LLM call has the same undisclosed transmission issue and can leak text content outside the local environment. Lack of transparency increases privacy and compliance risk, especially where uploaded books may contain personal annotations or copyrighted material.

Content

No source excerpt is available for this finding.