Back to skill

Security audit

京东配置价格表生成器

Security checks for vulnerabilities and agentic risk

Overview

The skill is not clearly malicious, but it needs review because its bundled script can create misleading static price quotes and writes to a hardcoded path outside the stated workspace.

Install only if you are comfortable reviewing and editing the helper script before use. Confirm any prices manually, avoid treating the generated workbook as a live JD quote, and require the agent to save outputs inside your workspace with an explicit non-overwrite path.

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_jd_price_excel.py:166
Finding

Hardcoded Output Path Can Overwrite a File Outside the Workspace

Content
View full analysis

Vulnerability Details

File Location: scripts/create_jd_price_excel.py, lines 166-167
Vulnerability Type: Hardcoded, unvalidated output path and silent file replacement
Risk Level: Medium

python
output_path = "/Users/wuhaorui/WorkBuddy/本地虾/电脑配置京东价格表.xlsx"
wb.save(output_path)

Technical Analysis

The script saves its generated workbook to a developer-specific absolute path. It does not derive the destination from the active workspace, accept a caller-supplied path, verify that the destination remains within an authorized directory, or check whether a file already exists.

Workbook.save() replaces an existing file at the destination without requesting confirmation. Therefore, if the hardcoded directory exists and is writable, invoking the script can modify or destroy a preexisting workbook outside the project workspace. This also conflicts with SKILL.md, which states that the generated file should be saved in the workspace root.

Exploitation depends on the fixed destination existing and being writable by the account running the script. The issue does not provide privilege escalation and does not allow an external user to select an arbitrary target path.

Attack Path

  1. A user or agent invokes the bundled script to generate the advertised Excel report.
  2. The script ignores the current project or workspace location and selects the hardcoded absolute destination.
  3. The operating system resolves the destination under /Users/wuhaorui/WorkBuddy/本地虾/.
  4. If 电脑配置京东价格表.xlsx already exists and is writable, wb.save(output_path) silently replaces it.
  5. If the directory is unavailable or not writable, execution fails instead, preventing normal delivery of the generated report.

Impact Assessment

The script can overwrite one specific file using the existing filesystem privileges of the process. The affected scope is limited to the hardcoded destination; there is no evidence of elevated pr ...[truncated 341 chars]

Remediation
View remediation

Remediation Suggestions

  • Accept the output destination as an explicit command-line argument or function parameter.
  • Default to a safe filename under the current workspace rather than a developer-specific absolute path.
  • Resolve the destination with pathlib.Path.resolve() and verify that it is contained within the authorized workspace.
  • Check whether the destination already exists and require explicit overwrite authorization before replacing it.
  • Return a clear error when the parent directory is missing or unauthorized.
  • Consider creating the workbook in the destination directory using a uniquely named temporary file and atomically renaming it after successful generation.

Example hardening pattern:

python
from pathlib import Path

workspace = Path.cwd().resolve()
output_path = (workspace / "jd-price-report.xlsx").resolve()

if workspace not in output_path.parents:
    raise ValueError("Output path must remain inside the workspace")

if output_path.exists():
    raise FileExistsError(f"Refusing to overwrite existing file: {output_path}")

wb.save(output_path)
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (6)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

声明的核心能力是:基于用户提供的配置清单,去京东搜索各配件价格和链接,再生成 Excel 报价表。但实际代码只是在 openpyxl 中创建工作簿,写入一组预先写死的服务器配件、价格和京东链接,计算小计和合计,并保存到固定路径。代码中没有任何用户输入处理、OCR/图片解析、文本解析、网页请求、京东搜索、浏览器自动化或抓取逻辑。因此其实际行为与描述的主要目的存在明显偏差。生成 Excel 这一点与声明部分一致,但缺失了描述中最关键的“根据用户输入进行搜索并整理”的能力。

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill claims to generate JD price spreadsheets from user-provided configurations, but the code embeds a fixed parts list and static prices instead of processing input or performing live retrieval. This creates a deceptive and integrity-breaking behavior: users may rely on fabricated or stale pricing data for purchasing or budgeting decisions, especially because the output appears polished and authoritative.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The notes assert that prices were obtained from network searches at a specific retrieval time, but the script performs no such retrieval and only emits static values. This is dangerous because it falsely conveys freshness and sourcing, increasing the likelihood that users trust inaccurate commercial data for procurement or costing decisions.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

Writing the output to a fixed absolute path tied to a specific user environment is unsafe and non-portable. In an agent setting, this can overwrite unintended local files, leak details about the developer environment, or fail unpredictably when run under another account or sandbox.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The skill directs the agent to query search engines and third-party sites using user-supplied hardware lists without disclosing that those queries may be sent to external services. Even if the data is not highly sensitive in most cases, procurement configurations can reveal planned purchases, infrastructure details, or vendor preferences to outside parties.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The skill instructs saving an Excel file to the workspace root with a predictable filename, but does not warn about creating or overwriting existing files. In multi-step agent workflows, this can cause accidental data loss or unintended exposure of generated procurement data if users are not informed where artifacts are stored.

Content

No source excerpt is available for this finding.