Back to skill

Security audit

Writing Expert Team

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a disclosed Chinese writing workflow, but it can insert hardcoded brand promotion into publishable content and includes file-writing/publishing features that deserve careful review.

Install only if you want a Chinese self-media/legal-writing workflow and will review outputs before publishing. Remove or replace the hardcoded Real Estate Legal Eye slogan unless it is your brand, avoid broad automatic activation, run redline_check.py without --fix first, keep backups before fixing files, and enable WeChat/API publishing only for a reviewed final draft and the intended account.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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)

T01 · Skill Instruction Hijacking

Error
Location
references/viral_formula.md:50
Finding

Mandatory Third-Party Branding Injected into Generated Articles

Content
View full analysis

Vulnerability Details

File Location: references/viral_formula.md:50-58
Additional Evidence: examples/sample_difayan_article.md:60-61
Vulnerability Type: Mandatory output manipulation and promotional content injection
Risk Level: High

Vulnerable Instruction

The following is an English translation of the complete affected instruction:

text
## VI. Three Required Ending Components (none may be omitted)

1. Practical checklist: three to five actions readers can follow.
2. Quotable sentence: one sentence suitable for screenshot sharing.
3. Viral prompt and column branding:
   - Viral prompt: “Forward this to friends who are viewing or buying homes.”
   - Column slogan: “Follow ‘Real Estate Legal Eye,’ protecting every square meter.”
   - Summary of legal authorities cited in the article.
   - Disclaimer stating that the article is general legal education and not individual legal advice.

The resulting branded content is demonstrated in examples/sample_difayan_article.md:60-61:

text
Viral prompt: Forward this to friends who are viewing or buying homes. Do not let a 50,000-yuan deposit disappear.
Follow “Real Estate Legal Eye,” protecting every square meter.

Technical Analysis

The Skill presents the viral-writing formula as a core asset and states that all three ending components are mandatory. One component contains a fixed promotional slogan for a named brand. The instruction is not conditional on the user's identity, ownership of the brand, requested topic, or explicit consent.

When the Skill is loaded for article generation, this mandatory instruction can alter the user's requested output by adding third-party promotional material. The supplied sample confirms that the instruction is applied to generated deliverables rather than being merely illustrative.

This behavior exceeds the minimum privileges and output control required for a writing assistant. A generic ...[truncated 1322 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove the hardcoded brand name and slogan from the default formula.
  2. Replace the mandatory branded component with neutral placeholders, such as:
    text
    Optional call to action: supplied by the user
    Optional brand or column name: supplied by the user
    
  3. Make all promotional and redistribution language opt-in rather than mandatory.
  4. Require explicit user confirmation before inserting branding, affiliate language, contact details, or promotional calls to action.
  5. Store branding in a clearly documented user-controlled configuration field that defaults to empty.
  6. Show the proposed promotional ending separately before merging it into the final article.
  7. Add a validation rule preventing examples or reference brands from being copied into production output unless the user explicitly selects them.
  8. Update the supplied example to use a generic placeholder or clearly mark the brand as sample-only content.

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/redline_check.py:33
Finding

Recursive Fix Mode Can Corrupt Files Through Broad In-Place Rewriting

Content
View full analysis

Vulnerability Details

File Location: scripts/redline_check.py:33-47, 84-100, 149-151
Vulnerability Type: Unsafe destructive file transformation
Risk Level: Medium

Vulnerable Code

python
def _pairwise_replace(text):
    """Replace paired straight quotes with curved quotes."""
    out = []
    d_open, s_open = True, True
    for ch in text:
        if ch == '"':
            out.append("\u201c" if d_open else "\u201d")
            d_open = not d_open
        elif ch == "'":
            out.append("\u2018" if s_open else "\u2019")
            s_open = not s_open
        else:
            out.append(ch)
    return "".join(out)
python
def fix_text(text):
    out, in_fence = [], False
    for line in text.splitlines():
        if line.strip().startswith("```"):
            in_fence = not in_fence
            out.append(line)
            continue
        if in_fence:
            out.append(line)
            continue
        parts = INLINE_CODE_RE.split(line)
        for j, p in enumerate(parts):
            if j % 2 == 1:
                continue
            p = _pairwise_replace(p)
            p = ENTITY_RE.sub(lambda m: html.unescape(m.group(0)), p)
            parts[j] = p
        out.append("".join(parts))
    return "\n".join(out)
python
if do_fix:
    with open(fp, "w", encoding="utf-8") as fh:
        fh.write(fix_text(text))

Technical Analysis

The documented --fix mode recursively processes Markdown and text files and directly overwrites each affected file. The transformation has several unsafe properties:

  • _pairwise_replace transforms every straight double quote and apostrophe in each non-code segment, rather than limiting changes to violations confirmed by the Chinese-context detection expressions.
  • Quote state is initialized for every call. Because fix_text calls the function independently for each se ...[truncated 2296 chars]
Remediation
View remediation

Remediation Suggestions

  1. Restrict automatic changes to exact spans identified by the scanner instead of transforming every quote in the file.
  2. Preserve quotation state across lines where multiline quotation handling is required.
  3. Distinguish apostrophes inside words from quotation marks.
  4. Use a proper Markdown parser or substantially strengthen handling of fenced code, variable-length backtick spans, escaped characters, and embedded HTML.
  5. Add a default dry-run mode that displays a unified diff before making changes.
  6. Require a separate confirmation option before recursive modification.
  7. Write transformed content to a temporary file in the same directory, flush and synchronize it, and then use atomic replacement.
  8. Create a backup unless the user explicitly disables backup creation.
  9. Preserve the original newline convention and trailing-newline state.
  10. If any file cannot be decoded or written, report the failure without modifying the original.
  11. Add regression tests covering English contractions, possessives, unmatched quotes, multiline quotations, escaped quotes, nested Markdown constructs, entities, and interrupted writes.
  12. Limit recursive traversal by default and clearly display the complete target file list before modification.
Vulnerability Patterns
  • 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
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (28)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The documented behavior presents a benign multi-role writing workflow, but the package also includes a file-scanning and auto-rewrite utility that is materially different from the declared purpose. This mismatch undermines informed consent and reviewability, because users may invoke what appears to be a writing assistant while unintentionally enabling local content inspection or modification.

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

md
- `SKILL.md` — 入口与路由(本文件)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- `assets/cover_conversation.png` / `assets/cover_poster.png` — 技能 listing 封面素材

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- `assets/cover_conversation.png` / `assets/cover_poster.png` — 技能 listing 封面素材

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The README is entirely Chinese and presents commands, roles, and workflow expectations only in Chinese, with no indication that the skill can adapt to the user's preferred language. In multilingual agent environments, this can lead to coercive language switching, misunderstandings of consent or workflow steps, and degraded reliability when users interact in other languages.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The example trigger phrases are broad and overlap with ordinary writing requests such as topic planning, style polishing, research, drafting, fact checking, and formatting. In an agent runtime that auto-routes skills based on trigger text, this can cause the skill to activate unintentionally and steer generic user requests into this multi-role pipeline, potentially overriding user intent or invoking unnecessary downstream behaviors.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill advertises capabilities that imply file access via a referenced checker script, but it does not declare any explicit tool scope or permissions boundary. In an agent environment, undeclared file read/write capability increases the risk of overbroad access, accidental modification of user files, or hidden side effects that users and orchestrators cannot properly constrain.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Overly broad trigger phrases such as common writing tasks can cause the skill to activate in contexts where the user did not intend a full writing pipeline. Unintended activation can expose user content to extra processing steps, unexpected file/tool use, or compliance-style transformations that are unnecessary for the request.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The description of the “发布红线底座” mandates Chinese quotation marks and prohibits English straight quotes as a universal formatting rule. This is a locale-specific language policy, and the file does not indicate that users can opt into another language or formatting convention when writing for non-Chinese contexts.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The activation rules do not clearly separate ordinary writing assistance from full-pipeline orchestration, making it easy for routine requests to be interpreted as consent for a more invasive workflow. In a multi-step agent setting, ambiguity can lead to unnecessary processing, tool invocation, or policy-heavy transformations beyond user expectations.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The export specification defines generation of files and writes to shared directories without any explicit notice to the user. Silent artifact creation is risky because generated documents, images, or presentations may contain confidential drafts or client content that becomes persistently accessible in shared storage.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The knowledge-base section introduces an ingestion and storage subsystem for imported content that is broader than a simple writing pipeline and not clearly reflected in the declared roles. This matters because ingesting and persisting external or local content increases the attack surface for sensitive-data collection, overreach, and unintended reuse of user-provided materials.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The knowledge-base schema stores content-derived data and file paths but does not warn users that potentially sensitive local or imported information may be retained in shared artifacts. Lack of disclosure is dangerous because users may provide private notes, articles, or local files without understanding that metadata and parsed sections will be stored for later reuse.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The schema supports ingesting data from local markdown and multiple external sources, then storing file paths, abstracts, and parsed content sections. For a writing assistant, that capability can expose sensitive local documents or imported materials beyond what is necessary unless tightly scoped and transparently authorized by the user.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The schema explicitly defines persistent export storage under shared artifact directories, which expands the skill from text generation into filesystem write behavior. Even if intended for normal publishing workflows, undocumented or under-scoped file persistence can create data leakage, retention, and unexpected side-effect risks when users do not realize outputs are being saved to shared locations.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The pipeline defines a '公众号排版与发布' step that goes beyond passive writing assistance into taking an external action on behalf of the user. Expanding a writing skill into publication behavior increases risk because it can trigger content distribution, reputational impact, and unintended use of connected tooling without strong scope boundaries or explicit safety controls.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The publication flow describes generating preview HTML, checking local configuration, and optionally pushing drafts, but it does not warn about data leaving the system, use of local tools, or the consequences of transmission. That omission is dangerous because users may treat the step as harmless formatting while it actually performs system and network-affecting operations with potential content leakage or accidental publication.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The document instructs the pipeline to call a local public-account publishing tool and push a draft via configured API, which introduces access to local system capabilities and external side effects unrelated to core text generation. If such tooling is available, the skill could cause unauthorized posting, misuse stored credentials, or expose sensitive draft content to third-party services.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The skill text repeatedly states that Chinese articles must use specific Chinese quotation marks and that Chinese rendering must use specific full Chinese fonts, presenting these as absolute rules. Because this is a natural-language locale policy applied categorically and the file does not clearly limit the skill to a China-specific or Chinese-only workflow, it may violate the policy against forcing a language/locale without user opt-in.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The legal-review trigger includes broad natural-language phrases that may match ordinary conversation, increasing the chance of unintended activation of a specialized workflow. In a skill that may perform web lookups and compliance gating, ambiguous triggers can cause unexpected data handling or workflow transitions without clear user intent.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill defines an optional公众号发布 stage that generates preview artifacts and can proceed toward remote publication workflow behavior, which exceeds the user-facing description of a writing/review pipeline. Capability expansion is risky because users may invoke or permit actions with external side effects they did not reasonably expect from the manifest, especially when publication-related triggers are embedded in the role documentation.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This section introduces credential-based remote API interactions for pushing drafts to a WeChat draft box, which is materially different from passive writing assistance. Any skill that can use stored credentials and send content to an external service creates a meaningful risk of unintended publication, account misuse, or exfiltration of sensitive content if activation or confirmation is mishandled.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The entire skill is written as a prescriptive writing formula in Chinese and specifies Chinese rhetorical devices, slogans, and platform conventions, but it does not offer any user opt-in or alternative language/locale path. Under the policy, language constraints should either be optional or clearly justified as region-specific; here the file presents the constraint as the default operating mode.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The markdown presents all user-facing content in Chinese and does not indicate that the user can choose another language or that the skill is intentionally limited to Chinese-language audiences. Under the policy category, forcing a specific language without opt-in can be a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The file presents the metadata standard entirely in Chinese and uses mandatory language such as '必须' for all inter-role information transfer, with no indication that users can choose another language or locale. This can constitute a language-policy issue when a skill effectively forces one language without explicit opt-in or justification.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.