Back to skill

Security audit

Bytesagain Charts

Security checks for vulnerabilities and agentic risk

Overview

The skill is a local chart generator, but it needs review because it underdocuments local history/file persistence and can create unsafe HTML/SVG from malicious chart labels.

Review before installing. Use it only with chart data you trust, especially when generating HTML or SVG, because labels and titles are not safely escaped. Be aware that it can leave chart files and a local history log on disk, and some advertised features may not work as documented.

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

Warning
Location
scripts/chart.sh:559
Finding

Stored markup and script injection in generated SVG and HTML charts

Content
View full analysis
{}'.format(svg_w/2, title) ) for i, (label, val) in enumerate(pairs): # ... parts.append( '{}'.format( x + bar_w/2, margin_top + chart_h + 20, label ) ) with open(fname, 'w', encoding='utf-8') as f: f.write('\n'.join(parts)) ``` ```python # HTML bar output for i, (label, val) in enumerate(pairs): # ... 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 ) ) html = """ {title}

{title}

Remediation
View remediation
{}'.format(escape(label, quote=True)) ``` 3. Prefer a proper XML or HTML construction library, such as `xml.etree.ElementTree`, instead of manually concatenating markup. A serializer will encode text-node content safely. 4. Keep numeric parsing strict and reject non-finite values such as `NaN` and infinity where they can produce invalid geometry. 5. Consider applying a restrictive Content Security Policy to generated HTML as defense in depth: ```html ``` 6. Add regression tests using titles and labels containing `<`, `>`, `&`, single and double quotes, closing tags, SVG script elements, and event-handler attributes. Verify that these characters are encoded and remain visible only as text. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/script.sh:210
Finding

Stored XML injection in the secondary SVG exporter

Content
View full analysis
}" shift local file="$DATA_DIR/chart-$(date +%s).svg" 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 # ... 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" } ``` ### Technical Analysis The secondary SVG exporter constructs XML using shell `echo` commands and directly embeds command-line labels into `` elements. Shell quoting prevents the label from becoming a shell command, but it does not provide XML escaping. A label containing XML closing tags c ...[truncated 1513 chars]
Remediation
View remediation
` as `>` - `"` as `"` - `'` as `'` 3. Validate all values against a strict numeric expression before arithmetic expansion and reject malformed, negative, excessively large, or non-finite values as appropriate. 4. Add input-size and item-count limits to prevent unexpectedly large SVG files and excessive resource use. 5. Add automated tests with closing-tag payloads and special XML characters. Parse generated files with an XML parser and verify that attacker input appears only as text rather than as new elements. ]]>
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 (16)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The documented behavior materially differs from detected implementation details, including undisclosed local history logging/storage and unsupported advertised features. Security-relevant mismatches undermine informed consent and can cause users or orchestration systems to trust the skill with data under false assumptions, especially when local persistence occurs without being declared.

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 31)May include surrounding context.

md
bash scripts/script.sh bar "Jan:10,Feb:20,Mar:15" --title "Sales"

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 37)May include surrounding context.

md
bash scripts/script.sh bar "Jan:10,Feb:20,Mar:15" --title "Sales"

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
84% confidence
Finding

The skill advertises executable commands and the static analyzer detected capabilities consistent with environment access and file writing, but the manifest declares no tool scope or permission boundaries. In an agent ecosystem, missing explicit scope increases the chance the assistant invokes the skill with broader-than-necessary privileges, enabling unintended file modification or access to sensitive local state.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This code presents the primary user-facing help text in Chinese and also hard-codes the generated HTML document language to zh. The file does not offer any language selection or document a justified region-specific constraint, which conflicts with the policy against forcing a specific language without user opt-in.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The help text presents chart.sh dashboard "标题" as a dashboard capability, suggesting it generates a dashboard from input. In code, cmd_dashboard ignores the supplied data beyond using it as a title fallback and emits hard-coded sample metrics, sample trend data, and a note telling the user to replace them with real data.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The documentation shown to users presents scatter, table, and heatmap as available chart commands, but the command handler later only echoes TODO for those paths. This makes the skill appear more capable than it really is.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The script persistently logs user-supplied chart metadata, including titles and labels, to a history file without notice or consent. In this skill context, chart data may contain sensitive business metrics or identifiers, so silent persistence can expose private information to other local users, backups, or later processes.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The manifest describes generating ASCII and HTML charts from CSV/JSON, but the main dispatcher routes html and from-json to placeholder TODO outputs instead of real functionality. This is a clear mismatch between the advertised capabilities and the actual implemented behavior.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
76% confidence
Finding

The description mixes English and Chinese and presents bilingual behavior as part of the skill's default operation. This may constitute a language/locale policy concern because the user is not offered a choice or opt-in for output language preferences.

Content

No source excerpt is available for this finding.

Vague Triggers

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill says to 'Just ask your AI assistant' and provides example requests, but it does not define a constrained trigger scope, explicit invocation phrase set, or exclusion conditions. In a markdown skill description, this broad wording can make it unclear when the skill should activate versus when a general request about charts should be handled normally.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
96% confidence
Finding

The chart title is hard-coded as Chinese text ("销售报告"), which imposes a specific language in the skill artifact without any indication of user opt-in or a documented regional requirement. This matches the policy category for language or locale constraints appearing in natural-language content.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
97% confidence
Finding

The manifest describes visualization from CSV/JSON, which implies direct support for those input formats. The help text and implementation instead accept custom comma- and pipe-delimited argument strings such as "label:value,..." and "1,2,3|4,5,6", with no CSV or JSON file parsing anywhere in the code.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

The file header explicitly states the script creates terminal charts and exportable SVG/HTML charts, yet the html command path later only prints TODO: html export. This is an active contradiction between code documentation and actual behavior.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

SVG export writes files into a persistent data directory automatically rather than requiring an explicit destination or strong notice. In a data-visualization skill, exported charts may contain confidential data, so unexpected persistence can leave sensitive artifacts on disk beyond the user's intent.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
96% confidence
Finding

This markdown file presents all instructions and examples exclusively in Chinese, and it does not indicate that the user can choose another language or that the skill is intentionally limited to a Chinese-speaking context. Under the policy rule for language or locale constraints, forcing a specific language without opt-in is a natural-language policy issue.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.