Back to skill

Security audit

SPC绘图及分析技能

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a coherent SPC analysis tool, but it should be reviewed because it requires shell execution with user-supplied file paths.

Review before installing. Use only trusted input and output paths, avoid filenames containing shell metacharacters, and prefer changing the skill to invoke the Python script with structured arguments instead of an interpolated shell command. Expect it to create or overwrite an HTML report file.

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

Error
Location
SKILL.md:41
Finding

Shell Command Injection Through Unquoted User-Controlled File Paths

Content
View full analysis
--chart-type [--output ] [--usl ] [--lsl ] ``` ``` The same unsafe invocation requirement is reiterated at lines 78–79: ```markdown - **Script invocation method**: The script must be invoked with the `exec_shell` tool, using `/workspace/projects/spc-analysis` as the working directory. - **Command format**: `python scripts/spc_analysis.py --input --chart-type [--output ] [--usl ] [--lsl ]` ``` ### Technical Analysis The Skill explicitly instructs the Agent to construct a shell command by substituting paths into an `exec_shell` command. The dynamic `--input` and `--output` arguments are not quoted or otherwise safely encoded. File paths can contain shell metacharacters such as semicolons, command substitutions, redirection operators, or newlines. If an attacker controls an uploaded filename or persuades the Agent to use a crafted path, the shell can parse part of that path as a separate command. For example, unsafe interpolation of a path resembling the following would introduce a second command: ```text data.xlsx; id > /tmp/spc-command-injection-proof # ``` The resulting shell command would be interpreted approximately as: ```bash python scripts/spc_analysis.py --input data.xlsx; id > /tmp/spc-command-injection-proof # --chart-type imr ``` This issue exists in the Skill’s required execution workflow rather than in `argparse` inside the Python script. Once the shell has parsed the command line, Python-side argument validation cannot prevent execution of the injected com ...[truncated 1594 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (11)

Tp2

High
Category
MCP Tool Poisoning
Confidence
85% confidence
Finding

Mixing characters from multiple Unicode scripts in a single identifier is a common technique to create visually ambiguous tool names.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The TRACE section explicitly highlights '支持中文交互' as the interaction language characteristic, while the document otherwise presents the skill entirely in Chinese and does not mention any user language choice or opt-in. Under SQP-3, forcing or implying a single language without offering a choice can be a natural-language policy issue unless clearly justified as region-specific.

Content

No source excerpt is available for this finding.

Ae4

Medium
Category
analysis-evasion
Confidence
80% confidence
Finding

Suspicious Unicode normalization or mixed-script content

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

L0777-L0856 clearly builds a svg_charts collection for multiple charts depending on chart type, which matches the surrounding comments about generating one or two charts. But the HTML template at L1053-L1055 inserts {svg_chart}, a variable not defined in this function, so the implementation does not actually render the charts as documented and commented.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

This markdown file instructs the agent to run analysis that produces an HTML report file and may auto-generate a filename in the working directory. While the behavior is described, there is no explicit user-facing warning that the skill will create files on disk and where they will be saved, which is the kind of disclosure SQP-2 expects for markdown skill descriptions affecting user data or system state.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

This markdown file contains user-facing instructions exclusively in Chinese, and there is no indication that the skill is region-specific or that users may choose another language. 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

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The entire skill documentation is written in Chinese and does not indicate that users may choose another language or locale. Under the stated policy, forcing a specific language without user opt-in can be a natural-language policy violation unless the locale constraint is explicitly justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

This markdown file contains all user-facing instructional content in Chinese, and nowhere indicates that the language choice is optional or that the skill is intended only for a Chinese-speaking audience. Under the language/locale policy, forcing a specific language without user opt-in can be a policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

This code file contains user-facing natural-language text exclusively in Chinese, including the top-level description and later CLI/help/report strings. Under the policy rule, forcing a specific language without opt-in is a locale/language policy issue because users are not given any way to select another language.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

This code performs a file write to the user-specified output path, which can create or overwrite a local HTML file. Although the script prints progress messages, there is no explicit warning or confirmation about the file-writing side effect, and the operation is not clearly disclosed in a docstring/comment at the write site beyond generic report generation.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.