Back to skill

Security audit

现场不良数据分析助手

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly does the stated factory quality-data analysis, but its shareable HTML reports can carry unsafe content from uploaded files and make an undisclosed external font request.

Use Review caution before installing. Process only files you trust or keep generated reports isolated, because malicious or unexpected values in uploaded data could become active content in the HTML report. Treat parsed JSON and reports as confidential manufacturing records, avoid sharing reports broadly, and prefer a fixed version that escapes HTML output, removes or discloses external font loading, and warns before overwriting output files.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/generate_charts.py:349
Finding

Stored HTML and JavaScript Injection in Generated Reports

Content
View full analysis
{idx + 1} {item['defect_type']} {item['total_count']} {item['percentage']}% """ ``` Other affected rendering sinks include: ```python
{item[label_key]}
``` ```python {item['defect_type']} ``` ### Technical Analysis The report generator constructs HTML by directly interpolating values from the analysis JSON. These values can originate from free-form fields in user-supplied Excel, CSV, Word, or PDF documents, including defect types, process names, product names, and shift labels. No HTML escaping or contextual output encoding is applied before these values are inserted into the report. Consequently, a value containing HTML elements or event-handler attributes is interpreted as active markup by the browser rather than displayed as text. For example, an attacker-controlled defect type could contain: ```html ``` When the resulting report is opened, the browser creates the injected element and executes its event handler. The vulnerability is persistent because the payload is stored in the generated HTML report and may execute for every recipient who opens it. The vulnerable data appears in multiple report sections: - Defect classification ...[truncated 1610 chars]
Remediation
View remediation
``` 6. Add automated regression tests using payloads containing `

other

Note
Location
scripts/generate_charts.py:29
Finding

Undocumented Third-Party Network Request from Generated Reports

Content
View full analysis
``` ### Technical Analysis Every generated report includes a stylesheet reference hosted by Google Fonts. When a user opens the report while connected to a network, the browser contacts `fonts.googleapis.com` and may subsequently contact associated font-delivery hosts. This external network behavior is not disclosed in the documented report-generation workflow. It also conflicts with the claim in `SKILL.md:124` that the Skill has no external dependency risk. The URL does not explicitly contain manufacturing-quality records, so the finding is not evidence of deliberate data exfiltration. Nevertheless, the external provider can receive ordinary connection metadata, including the viewer's IP address, request time, browser user-agent, and referrer information where applicable. ### Attack Path 1. A user generates an HTML report with `generate_charts.py`. 2. The user or a report recipient opens the file in a browser while online. 3. The browser processes the external stylesheet reference. 4. A request is sent to the Google Fonts service. 5. The external service receives connection and browser metadata associated with the report viewer. ### Impact Assessment The issue does not grant local system privileges or direct access to quality records. Its scope is limited primarily to: - Disclosure of report-viewer network and browser metadata to a third party. - Unexpected external connectivity in restricted manufacturing environments. - Reduced report availability or visual consistency when offline. - Potential violation of organizational privacy, isolation, or network-control policies. The external service also becomes part of the r ...[truncated 114 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (16)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill instructs the agent to parse uploaded files, read reference assets, and generate output files including HTML reports, but it does not declare any explicit tool scope such as permissions or allowed-tools. That mismatch creates an authorization ambiguity: an agent/runtime may permit broader file read/write behavior than users or reviewers expect, increasing the risk of over-broad filesystem access when handling untrusted uploads.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The skill name, description, examples, and usage guidance are entirely in Chinese, and the TRACE section explicitly highlights Chinese interaction support, while no alternative language option or user opt-in is provided. This can constitute a language/locale policy violation when a skill implicitly forces a specific language without giving the user a choice.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The skill explicitly generates complete HTML reports from uploaded inspection and quality data and says they can be directly viewed or shared, but it provides no warning about sensitive manufacturing data, embedded identifiers, or the persistence of generated artifacts. Shareable HTML can unintentionally expose production details, defect trends, customer/product identifiers, or internal operational metrics if redistributed or stored insecurely.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The template explicitly sets the document language to "zh-CN", which imposes a specific locale in a user-facing artifact. The file does not provide any indication that users can opt into another language or that the locale restriction is required for a region-specific purpose.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The file title and all instructional content are written in Chinese, and there is no indication that users may choose another language or that the skill is intentionally limited to a Chinese-speaking or region-specific context. Under the policy rule for language or locale constraints, this is a natural-language policy issue because it imposes a specific language without visible opt-in or justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The file title and all instructional content are written entirely in Chinese, and the document does not indicate that language selection is optional or limited to a specific regional/compliance context. Under the policy, forcing a specific language without user opt-in can be 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
91% confidence
Finding

This code file contains natural-language descriptions, CLI help text, and runtime error messages exclusively in Chinese. Under the stated policy, forcing a specific language without user opt-in is a locale-policy violation unless the restriction is explicitly justified, which is not present here.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script's natural-language docstrings, CLI descriptions, report labels, and HTML metadata are fixed in Chinese, and the HTML template explicitly sets lang="zh-CN". This imposes a specific language/locale without any opt-in, selection mechanism, or justification that the tool is intentionally region-specific.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The Excel parser includes sample_data derived directly from uploaded file contents in its JSON output. If this script is used in an agent pipeline, those rows may expose sensitive production, quality, employee, or customer data to downstream logs, UIs, or other components without explicit user consent or minimization.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The CSV parser returns the first five records from the input file in sample_data, which can disclose confidential manufacturing and inspection data. Because the tool prints JSON to stdout, this content may be captured in logs or surfaced to users who only expected structural analysis.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The Word parser extracts table rows and emits sample records from document contents, potentially leaking incident, defect, supplier, or personnel information stored in quality documents. In agent environments, stdout JSON is commonly logged or reused, so this disclosure can occur even when the user's intent was only parsing metadata.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The PDF parser builds a dataframe from extracted text and returns sample rows, which can leak contents from uploaded PDF reports or records. Since PDFs in this context may contain nonconformance details or business-sensitive quality data, exposing parsed samples increases confidentiality risk.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

This code file contains natural-language strings that impose a specific language/locale for documentation and runtime output. Under the policy, forcing a specific language without offering user choice can be a natural-language policy violation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

This code performs a filesystem write to a caller-supplied output path, but there is no confirmation prompt or user-facing disclosure near the write operation itself. While the CLI argument names imply output behavior, the code does not warn that an existing file at the target path will be overwritten.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The module docstring and user-facing descriptions are presented only in Chinese, which can amount to a forced language choice if the broader environment does not guarantee Chinese-only operation. There is no indication that users can select another language or that the locale restriction is intentionally documented as region-specific.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The command-line parser description and argument help strings are only in Chinese, creating a fixed-language user experience. Because there is no language selection, fallback, or explicit region-specific justification in the file, this may violate language/locale policy expectations.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.