Back to skill

Security audit

Customer Research

Security checks for vulnerabilities and agentic risk

Overview

This skill mostly matches customer research and report generation, but needs Review because its Word report script can overwrite arbitrary writable files despite claiming workspace-restricted output.

Install only if you are comfortable with a Chinese-language sales research workflow that performs multiple public web searches and generates local documents. Keep generated files in a dedicated workspace directory, do not pass arbitrary output paths, review reports before use, and require explicit approval before any memory write or file sending.

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 (1)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/create_word.py:87
Finding

Unrestricted Output Path Allows Arbitrary File Overwrite

Content
View full analysis

Vulnerability Details

File Location: scripts/create_word.py, lines 87-109
Vulnerability Type: CWE-73 — External Control of File Name or Path; CWE-59 — Improper Link Resolution
Risk Level: Medium

Vulnerable Code

The report-writing function saves directly to the supplied path without validating its location, extension, or symlink status:

python
doc.save(output_path)

The command-line entry point passes the caller-controlled argument directly to that function:

python
customer_name = sys.argv[1]
output_path = sys.argv[2]

create_word_report(customer_name, results, output_path)

Technical Analysis

The second command-line argument controls the destination passed to python-docx without any containment check. Unlike scripts/create_scenario_ppt.py, this script does not resolve the path and verify that it is inside an approved workspace.

Consequently, an absolute path or a path containing traversal components can target any location writable by the agent process. The save operation can create or truncate the selected file. It can also follow a symbolic link, allowing a path that appears to be inside an expected directory to overwrite a writable target elsewhere.

No shell execution or privilege escalation primitive is present. The vulnerability is limited by the operating-system permissions of the process running the skill.

Attack Path

  1. An attacker influences the output path passed to create_word.py, directly or through an agent request that is converted into script arguments.
  2. The attacker supplies an absolute path, traversal path, or symbolic-link path pointing to a writable target.
  3. The script accepts the path without validation.
  4. doc.save(output_path) opens and truncates the target, replacing it with generated DOCX data.
  5. The target file is corrupted or replaced, potentially disrupting other agent tasks or destroying user data.

Example invocation aga ...[truncated 1059 chars]

Remediation
View remediation

Remediation Suggestions

  1. Resolve all output paths and require them to remain beneath a dedicated report directory:

    python
    from pathlib import Path
    
    def validate_output_path(raw_path, workspace):
        workspace = Path(workspace).resolve(strict=True)
        output_path = Path(raw_path).resolve(strict=False)
    
        try:
            output_path.relative_to(workspace)
        except ValueError:
            raise ValueError("Output path must remain inside the report workspace")
    
        if output_path.suffix.lower() != ".docx":
            raise ValueError("Output file must use the .docx extension")
    
        return output_path
    
  2. Use Path.relative_to() rather than string-prefix comparisons, which do not enforce path-component boundaries.

  3. Generate the destination filename from the validated customer name instead of accepting an arbitrary destination from the caller.

  4. Restrict customer names to a conservative character set and reject path separators, control characters, reserved names, and excessive lengths.

  5. Defend against symbolic-link attacks. Reject an existing destination if it is a symlink and ensure every parent directory between the workspace root and destination is trusted and not symlinked.

  6. Run the skill under a least-privileged account with access only to its dedicated output directory.

  7. Use a temporary file in the destination directory followed by an atomic rename after successful document generation.

  8. Apply the same centralized path-validation routine to every document-generation API so direct library calls cannot bypass command-line protections.

Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • 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
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (17)

Hidden Instructions

High
Category
Prompt Injection
Confidence
60% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · README.md (reported line 1)May include surrounding context.

md
---
name: customer-research
description: 客户调研与竞品情报技能 - 自动生成 Word 调研报告和场景破冰 PPT(before/after 对比)。支持客户背景调研(4维度)和竞品情报/采购记录查询(可选第5维度)。
version: 1.3.2

Hidden Instructions

High
Category
Prompt Injection
Confidence
60% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

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

md
---
name: customer-research
description: 客户调研与竞品情报技能 - 自动生成 Word 调研报告和场景破冰 PPT(before/after 对比)。支持客户背景调研(4维度)和竞品情报/采购记录查询(可选第5维度)。
version: 1.3.2

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The trigger phrase 'XX 客户的情况' is vague and can match ordinary conversational references rather than a deliberate request to run the research workflow. In this skill, vague triggering is more dangerous because the workflow performs multi-step searches and document generation, so accidental activation can lead to unnecessary data gathering and misleading outputs.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger '任何新客户名称首次出现' is overly broad because it can activate research behavior on any first mention of a customer-like name, even when the user did not explicitly request investigation. In a sales agent context, this can cause unintended collection, processing, and generation of customer intelligence, increasing privacy, compliance, and workflow-manipulation risk.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The trigger section includes broad, everyday phrases like '帮我查一下 XX 客户' and 'XX 客户的情况', which can cause the skill to activate for vague requests that do not clearly authorize multi-step external research, report generation, or messaging actions. In this skill’s context, accidental activation is more dangerous because the workflow performs repeated web searches, creates deliverables, and may write customer memory or prepare outbound messages, increasing the chance of unintended data handling and external actions.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill mandates a fixed language style ('语言是客户业务语言,不是厂商技术术语') without offering user language choice or a clear policy for multilingual handling. While not a direct code-execution issue, this can cause miscommunication, unsafe assumptions about the recipient audience, and incorrect or noncompliant output when the user expects another language or a more precise technical register.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The manifest description is visibly garbled/encoding-corrupted, which makes the skill’s purpose and operational scope unclear to users and reviewers. In a skill that performs customer research and generates Word/PPT outputs, unclear scope can conceal or misrepresent data collection, external lookups, or document-generation behavior, increasing the chance of unsafe invocation or improper trust.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The module is configured to auto-activate on broad business terms like '市场调研' and '采购记录', and can also bypass the normal research flow. In an agent setting, overly broad routing can cause unintended collection and synthesis of competitive intelligence and decision-maker information when the user did not explicitly request that scope, increasing the risk of privacy overreach, policy bypass, or unauthorized profiling.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

The entire skill instruction set is written as mandatory Chinese-language workflow guidance and examples, with no indication that the user can choose another language or that the locale restriction is required for compliance or region-specific use. This can violate organizational language/locale policy when a skill implicitly forces one language without user opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The entire template library and usage instructions are written exclusively in Chinese, with no indication that language selection is optional or that the skill is intentionally restricted to a Chinese-language context. Under the policy, forcing a specific language without user opt-in is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The module-level documentation states the PPT scenes are dynamically selected and customized based on actual research results, and the function docstring repeats that intent. In practice, detect_industry only selects between preset scenario libraries, while customize_scenarios_with_research collects findings but does not apply them to scenario content, so the generated slides remain generic templates apart from industry selection.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The command-line usage text labels research_results.json as optional and describes a fallback load from the current directory, which implies the script can proceed without an explicit third argument. However, the main function create_scenario_ppt raises an error whenever no research results are available, so successful execution actually requires research data to exist either via argument or default file.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This file contains the primary description and operational guidance exclusively in Chinese, including the module docstring and later CLI usage/output text. Under the policy, forcing a specific language without opt-in is a natural-language locale violation because users of supported agent frameworks are not given a language choice or a documented region-specific reason.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
62% confidence
Finding

The natural-language metadata on L03 appears to be non-English/locale-specific text, and there is no visible indication in this file that users can choose a different language or that the locale restriction is intentional and justified. Because the text is also garbled, users may be unable to determine whether a language constraint exists or how to opt out.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

All user-facing instructions, triggers, and output structure are specified in Chinese, and there is no indication that the user can choose another language or locale. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy concern unless the locale restriction is clearly documented and justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The docstring and all user-facing print output are written only in Chinese, which imposes a specific language on users without opt-in or an explanation that the script is intended solely for a Chinese-language environment. This matches the language/locale policy violation category for natural-language content.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

The natural-language content in the module docstring, function docstring, section headings, and CLI usage/output strings is entirely in Chinese, which imposes a specific language on users. The file does not indicate that the skill is region-specific or provide any option to select another language.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.