Back to skill

Security audit

Smart Prompt Builder

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly builds writing prompts locally, but a bundled alternate script can send your writing context and style files to Aliyun’s LLM service without clear disclosure.

Use the documented local build_prompt.py path for local-only prompt construction. Do not run build_prompt_llm.py with private manuscripts, personal data, proprietary style guides, or secrets unless you intentionally want that data sent to Aliyun DashScope and trust that provider. Review and pin dependencies before installing in a sensitive environment.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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)

other

Warning
Location
scripts/build_prompt_llm.py:67
Finding

Undisclosed Transmission of User-Supplied Writing Data to an External LLM Service

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Note
Location
scripts/requirements.txt:1
Finding

Incomplete and Unbounded Dependency Declaration

Content
View full analysis
=12.0.0 ``` ### Technical Analysis The dependency manifest declares only `rich`, even though both Python scripts import `yaml` from PyYAML and `scripts/build_prompt_llm.py` additionally imports `requests`. The documented installation command instructs users to install this incomplete manifest, so a clean environment will not receive all required direct dependencies. The declaration also permits any future version of `rich` greater than or equal to 12.0.0. This makes installations non-reproducible and allows future incompatible or compromised releases to be selected automatically. No malicious, typosquatted, or untrusted package source was found in the reviewed project; the risk arises from omission and insufficient version control rather than a confirmed malicious package. ### Attack Path 1. A user follows the documented command to install `scripts/requirements.txt`. 2. The package installer resolves an arbitrary currently available `rich` version satisfying `>=12.0.0`. 3. PyYAML and `requests` are not installed by the manifest. 4. Execution either fails due to missing modules or relies on undeclared packages already present in the environment. 5. The user may install missing packages manually without project-defined version constraints, further reducing reproducibility and dependency review coverage. 6. A future incompatible or compromised release satisfying the open-ended constraint could be selected during a later installation. ### Impact Assessment The immediate impact is primarily availability and deployment reliability: clean installations can fail because required modules are absent. The open-ended version range also expands the supply-chain exposure window and can introduce unreviewed behavior in future environments. No direct privilege escalation, m ...[truncated 310 chars]
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
Findings (18)

Tainted flow: 'headers' from os.environ.get (line 68, credential/environment) → requests.post (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/build_prompt_llm.py (reported line 92)May include surrounding context.

python
transient=True,
    ) as progress:
        progress.add_task("building", total=None)
        response = requests.post(url, headers=headers, json=payload, timeout=60)

    response.raise_for_status()
    data = response.json()

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/build_prompt.py (reported line 109)May include surrounding context.

python
注入风格后的提示词
        """
        if not self.style_config:
            return prompt

        style_parts = []

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/build_prompt.py (reported line 136)May include surrounding context.

python
注入风格后的提示词
        """
        if not self.style_config:
            return prompt

        style_parts = []

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 · SKILL.md (reported line 47)May include surrounding context.

md
智能提示构建器 (LLM 版本) - 通过 LLM 构建高质量写作提示词

Usage:
    python3 build_prompt_llm.py --scene-type description --output prompt.json
    python3 build_prompt_llm.py --scene-type dialogue --style-file style.yml --context '{"scene": "雨夜"}' --output prompt.json
"""

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 · SKILL.md (reported line 177)May include surrounding context.

md
智能提示构建器 (LLM 版本) - 通过 LLM 构建高质量写作提示词

Usage:
    python3 build_prompt_llm.py --scene-type description --output prompt.json
    python3 build_prompt_llm.py --scene-type dialogue --style-file style.yml --context '{"scene": "雨夜"}' --output prompt.json
"""

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/README.md (reported line 85)May include surrounding context.

md
智能提示构建器 (LLM 版本) - 通过 LLM 构建高质量写作提示词

Usage:
    python3 build_prompt_llm.py --scene-type description --output prompt.json
    python3 build_prompt_llm.py --scene-type dialogue --style-file style.yml --context '{"scene": "雨夜"}' --output prompt.json
"""

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/build_prompt.py (reported line 417)May include surrounding context.

python
智能提示构建器 (LLM 版本) - 通过 LLM 构建高质量写作提示词

Usage:
    python3 build_prompt_llm.py --scene-type description --output prompt.json
    python3 build_prompt_llm.py --scene-type dialogue --style-file style.yml --context '{"scene": "雨夜"}' --output prompt.json
"""

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/build_prompt_llm.py (reported line 6)May include surrounding context.

python
智能提示构建器 (LLM 版本) - 通过 LLM 构建高质量写作提示词

Usage:
    python3 build_prompt_llm.py --scene-type description --output prompt.json
    python3 build_prompt_llm.py --scene-type dialogue --style-file style.yml --context '{"scene": "雨夜"}' --output prompt.json
"""

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/build_prompt_llm.py (reported line 7)May include surrounding context.

python
智能提示构建器 (LLM 版本) - 通过 LLM 构建高质量写作提示词

Usage:
    python3 build_prompt_llm.py --scene-type description --output prompt.json
    python3 build_prompt_llm.py --scene-type dialogue --style-file style.yml --context '{"scene": "雨夜"}' --output prompt.json
"""

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
87% confidence
Finding

The skill documentation describes capabilities that read files, write output files, consume environment/context, and potentially interact with external resources, but it does not declare any explicit tool scope such as permissions or allowed-tools. This creates an authorization gap where an agent may invoke broader file or network-capable tooling than intended, increasing the chance of over-privileged execution or unsafe composition with other skills.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The file’s human-readable comments and content are entirely in Chinese, including the style description and tone settings, with no indication that this locale is optional or limited to a China-specific use case. Under the policy, forcing a specific language or locale 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
93% confidence
Finding

The skill documentation is written entirely in Chinese and all examples, output labels, and constraints assume Chinese-language usage. Under the policy, forcing a specific language without offering an explicit language or locale choice can be a natural-language policy violation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script sends user-supplied style and context data to an external LLM API, but provides no explicit warning, consent gate, or data classification check before transmission. If users place sensitive manuscript material, private notes, or proprietary style guides in these fields, the skill can unintentionally disclose that content to a third-party service.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
94% confidence
Finding

This code performs external network transmission of prompt content, including style and context, to a third-party endpoint. In the context of a prompt-building skill, that can expose confidential writing material or internal guidance if operators assume processing is local or do not realize the full payload is being sent off-box.

Content

Scanner excerpt · scripts/build_prompt_llm.py (reported line 92)May include surrounding context.

python
transient=True,
    ) as progress:
        progress.add_task("building", total=None)
        response = requests.post(url, headers=headers, json=payload, timeout=60)

    response.raise_for_status()
    data = response.json()

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The prompt instruction explicitly requires that all generated text be in Chinese. This imposes a language policy on users without offering a language choice or documenting a justified region-specific constraint.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

The manifest description and the entire skill documentation require Chinese comprehension, and the sample prompts also prescribe Chinese output/style conventions. Under the policy rule for language/locale constraints, this is a natural-language policy issue because no user choice or opt-in is offered and no region-specific justification is documented.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The manifest frames the skill as a prompt builder that generates optimized writing prompts from corpus results and context. In addition to generating prompts, the code exposes an --output option and writes the rendered prompt to a filesystem path, which is a broader operational behavior than the description suggests.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
90% confidence
Finding

The dependency is specified with only a lower bound (rich>=12.0.0), which allows future major or minor releases to be installed without review. This can introduce supply-chain risk, unexpected breaking changes, or a malicious upstream release into the skill environment.

Content

Scanner excerpt · scripts/requirements.txt (reported line 1)May include surrounding context.

text
rich>=12.0.0