Back to skill

Security audit

Chart Generator (Alex)

Security checks for vulnerabilities and agentic risk

Overview

This is a real chart generator, but its generated SVG/HTML can include unsafe unescaped user input and one packaged script silently keeps local chart history.

Review before installing if you may chart untrusted or sensitive data. Treat generated SVG/HTML files as potentially active content, avoid opening or hosting outputs from untrusted labels/titles in a trusted browser context, and be aware that the packaged secondary script can keep local chart history under the user data directory.

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/chart.sh:123
Finding

Unescaped User Input in Generated SVG and HTML Files

Content
View full analysis
{}'.format(svg_w/2, title)) ``` ```python parts.append('{}'.format(x + bar_w/2, margin_top + chart_h + 20, label)) ``` The HTML generator similarly inserts the title and generated label markup without escaping: ```python svg_bars.append( ' ' '{label}\n' ' \n' ' {val}'.format( ty=y + bar_height // 2 + 5, label=label, ry=y, w=w, h=bar_height, color=color, tx=w + 108, val=val_str ) ) ``` ```python html = """ {title} ...

{title}

{bars}
""".format( title ...[truncated 3103 chars]
Remediation
View remediation
{}'.format( svg_w / 2, html.escape(title, quote=True) ) ) ``` 3. Replace string-based document construction with a standard XML or HTML builder where practical. For SVG, `xml.etree.ElementTree` can create text nodes without requiring manual markup concatenation. 4. Apply equivalent encoding in `scripts/script.sh`. If shell-based SVG generation is retained, invoke a dedicated escaping function or pass values to a safe XML-generation utility rather than interpolating raw shell variables into markup. 5. Continue parsing numeric values as numeric types and reject non-finite values such as `NaN` and infinity. Keep chart type and color scheme values restricted to explicit allowlists. 6. Add regression tests for titles and labels containing XML metacharacters, closing tags, event-handler markup, and script-like content. Tests should confirm that these inputs appear only as encoded text and cannot create additional document elements. 7. For generated HTML, consider adding a restrictive Content Security Policy, such as disabling scripts and remote resource loading. This should be treated as defense in depth and not as a replacement for output encoding. 8. Document that generated files may contain untrusted data and should not be opened or hosted under a sensitive trusted origin unless they have been safely encoded. ]]>
Vulnerability Patterns
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • 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
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (15)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The declared purpose presents a simple chart generator, but the documented or detected behavior includes persistent local file writes, chart history logging, and CSV input handling beyond that narrow description. This mismatch can mislead users and policy engines about data handling and persistence, increasing the chance of unintended data exposure or unsafe invocation.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
87% confidence
Finding

The skill advertises executable behavior that can write files and use environment-derived capabilities, but the manifest does not declare any tool scope or permissions boundary. In an agent setting, this weakens least-privilege controls and makes it harder for users or orchestrators to understand and constrain what the skill may do.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The manifest description narrowly presents the skill as a 'Data visualization tool producing SVG charts,' which suggests SVG is the primary output format. However, the file documentation emphasizes ASCII and HTML output modes and multiple non-SVG visualizations as core functionality, indicating a broader behavior than the manifest claims.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Very broad trigger terms like 'chart', 'graph', 'visualization', and 'SVG' can cause the skill to activate in contexts where the user did not intend file-generating or data-processing behavior. In an agent ecosystem, unintended invocation raises the risk of exposing sensitive input to the skill or causing unexpected file writes.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
83% confidence
Finding

The skill description presents the primary operational description in Chinese without offering a language choice or stating that Chinese is optional. This may conflict with language/locale policy expectations if users have not opted into Chinese output or documentation.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The file header states the tool creates terminal charts and exportable SVG/HTML charts. In the command dispatcher, the html command only prints a TODO message and performs no HTML export, so the documentation actively overstates the implemented behavior.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The usage documentation presents scatter, table, heatmap, and html as available commands. In the dispatcher, each of these paths only prints a TODO message, so the documented functionality contradicts the code's actual behavior.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The help output says users can generate charts from JSON via from-json. But the main dispatch for from-json only echoes a TODO message, which contradicts the documented interface and intent.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The manifest describes a general data-visualization tool for bar charts, line charts, pie charts, tables, sparklines, gauges, and SVG output. However, cmd_svg accepts an arbitrary type argument but always emits the same bar-chart-oriented SVG structure, so the advertised SVG capability does not match actual behavior for most chart types.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

Line L010 states the script generates 'ASCII charts or HTML files,' which excludes SVG output. Later command documentation explicitly includes multiple SVG-producing commands, so the documentation at L010 actively misstates the actual documented behavior of the script.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

This code file contains user-facing help and output text primarily in Chinese, and the generated HTML hard-codes lang="zh". Under the policy rule, forcing a specific language or locale without opt-in is a natural-language policy violation when no user choice or justification is provided.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
98% confidence
Finding

The HTML template explicitly sets the page language to Chinese regardless of user preference or input context. This is a direct locale constraint and there is no surrounding logic that offers an alternative language or explains a region-specific requirement.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

The SVG export path writes a file to disk automatically in the user's data directory and includes user-controlled content in the output without requiring explicit confirmation or a caller-specified destination. In this skill context, automatic persistence is moderately more concerning because chart data often represents sensitive analytics, and silent file creation can leave recoverable artifacts users did not expect.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

The script persistently logs user-supplied chart metadata, including titles and labels, to a history file under the user's data directory without disclosure or opt-in. In a chart-generation context, inputs may contain sensitive business metrics, project names, or personal data, so silent retention can create unintended local data exposure to other local processes, backups, or later users of the account.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

This markdown file presents all instructions and examples exclusively in Chinese, which can amount to a language/locale policy issue when no user opt-in or documented regional scope is provided. The policy allows fixed-language behavior only when the skill offers a language choice or clearly justifies the locale restriction.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.