Back to skill

Security audit

libai-skill

Security checks for vulnerabilities and agentic risk

Overview

This is a Chinese rewriting tool, but it deserves review because it is built to hide AI-authorship cues and includes unsafe shell guidance plus automatic insertion of first-person phrases.

Review carefully before installing. Use this only for transparent style editing where AI assistance may be disclosed, not for academic, compliance, authorship-sensitive, or review-evasion submissions. Do not let an agent run the documented shell command with raw user text; use stdin or a safe file path instead. Inspect rewritten output because it may add personal-sounding claims that were not in the original.

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
SKILL.md:107
Finding

Agent Shell Guidance Can Cause Command Injection Through Untrusted Input

Content
View full analysis
`: ```text python scripts/detect.py --json ``` However, the CLI defines the positional argument as a file path: ```python parser.add_argument( "input", nargs="?", help="Input file path (reads from stdin if omitted)" ) ``` It subsequently reads that argument as a file: ```python if args.input: try: text = read_file(args.input) return text, args.input ``` ### Technical Analysis The Skill directs an Agent with Shell permission to place user-controlled text directly into a shell command. It does not require quoting, escaping, stdin transport, an argument-array API, or `shell=False`. If an Agent follows this instruction by constructing a command string, shell metacharacters contained in the supplied text can be interpreted by the shell rather than passed as literal text. Relevant metacharacters include command substitutions, separators, redirections, and pipelines. There is also a functional mismatch: `scripts/detect.py` expects its positional argument to be a file path, not raw text. Consequently, ordinary input may fail as a nonexistent filename, while malicious input can become shell syntax before the Python process receives it. Exploitation depends on the hosting Agent implementing the instruction through an actual shell and interpolating the input without safe argument handling. ### Attack Path 1. An attacker submits text for analysis or rewriting through a trigger supported by the Skill. 2. The tex ...[truncated 1032 chars]
Remediation
View remediation

other

Warning
Location
scripts/rewrite.py:619
Finding

Rewrite Pipeline Automatically Injects Fabricated First-Person Statements

Content
View full analysis
= 5: import random as _random chosen = _random.sample(all_phrases, min(2, len(all_phrases))) sentences = get_sentences(text) if len(sentences) >= 4: idx = _random.randint(1, len(sentences) - 2) injection = chosen[0] sentences[idx] = injection + ',' + sentences[idx] text = ''.join(sentences) ``` The default cleanup configuration does not define `inject_human_voice`: ```json "post_cleanup": { "remove_empty_lines": true, "remove_leading_comma": true, "remove_double_spaces": true, "fix_broken_sentences": true, "fix_duplicate_commas": true, "fix_trailing_punctuation": true, "fix_space_after_punctuation": true, "strip_orphan_punctuation": true, "strip_residual_markdown": true, "fix_common_phrases": true, "fix_pattern_residue": true, "clean_trailing_clutter": true } ``` Because `cfg.get('inject_human_voice', True)` defaults to `True`, the injection runs without explicit user opt-in. The bundled phrase bank contains statements equivalent to: - “I also encountered pitfalls with this.” - “I was stunned at the time.” - “I have a ...[truncated 2644 chars]
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (48)

Tp2

High
Category
MCP Tool Poisoning
Confidence
85% confidence
Finding

Mixing characters from multiple Unicode scripts in a single identifier is a common technique to create visually ambiguous tool names.

Content

No source excerpt is available for this finding.

Tp2

High
Category
MCP Tool Poisoning
Confidence
85% confidence
Finding

Mixing characters from multiple Unicode scripts in a single identifier is a common technique to create visually ambiguous tool names.

Content

No source excerpt is available for this finding.

Tp2

High
Category
MCP Tool Poisoning
Confidence
85% confidence
Finding

Mixing characters from multiple Unicode scripts in a single identifier is a common technique to create visually ambiguous tool names.

Content

No source excerpt is available for this finding.

Tp2

High
Category
MCP Tool Poisoning
Confidence
85% confidence
Finding

Mixing characters from multiple Unicode scripts in a single identifier is a common technique to create visually ambiguous tool names.

Content

No source excerpt is available for this finding.

Tp2

High
Category
MCP Tool Poisoning
Confidence
85% confidence
Finding

Mixing characters from multiple Unicode scripts in a single identifier is a common technique to create visually ambiguous tool names.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

描述强调的是“润色专家”“去AI味”“AI改写”等主动改写能力,核心承诺是把文本转换为自然流畅的人类文笔。然而提供的代码块仅包含 analyzer.py,功能集中在规则加载、统一正则匹配、句子级分类计数、分数加权、AI概率与等级计算,以及输出 DetectionReport。这说明其主要用途是分析/检测,而非重写/润色。描述中提到的检测部分与代码一致,但最关键的主功能——消除痕迹、改写文本、注入人味、质控输出——在该代码中完全未体现,因此属于实质性描述-行为不符。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

声明的核心能力是‘检测并消除中文文本中的AI生成痕迹’,重点在改写、润色、人味注入和最终输出可通过人工审查的文本。但代码仅调用 AIDetector 对文本进行检测,生成统计报告、分类明细、可疑句列表,以及JSON/score-only输出;参数说明中还明确写着“Detect AI patterns in text (no rewriting)”。因此其主要目的与实际行为都更接近‘AI痕迹检测器’,而不是‘润色专家/去AI改写器’。虽然声明中包含‘检测’,但去除痕迹和改写才是描述的关键价值,而这部分完全未实现,属于实质性描述-行为不一致。

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill explicitly aims to remove AI-generation traces so text can pass human review, which facilitates deception about authorship and provenance. In context, this is more dangerous because the entire workflow is optimized for concealment rather than transparent editing, enabling academic, compliance, moderation, or fraud-related abuse.

Content

No source excerpt is available for this finding.

Ssd 4

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The multi-step rewrite workflow systematically teaches concealment tactics, such as deleting common AI markers, injecting pseudo-human details, and reshaping structure to appear less machine-generated. In context, this is not neutral editing guidance; it is a procedural framework for defeating detection and misleading reviewers about authorship.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The manifest describes a polishing skill that removes AI traces and transforms machine-written Chinese into natural human prose, but this file only analyzes text and emits an AI-detection report or score. It performs no rewriting, no humanization, and no text transformation, so the implemented behavior materially differs from the advertised skill purpose.

Content

No source excerpt is available for this finding.

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · scripts/rules.py (reported line 282)May include surrounding context.

python
f"Continuing with main rules only."
            )
    
    return RuleSet(data)


# Whitelist of allowed keys for user-supplied rules (must match RuleSet properties)

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · scripts/rules.py (reported line 328)May include surrounding context.

python
f"Continuing with main rules only."
            )
    
    return RuleSet(data)


# Whitelist of allowed keys for user-supplied rules (must match RuleSet properties)

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The quickstart exposes very broad natural-language trigger phrases such as '去AI味' and '帮我把这篇论文改成更自然的表达' without clear limits on when the skill should or should not activate. In an agent environment, this can cause over-broad invocation on sensitive or unintended content, including academic or compliance-relevant text, increasing the risk of misuse for concealment or policy evasion.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The title and description specify the skill as a Chinese text polishing expert focused on Chinese-language content, but there is no indication that users can opt into another language or that the locale restriction is explicitly justified. Under the policy, forcing a specific language without user opt-in can be a natural-language policy violation.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger list is broad and includes generic terms like “润色” and “改写,” which are likely to appear in ordinary conversation and may activate the skill unintentionally. Unintended activation can cause the agent to override the user’s intended workflow, transform text without explicit consent, or route sensitive content into a rewriting pipeline unexpectedly.

Content

No source excerpt is available for this finding.

Ssd 2

Medium
Category
Not specified by scanner
Confidence
99% confidence
Finding

The skill is explicitly designed to help text evade AI-origin detection through paraphrased humanization. That is dangerous because it supports deliberate concealment of machine authorship, undermines provenance controls, and can be used to bypass academic, editorial, platform, or policy safeguards.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The skill requests powerful tools including Shell, Edit, and Write, but the user-facing description does not clearly warn that it may execute local commands or modify files. This increases the chance of unexpected system changes, especially when combined with automatic precheck and output-writing steps in a skill that users may assume is text-only.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The instructions direct the agent to run a local Python script via shell without an explicit user warning or confirmation. That creates avoidable execution risk because a user invoking a writing skill may not expect code execution, and any local script execution broadens the attack surface to script tampering or unintended host effects.

Content

No source excerpt is available for this finding.

Whitespace Padding

Medium
Category
Prompt Injection
Confidence
70% confidence
Finding

Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.

Content

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

md
### 2.1 改写入口——四步排雷法(必须执行)

| 步骤         | 操作     | 方法                                                                                                         |
| ------------ | -------- | ------------------------------------------------------------------------------------------------------------ |
| **1 搜黑话** | 全局搜索 | 找「赋能/闭环/底层逻辑/深刻/交织/画卷/交响乐/总而言之/综上所述」。搜到一个,用具体名词/动词替换一个。        |
| **2 切长句** | 拆定语   | 把所有「的」字超长定语(3 个「的」以上)从「的」字处切断。删「在……的过程中」「进行了……的讨论」等翻译腔框架。 |

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The skill instructs writing multiple output files to an output directory without clearly warning the user that files will be created or overwritten. This can lead to unexpected filesystem modification and makes the skill riskier than a normal text-only editing workflow.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The FAQ states '非中文文本——本技能专为中文设计', which imposes a language constraint in natural language. Under the policy, forcing a specific language is only acceptable when the locale constraint is clearly documented and justified as region- or compliance-specific; here it is presented as a product limitation without offering user choice or opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The title explicitly defines the file as a Chinese banned-words and sentence-pattern list, and the document consistently imposes mandatory Chinese stylistic constraints. Because the guidance is framed as universal rules rather than an optional mode or region-specific setting, it forces a specific language/locale without user opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The title and throughout-file instructions are explicitly framed as Chinese rewriting guidance (e.g., '中文去AI味高级改写示例'), which semantically constrains the skill to Chinese without any user opt-in or alternative locale handling. Under the policy, forcing a specific language is a natural-language policy violation unless the locale restriction is clearly justified or optional.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The heading '中文去AI味改写示例库' frames the skill content as specifically Chinese-language rewriting, and the rest of the file consistently presents the behavior only in Chinese. Under the policy, forcing a specific language without user opt-in can be a locale/language policy violation unless a justified region-specific constraint is documented, which is not present here.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The title explicitly frames the content as a Chinese-only structure checklist ("中文 AI 味结构性问题清单"). This is a natural-language locale constraint, and the file does not offer any user opt-in, alternative language option, or justification for why Chinese is required.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.