Back to skill

Security audit

Chart Generator 2.0.0

Security checks for vulnerabilities and agentic risk

Overview

This chart skill is mostly a normal visualization tool, but it writes HTML/SVG files with unescaped user-provided chart text, which can create persistent script-injection risk if those files are opened or published.

Review before installing. Use this only with chart data you trust, avoid opening or publishing generated HTML/SVG files from untrusted labels or titles, and prefer sandboxed output directories. The publisher should escape HTML/XML text, restrict or confirm output paths, and document local history/output persistence.

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

Persistent HTML and SVG Script Injection Through Unescaped Chart Content

Content
View full analysis
{}'.format(svg_w/2, title)) for i, (label, val) in enumerate(pairs): x = margin_left + gap + i * (bar_w + gap) bar_h = (val / max_val * chart_h) if max_val > 0 else 0 y = margin_top + chart_h - bar_h color = colors[i] val_str = str(int(val)) if val == int(val) else "{:.1f}".format(val) parts.append(''.format(x, y, bar_w, bar_h, color)) parts.append('{}'.format(x + bar_w/2, y - 6, val_str)) parts.append('{}'.format(x + bar_w/2, margin_top + chart_h + 20, label)) ``` Equivalent unescaped interpolation is present in the pie and line SVG generators: ```python parts.append('{}'.format(svg_w/2, title)) ``` ```python parts.append('{} ({:.1f}%)'.format(legend_x + 20, ly + 12, label, pct)) ``` ```python parts.append('{}'.format(x, margin_top + chart_h + 20, labels[i])) ``` The HTML gen ...[truncated 3862 chars]
Remediation
View remediation
` elements. - HTML heading elements. - SVG chart titles. - SVG axis labels. - SVG legends. - Any future SVG attributes populated from user input. 3. Prefer an XML or HTML construction library that creates text nodes and escapes their contents automatically rather than assembling markup through string formatting. 4. Validate color schemes and other attribute values using strict allowlists. Continue parsing numeric values as numbers rather than inserting arbitrary strings. 5. Consider applying a restrictive Content Security Policy to generated HTML as defense in depth: ```html ``` 6. Add regression tests covering titles and labels containing `<`, `>`, `&`, quotes, closing tags, script elements, event-handler attributes, and malformed Unicode. Verify that generated files contain encoded text rather than executable elements. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
scripts/script.sh:214
Finding

Persistent SVG Script Injection in the Secondary Chart Generator

Content
View full analysis
}" shift local file="$DATA_DIR/chart-$(date +%s).svg" # Generate simple SVG bar chart local w=600 h=400 echo '' > "$file" echo "" >> "$file" echo "" >> "$file" echo "$type chart" >> "$file" local x=50 i=0 max_v=0 declare -a sv_labels=() sv_values=() for pair in "$@"; do sv_labels+=("${pair%%:*}") local v="${pair##*:}" sv_values+=("$v") [ "$v" -gt "$max_v" ] 2>/dev/null && max_v="$v" done local bar_w=$(( (w - 100) / (${#sv_labels[@]} > 0 ? ${#sv_labels[@]} : 1) - 10 )) local colors=("#e94560" "#0f3460" "#16213e" "#533483" "#e94560" "#2b2d42") for i in "${!sv_labels[@]}"; do local bh=$(( ${sv_values[$i]} * 300 / (max_v > 0 ? max_v : 1) )) local bx=$((50 + i * (bar_w + 10))) local by=$((380 - bh)) local color="${colors[$((i % ${#colors[@]}))]}" echo "" >> "$file" echo "${sv_labels[$i]}" >> "$file" echo "${sv_values[$i]}" >> "$file" done echo "" >> "$file" echo ...[truncated 1951 chars]
Remediation
View remediation
` as `>` - `"` as `"` - `'` as `'` 3. Apply escaping to both `$type` and every entry in `sv_labels` before writing them to the SVG. 4. Strictly validate numeric values before using them in arithmetic expressions or output: ```bash if [[ ! "$v" =~ ^[0-9]+$ ]]; then printf 'Invalid numeric value: %s\n' "$v" >&2 return 1 fi ``` 5. Restrict chart types to a documented allowlist rather than accepting arbitrary text. 6. Add automated tests using closing-tag and script-element payloads. Parse the generated SVG and confirm that malicious strings remain text content and cannot create additional XML elements. ]]>
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • 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
97% confidence
Finding

The skill description and manifest materially mismatch the documented and detected behavior: it is presented as an SVG chart generator, but also performs persistent local writes, imports external data formats, and primarily renders terminal charts. This kind of capability drift is dangerous because users and policy engines may grant trust based on a narrower advertised purpose while the skill performs broader file and data-handling actions.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The manifest advertises a runnable skill but declares no tool scope or permissions, even though the documented behavior includes writing output files and likely accessing environment/runtime capabilities. In an agent setting, missing scope declarations weaken least-privilege controls and can cause the skill to run with broader access than users or orchestrators expect.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
71% confidence
Finding

The primary descriptive text and most usage guidance are written in Chinese, with only partial English support, which may impose a language choice on users without explicitly offering an opt-in or alternative. Under the policy, locale or language constraints should be optional or clearly justified rather than assumed.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The manifest description narrows the skill to a 'Data visualization tool producing SVG charts', but the script implements many non-SVG behaviors: ASCII bar/line/pie charts, tables, sparklines, dashboards, progress displays, heatmaps, and an HTML chart writer. This is a semantic mismatch between the declared primary behavior and the broader actual functionality.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This shell script presents its help text primarily in Chinese, and later emits many Chinese status and error messages. For a general-purpose chart generator, this is a natural-language locale policy issue because the skill imposes a specific language without user opt-in or any documented justification that it is region-specific.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
83% confidence
Finding

The html-bar path is fully user-controlled via --output, and the script writes directly to that filesystem location without restriction or validation. In an agent/runtime context, this can enable arbitrary file write within the agent's permissions, which may overwrite existing files, place HTML in sensitive directories, or be chained into broader compromise depending on where the skill is allowed to write.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The documentation presented by the script claims support for scatter plots, tables, heat maps, HTML export, and JSON import, but the dispatch logic routes these commands to TODO placeholders rather than real functionality. This creates a direct mismatch between the skill's claimed behavior and its actual operations.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The help text functions as user-facing documentation and actively represents these features as available commands. The main command dispatcher contradicts that claim by not implementing them and returning placeholder TODO output instead.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest description says the skill is a 'Data visualization tool producing SVG charts,' which implies SVG output as the primary scope. However, the documentation describes broader behavior including ASCII charts, HTML files, tables, sparklines, dashboards, progress views, trend analysis, and heatmaps, so the manifest understates and mischaracterizes what the skill actually provides.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

The skill documentation does not clearly warn that some commands create files on disk, which can surprise users in environments where filesystem writes are sensitive. Hidden or under-documented persistence increases the risk of accidental data exposure, clutter in shared workspaces, or policy violations when an agent is expected to be read-only.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

The HTML output explicitly sets the document language to Chinese regardless of user preference or input context. This is a locale policy violation for a general-purpose visualization tool because it silently enforces a specific locale rather than allowing selection or documenting why that locale is required.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The stated purpose is chart generation, especially SVG visualization, but the implementation creates and uses a persistent application data directory and keeps a history log of chart activity. Persistent storage is additional behavior beyond merely producing charts, even though it is not overtly malicious.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

SVG export automatically saves files into a persistent local directory without requiring an explicit output path or warning, which can leave sensitive chart data on disk unexpectedly. Because charts may encode confidential labels and values, silent persistence increases the chance of local data exposure, especially on shared systems or in automated environments.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The history logger writes chart titles and metadata to disk automatically, which can leak sensitive business terms, project names, or dataset descriptions to other local users or future processes that access the account. In a chart-generation context, titles often contain confidential information, so undisclosed local logging increases privacy and data-handling risk.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

This markdown file presents all guidance, examples, and usage notes only in Chinese. Under the stated policy, forcing a specific language without user opt-in can be a natural-language policy violation unless the locale limitation is explicit and justified.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.