Back to skill

Security audit

Paper Style Review

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches its stated thesis-review purpose, but it needs review because its LLM configuration and DOCX/output handling can expose credentials or affect unrelated local files in plausible misuse cases.

Install only after reviewing the LLM endpoint configuration behavior. Use a dedicated empty output directory, avoid untrusted DOCX files, do not let others supply review configs, and use explicit per-endpoint API keys rather than relying on global OpenClaw credentials when processing sensitive theses.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/llm_client.py:283
Finding

API Credential Can Be Disclosed to an Unrelated LLM Endpoint

Content
View full analysis
List[Dict[str, Any]]: if not any(direct.values()): return [] api_base = _normalize_api_base(str(direct.get("apiBase") or "")) api_key = str(direct.get("apiKey") or "").strip() model = str(direct.get("model") or "").strip() if api_base and api_key: return [{ "apiBase": api_base, "apiKey": api_key, "model": model or DEFAULT_MODEL, "resolvedFrom": source, }] if not provider_candidates: candidate = { "apiBase": api_base, "apiKey": api_key, "model": model or DEFAULT_MODEL, "resolvedFrom": source, } return [candidate] if candidate["apiBase"] and candidate["apiKey"] else [] hydrated: List[Dict[str, Any]] = [] for provider_candidate in provider_candidates: provider_api_key = _cfg_str(provider_candidate, "apiKey") if api_key and not api_base and not allow_api_key_override and provider_api_key and provider_api_key != api_key: continue candidate = dict(provider_candidate) if api_base: candidate["apiBase"] = api_base if api_key: candidate["apiKey"] = api_key if model: candidate["model"] = model provider_ref = _cfg_str(candidate, "providerRef") if provider_ref: candidate["modelRef"] = f"{provider_ref}/{model}" candidate["resolvedFrom"] = f"{source} <- {provider_candidate.get('resolvedFrom')}" hydrated.append(candidate) return _dedupe_can ...[truncated 2389 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Error
Location
scripts/inject_word_comments.py:544
Finding

Untrusted DOCX XML Is Parsed Without Explicit Entity and DTD Hardening

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/orchestrators/review_orchestrator.py:88
Finding

Output Cleanup Deletes Unrelated Annotated Documents

Content
View full analysis
List[str]: removed: List[str] = [] candidates = {output_dir / name for name in GENERATED_OUTPUT_FILES} candidates.add(output_dir / f"{target_path.stem}-annotated.docx") for extra_docx in output_dir.glob("*-annotated.docx"): candidates.add(extra_docx) ref_map_dir = output_dir / "style-ref-structure-maps" if ref_map_dir.exists(): for path in sorted(ref_map_dir.glob("*.json")): if path.is_file(): path.unlink() removed.append(str(path.relative_to(output_dir))) for path in sorted(candidates): if path.exists() and path.is_file(): path.unlink() removed.append(path.name) return removed ``` ### Technical Analysis Before starting a review, the cleanup routine enumerates every file matching `*-annotated.docx` in the configured output directory and deletes it. It does not verify that the file was generated by this Skill, belongs to the current target, or appears in a previous-run manifest. The same routine removes all JSON files under `style-ref-structure-maps`. Because `outputDir` is configuration-controlled and resolved as an arbitrary filesystem path, selecting a shared directory can cause deletion of unrelated user files. The `is_file()` check only confirms the filesystem entry type. It does not establish ownership, provenance, or association with the current review operation. ### Attack Path 1. A user or attacker-controlled configuration sets `outputDir` to a shared directory. 2. The directory contains valuable files whose names match `*-annotated.docx` or JSON files under `style-ref-structure-maps`. 3. `run_review()` invokes `_cleanup_previous_o ...[truncated 723 chars]
Remediation
View remediation
///`, instead of sharing one output namespace. 5. Verify that every cleanup candidate resolves beneath the expected run directory before deletion. 6. Reject dangerous output locations such as the filesystem root, the user's home directory, or an existing non-dedicated directory unless explicitly confirmed. 7. Move old output to a quarantine or backup directory rather than immediately unlinking it. 8. Require an explicit cleanup option and provide a dry-run list of files that would be removed. 9. Add tests confirming that unrelated annotated DOCX and JSON files survive cleanup. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • 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
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (70)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

该代码片段的功能非常具体且基础,属于对论文结构数据的章节范围处理辅助模块。它解析诸如章节号、abstract/摘要等 scope token,并据此过滤 outline、paragraphs、section classifications,最后更新 meta 统计信息。代码中没有任何与参考论文风格学习、中文论文内容审校、术语或逻辑一致性分析、格式检查、风格融合、Word 文档操作或批注写回相关的实现。虽然这类章节过滤逻辑可能作为更大审校系统的一个支持性子模块存在,但就本代码片段本身而言,其实际行为与声明的主要用途明显不符,因此应判定为描述与行为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

There is a clear description-behavior mismatch. The declared purpose describes a full-featured Chinese academic proofreading/review system with reference-style learning and Word annotation output. However, the provided code chunk is only an init.py file with a brief docstring, exposing at most a section-level LLM classifier module concept. No code in the chunk supports the declared end-to-end review, formatting/terminology/logic/style fusion, or Word integration. Based on the supplied chunk alone, the actual behavior is materially narrower and different from the declared purpose.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

声明描述的是一个较完整的中文论文审校与批注回写能力链路,包括基于参考论文学习风格、统一结构图谱、进行多维审查,并写回 Word 批注。实际代码则是一个单一职责模块:对已提供的段落按 sectionPath 分组和切包,调用 LLM 输出 sectionExpansionPattern 与 paragraphType,并做结果校验和索引构建。代码注释也明确说明“only performs semantic identity classification”“does not determine physical structure”。它不处理 Word、不做批注写回、不读取参考论文进行风格学习,也不执行格式、术语、逻辑或风格审校。虽然“统一结构图谱”中的一小部分可能需要这种分类结果作为支撑,但该代码块本身的实际功能与声明的主要用途相比明显更窄且不同,因此应判定为描述与行为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

该代码块的主功能与声明存在明显偏差。代码文件名即 format_checker.py,且实现集中在论文格式规范检测:段落字体字号、对齐、行距、前置部分结构、目录、参考文献、图表公式、页边距、页眉页脚以及一致性检查,并输出 issues 和 annotationItems。它确实与“论文审校”大方向相关,也生成可用于批注的数据,因此并非完全无关;但声明中的关键能力——从参考论文学习风格、术语/逻辑/风格融合审查、统一结构图谱、直接回写 Word 批注——在此代码中要么被明确否定,要么根本未实现,要么仅实现了中间产物而非最终动作。因此应判定为描述与实际行为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

声明描述的是一个完整的中文论文审校与 Word 批注写回能力,而给定代码只是一个辅助型数据处理模块:把章节结构展开为可遍历的正文段落清单。它没有读取参考论文、没有进行风格学习或结构统一、没有审校分析、也没有任何 Word 交互或批注写回行为。虽然“结构化审校”可能需要先做段落编目,但这段代码本身的实际主功能明显更窄,且与声明的核心能力存在重大差异,因此应判定为描述与行为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

描述与代码部分重合:代码确实会参考参考论文风格(style_profile/ref_texts/ref_chapters),并执行融合式术语、逻辑、风格审查。但关键功能存在明显不一致。最主要的是,描述声称“将结果回写为 Word 批注”,而该代码只在 output_dir 下写入 JSON 报告,没有任何 Word 文档读写、批注插入或 Office API 调用。其次,描述包含“格式”审查与“统一结构图谱”,但此代码中没有格式检查逻辑,也没有结构图谱统一/生成能力;其“结构”相关行为仅是按 section/chapter 对段落分批。综合看,代码属于论文审查运行时与报告生成模块,但没有实现描述中的若干核心对外能力,因此应判定为描述与实际行为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
87% confidence
Finding

代码总体仍服务于中文论文审校,且确实涵盖术语、逻辑、风格融合审查,与声明主旨大体相关。但该片段的实际职责更偏向 LLM 客户端/分析引擎,而不是完整的“结构化审校并回写 Word 批注”流程。尤其是描述中的关键能力——格式审查、结构图谱统一、Word 批注回写——在此代码中看不到;相反,代码显式实现了未声明的多 provider 配置解析、OpenAI-compatible 网络调用、fallback/retry 等基础设施能力。按“描述是否准确代表代码实际行为”标准,存在明显不一致,属于部分能力缺失与部分未声明能力并存的 mismatch。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

代码与描述有较大重合:它确实从参考论文学习风格、构建结构图谱、生成偏差报告,并可将批注写回 Word。问题在于,声明把能力描述为包含格式/术语/逻辑/风格的融合审查,但本代码块在 run_style_annotation_stage 中调用 run_fused_target_review 时明确设置 enabled_checks={"terminology": False, "logic": False, "style": True},只启用风格检查;也没有看到格式检查在该代码块中被执行。因此,代码实际行为比声明更窄,且“融合审查”这一核心表述与本代码块实际只做风格相关审查不一致。Word 批注导出部分与声明一致,属于匹配能力。综合判断,应标记为描述与实际行为不完全匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

该代码块的职责在文件头和实现中都很明确:建立统一的论文结构事实源,供下游风格学习、风格评价、批注定位使用。它读取目标论文与格式规则,严格识别 1/2/3 级标题,抽取 front matter,构建 outline,生成 paragraph-level 的 physicalPosition 与 positionAnchor,并通过 section_function_classifier 对段落做功能分类,最终输出 structure-anchor-report.json。这与声明中的“执行格式/术语/逻辑/风格融合审查,并将结果回写为 Word 批注”存在明显差异:代码没有执行审校规则、没有比较参考论文风格、没有生成或写回 Word 批注,主要产物也是 JSON 结构图谱而非审校结果。虽然声明里提到“统一结构图谱”,这部分与代码相符,但只是整段声明中的一部分支持能力;代码整体更像审校流水线的前置结构分析模块,而不是完整的论文审校与批注回写技能。因此应判定为描述与实际行为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

声明描述的是一个较完整的论文审校技能,包括从参考论文学习风格、统一结构图谱、对论文进行格式/术语/逻辑/风格融合审查,并把结果写回 Word 批注。该代码块的职责则明显更窄:它是“ref_style_profiler”,专门为参考论文生成 style profile。代码流程集中在加载或构建参考论文 structure map、提取 style units、按 paragraphType 分组、调用 LLM 提取风格机制画像,并输出 style-profile.json 与 ref-style-basis.md。没有任何针对待审论文内容的检查逻辑,没有发现 Word 文档读写或批注接口,也没有实现审校结论生成。因此该代码与声明用途存在实质性不一致;虽然其中“从参考论文学习风格、统一结构图谱”部分相关,但只覆盖了声明中的一个前置子环节,而非所宣称的整体技能。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The declared description promises a comprehensive论文审校 capability with style learning, structural unification, multiple review dimensions, and Word comment write-back. The supplied code chunk does not implement or demonstrate those functions. It only parses CLI arguments, reads configuration, calls run_style_profile_stage, and outputs JSON. While 'style-profile extraction' may relate to learning style from references, the code shown supports only that narrower preprocessing/stage-launch purpose and not the broader declared end-to-end review behavior. Therefore the description materially overstates what this code chunk actually does.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The declared description promises an end-to-end structured Chinese thesis review workflow, including style learning from references, unified structure analysis, substantive review checks, and writing annotations back into Word. The supplied code chunk does not implement those primary behaviors. It defines helper/runtime functions to read a structure-map JSON file, convert paragraph entries into normalized style units, create paragraph anchors, and generate a metadata report. This is consistent with a preprocessing/support module for a larger system, but by itself it materially under-delivers versus the declared purpose. Therefore this chunk is a mismatch with the declared description.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The README presents the skill as reviewing Chinese theses and repeats that it is intended for Chinese-language papers. This is a language-specific constraint presented as the default behavior, but the file does not offer user opt-in or explain a policy justification such as region-specific compliance or dataset limitations.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill advertises a workflow that reads documents, writes outputs, and may invoke networked/LLM-backed review stages, but it does not declare any explicit tool scope or permissions boundaries. In an agent setting, missing scope declarations weakens least-privilege controls and can let the runtime grant broader file, environment, or network access than users expect.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The description and usage text explicitly frame the skill as operating on Chinese papers and present the workflow only in Chinese, which implies a fixed language/locale constraint. The file does not offer user opt-in for other languages or clearly document that this is a justified region- or language-specific tool.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The skill explicitly describes generating annotated documents and injecting Word comments, but it does not prominently warn that user documents may be modified or that new output files will be written. In document-handling agent workflows, silent or insufficiently disclosed modification behavior can lead to loss of trust, accidental overwrite patterns, and unsafe processing of sensitive files.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The JSON metadata sets "language" to "zh-CN", which is a natural-language locale constraint. Under the policy, forcing a specific language without user opt-in or a clearly documented region-specific justification is a reportable issue, and this file provides neither.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This markdown file contains user-facing natural-language instructions solely in Chinese, and it does not indicate that users may choose another language or that the skill is intentionally limited to a Chinese-speaking context. Under the language/locale policy, forcing a specific language without user opt-in can be a policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This JSON file is written entirely in Chinese and encodes institution-specific Chinese formatting requirements, but it provides no indication that the skill is limited to Chinese-language users or that users can opt into this locale. The policy requires either user choice or a clearly documented and justified locale constraint.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The natural-language description is written entirely in Chinese and presents the project defaults in that language without indicating any language choice, opt-in, or region-specific limitation. Under the policy, forcing a specific language without user choice is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

Multiple user-facing description fields and notes in this manifest-style JSON are provided only in Chinese, and the file does not offer an alternative language or indicate that the locale restriction is intentional and justified. This can amount to forcing a specific language on users without opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The file’s natural-language instructions consistently require Chinese-language comprehension and do not provide any user opt-in, alternative language option, or justification that the skill is intentionally region- or locale-specific. This can violate language/locale policy because it implicitly forces a specific language on users.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The manifest-like JSON sets "language": "zh-CN", which imposes a specific language/locale in natural-language configuration. The file does not indicate that this is user-selectable or justified as a region-specific requirement, so it may violate the language/locale policy criteria.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This code file contains natural-language documentation entirely in Chinese, including the primary module description and responsibility notes, with no indication that the language is optional or that the skill is intentionally limited to a Chinese-speaking context. Under the language/locale policy rule, forcing a specific language without user opt-in or clear justification is a policy concern.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

This code sends raw paragraph text to an LLM via call_llm_json, but the file contains no consent, disclosure, minimization, or policy gating before transmitting potentially sensitive thesis content. In this skill context, documents may contain unpublished research, personal data, or confidential material, so silent exfiltration to an external model endpoint is a real privacy and data-handling risk.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.