Back to skill

Security audit

Writing Style Skill

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent self-improving writing-style tool, but it stores full drafts and can automatically rewrite its own instructions, so it needs careful review before install.

Install only if you are comfortable with full drafts and final edits being stored on disk and possibly sent through your configured LLM CLI. Avoid using it on confidential, regulated, credential-containing, or client material unless you first add redaction, retention, and explicit approval controls. Do not run auto mode unattended; review proposals and diffs before allowing SKILL.md to be changed.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (3)

T01 · Skill Instruction Hijacking

Error
Location
scripts/improve.py:153
Finding

Persistent Skill Poisoning Through Untrusted Document Content

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/observe.py:118
Finding

Plaintext Retention and External Processing of Complete User Documents

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
README.md:16
Finding

Execution of an Unpinned Mutable Package During Installation

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (31)

Lp1

High
Category
MCP Least Privilege
Confidence
96% confidence
Finding

The script has shell/process-execution capability via subprocess.run, but that power is not clearly declared for a writing-style skill. In this context, undeclared process execution is more dangerous because users expect text-style assistance, not launching external binaries based on local availability or environment settings.

Content

No source excerpt is available for this finding.

Lp1

High
Category
MCP Least Privilege
Confidence
96% confidence
Finding

The script has shell/process-execution capability via subprocess.run, but that power is not clearly declared for a writing-style skill. In this context, undeclared process execution is more dangerous because users expect text-style assistance, not launching external binaries based on local availability or environment settings.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

Allowing IMPROVE_LLM_CMD to specify an arbitrary executable is an unjustified capability for this skill’s stated purpose and effectively creates a generic command runner. In agent environments, this can be chained into arbitrary code execution, persistence, or exfiltration under the user account.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script sends logged original/final content, account metadata, and part of the current SKILL.md to external LLM tooling without a clear consent or disclosure step. These inputs may contain sensitive user data, proprietary text, or internal instructions, making silent transmission a meaningful privacy and security issue.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

Automatic mode extracts suggestions from logs and then applies P0 changes to SKILL.md without explicit user confirmation. This creates an unsafe self-modifying pipeline where untrusted or manipulated content can cause persistent changes to the skill configuration without a human review gate.

Content

No source excerpt is available for this finding.

Ssd 3

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The original-submission logger writes full content plus context such as account and content type to a local JSONL file. This is a concrete sensitive-data retention issue because users may submit confidential drafts, credentials, personal information, or business data, all of which become readable to anyone with filesystem access.

Content

No source excerpt is available for this finding.

Ssd 3

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The final logger embeds both original_content and final_content verbatim in the log entry, doubling sensitive text storage and centralizing it in a single artifact. This raises the chance of privacy breaches, insider disclosure, and unnecessary replication of regulated or proprietary material.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The README explicitly describes recording AI drafts and user-edited final content, then sending diffs to an LLM for rule extraction, but it does not warn users about privacy, retention, or sensitive-data handling. This creates a real risk that users will process confidential drafts or edits through local logs and external model tooling without informed consent or sanitization. In a writing-style skill, this is more dangerous because users are likely to feed it real documents, emails, or internal text that may contain sensitive information.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill explicitly describes an automated workflow that writes learned rules back into SKILL.md and highlights auto-apply behavior, but it does not clearly require an explicit user confirmation before modifying repository files. In an agent setting, self-modifying prompt/config files can create integrity and persistence risks, especially if changes accumulate silently or are later used as trusted instructions.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill instructs recording the original AI draft and the final human-edited version, which can capture sensitive user content and revision history, yet it does not present a clear privacy notice, retention policy, or consent mechanism. This creates a data-handling risk because personal, confidential, or proprietary text may be stored on disk and later processed by automation or external LLM tooling.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The natural-language interface exposed in the module docstring, including description, usage notes, and environment variable explanations, is exclusively Chinese. There is no indication that the skill is region-specific or that users can select another language, which can violate language/locale choice expectations.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill presents itself as a reusable writing-style template, but it executes external LLM CLIs and sends edit logs plus SKILL.md content for analysis and rewriting. That is a significant behavioral expansion and a data-transfer action that users may not expect from the description alone.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/improve.py (reported line 132)May include surrounding context.

python
]
    for cmd in candidates:
        try:
            result = subprocess.run(cmd, input=prompt, capture_output=True,
                                    text=True, timeout=timeout)
            if result.returncode == 0 and result.stdout.strip():
                return result.stdout.strip()

Tainted flow: 'prompt' from os.environ.get (line 296, credential/environment) → subprocess.run (code execution)

Medium
Category
Data Flow
Confidence
65% confidence
Finding

Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.

Content

Scanner excerpt · scripts/improve.py (reported line 132)May include surrounding context.

python
]
    for cmd in candidates:
        try:
            result = subprocess.run(cmd, input=prompt, capture_output=True,
                                    text=True, timeout=timeout)
            if result.returncode == 0 and result.stdout.strip():
                return result.stdout.strip()

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
98% confidence
Finding

The script executes a command sourced from the IMPROVE_LLM_CMD environment variable, giving whoever controls the environment the ability to run arbitrary programs. In an agent or automation context, this expands the skill from 'writing-style improvement' into unrestricted command execution and can be abused for code execution or exfiltration.

Content

Scanner excerpt · scripts/improve.py (reported line 143)May include surrounding context.

python
custom_cmd = os.environ.get("IMPROVE_LLM_CMD")
    if custom_cmd:
        try:
            result = subprocess.run(custom_cmd.split(), input=prompt,
                                    capture_output=True, text=True, timeout=timeout)
            if result.returncode == 0 and result.stdout.strip():
                return result.stdout.strip()

Tainted flow: 'prompt' from os.environ.get (line 296, credential/environment) → subprocess.run (code execution)

Medium
Category
Data Flow
Confidence
97% confidence
Finding

This path combines two risks: attacker-controlled command selection via IMPROVE_LLM_CMD and transmission of prompt data into that command. If the environment is influenced by another component, the skill can be turned into an arbitrary launcher that also feeds it potentially sensitive content.

Content

Scanner excerpt · scripts/improve.py (reported line 143)May include surrounding context.

python
custom_cmd = os.environ.get("IMPROVE_LLM_CMD")
    if custom_cmd:
        try:
            result = subprocess.run(custom_cmd.split(), input=prompt,
                                    capture_output=True, text=True, timeout=timeout)
            if result.returncode == 0 and result.stdout.strip():
                return result.stdout.strip()

Ssd 3

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill feeds raw edit logs, including original/final content and account metadata, directly into an LLM prompt. This can disclose sensitive user content and also enables prompt-injection-style manipulation because untrusted logged text is embedded wholesale into later model instructions.

Content

No source excerpt is available for this finding.

Tainted flow: 'backup_path' from os.environ.get (line 269, credential/environment) → shutil.copy2 (file write)

Medium
Category
Data Flow
Confidence
65% confidence
Finding

Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.

Content

Scanner excerpt · scripts/improve.py (reported line 270)May include surrounding context.

python
return None
    name = f"SKILL-{datetime.now().strftime('%Y%m%d-%H%M%S')}.md"
    backup_path = backup_dir / name
    shutil.copy2(target, backup_path)
    print(f"📦 备份: {backup_path}")
    return backup_path

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

Applying a proposal overwrites the target SKILL.md with model-produced content without an explicit confirmation step. Even though there is a backup, users can still suffer silent corruption, prompt-injection persistence, or policy drift if they do not review what the model generated.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The merge step asks the model to reproduce a complete updated SKILL.md while providing the full proposal and current SKILL.md. This encourages unnecessary reproduction of embedded content and increases the chance that malicious or irrelevant text from proposals persists into the final file.

Content

No source excerpt is available for this finding.

Tainted flow: 'updated' from os.environ.get (line 312, credential/environment) → pathlib.Path.write_text (file write)

Medium
Category
Data Flow
Confidence
95% confidence
Finding

The script writes LLM-generated output directly over the target SKILL.md without validation or mandatory approval. Because the generated content is influenced by log data and proposal text, prompt injection or malformed output can silently corrupt the skill, insert unsafe instructions, or destroy prior configuration.

Content

Scanner excerpt · scripts/improve.py (reported line 317)May include surrounding context.

python
print("❌ 合并失败")
        return

    target.write_text(updated)

    new_content = proposal_content.replace(
        "status: pending",

Tainted flow: 'emergency' from os.environ.get (line 374, credential/environment) → shutil.copy2 (file write)

Medium
Category
Data Flow
Confidence
65% confidence
Finding

Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.

Content

Scanner excerpt · scripts/improve.py (reported line 375)May include surrounding context.

python
# 保存当前版本
    if target.exists():
        emergency = backup_dir / f"SKILL-pre-rollback-{datetime.now().strftime('%Y%m%d-%H%M%S')}.md"
        shutil.copy2(target, emergency)

    shutil.copy2(latest, target)
    print(f"✅ 已回滚到: {latest.name}")

Tainted flow: 'latest' from os.environ.get (line 371, credential/environment) → shutil.copy2 (file write)

Medium
Category
Data Flow
Confidence
65% confidence
Finding

Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.

Content

Scanner excerpt · scripts/improve.py (reported line 377)May include surrounding context.

python
emergency = backup_dir / f"SKILL-pre-rollback-{datetime.now().strftime('%Y%m%d-%H%M%S')}.md"
        shutil.copy2(target, emergency)

    shutil.copy2(latest, target)
    print(f"✅ 已回滚到: {latest.name}")

Ssd 3

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The script's stated purpose is to record original and final content for later analysis, which establishes intentional persistent retention of natural-language data. In this skill context, that is more dangerous because writing workflows commonly involve unpublished drafts, client material, or personal text, and the feature is presented as a reusable template without strong safeguards.

Content

No source excerpt is available for this finding.