Back to skill

Security audit

data-viz

Security checks for vulnerabilities and agentic risk

Overview

The visualization tool itself is coherent, but it also includes an under-scoped persistent learner that can record free-form usage data and operate outside this skill.

Install only if you are comfortable with a local visualization skill that also includes persistent usage-learning behavior. Keep outputs and learner state in directories you control, avoid running the learner on other skill directories, and do not open generated SVG/HTML from untrusted datasets until dataset-derived text is escaped.

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/viz.py:48
Finding

Unescaped Dataset Values Allow SVG Content Injection

Content
View full analysis
', f'{title}', ``` ```python for i, (c, v) in enumerate(zip(cats, vals)): h = (v / mx) * (H - 2 * PAD) x = PAD + i * bw y = H - PAD - h s.append(f'') if i < 12: s.append(f'{str(c)[:6]}') ``` ```python groups = {} for r in rows: if not is_number(r.get(num, "")): continue groups.setdefault(r.get(cat, "?"), []).append(float(r[num])) if not groups: continue items = sorted(groups.items(), key=lambda kv: st.mean(kv[1]), reverse=True)[:args.topn] cats = [k for k, _ in items] vals = [st.mean(v) for _, v in items] ``` ### Technical Analysis The chart generator interpolates dataset-controlled column names and category values directly into SVG XML text elements without XML escaping. Category values originate from CSV or JSON records, are stored in `groups`, copied into `cats`, and ultimately inserted into a `` element by `bar_chart`. Because characters such as `<`, `>`, `&`, single quotes, and double quotes are not encoded, a crafted category can terminate the intended text element and introduce additional SVG elements. Column names are also propagated into chart titles and inserted into `svg_frame` without escaping, creating another injection sink. An attacker can therefore include SVG markup in an otherwise valid dataset. The generated file will contain that markup as active XML rather than harmless text. Whether scr ...[truncated 1678 chars]
Remediation
View remediation
` and other active SVG elements - Entity characters such as `&` - Quotes and angle brackets - Path separators in column names 5. Consider applying a restrictive Content Security Policy when generated visualizations are served over HTTP. This is defense in depth and must not replace correct XML escaping. 6. Document that generated SVG files should not be opened directly until all dataset-derived values are safely encoded. ]]>
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • 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
Findings (13)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The documented purpose is local CSV/JSON visualization, but the behavior reportedly includes persistent cross-run recording and storage unrelated to producing charts. This mismatch is dangerous because users and orchestrators may grant trust and invoke the skill for harmless rendering while hidden stateful behavior collects telemetry and writes learned_patterns.json, violating least surprise and potentially enabling data retention beyond user intent.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The file implements a generic, skill-agnostic persistence and self-improvement subsystem rather than functionality narrowly required for CSV/JSON visualization. In the context of a chart-generation skill, this broad telemetry and learning layer expands the data it can retain and the scope of behavior beyond the declared purpose, creating unnecessary privacy and trust risks.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

These functions persist cross-session usage logs, error notes, recent operations, and arbitrary user preferences to disk, none of which are necessary to generate charts. Because notes and preference values are free-form, they may capture sensitive user data and silently create durable telemetry without user awareness.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill declares executable behavior that writes files but does not define any tool scope, permissions, or allowed-tools boundaries. In an agent ecosystem, missing scope declarations can let a seemingly simple visualization skill perform filesystem modifications without transparent authorization, increasing the chance of misuse or unsafe composition with other components.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest description says to use the skill when a user says phrases like "画个图", "做个图表", and especially "看分布", which are broad natural-language requests that can arise in many contexts. The file does not provide tighter trigger constraints, exclusions, or negative examples to clarify when this skill should or should not activate.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
83% confidence
Finding

The natural-language description and trigger guidance are written entirely in Chinese and imply the skill is oriented to Chinese phrasing, but there is no statement that users may choose another language. Under the stated policy, forcing or assuming a specific language without user opt-in is a language/locale policy concern.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

Examples such as "看看分布" and "这两列有关系吗?" are semantically broad and could match general analytical conversation rather than explicit requests to run this skill. The section lacks explicit limits on acceptable inputs or context, such as requiring a provided dataset file and a charting intent.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The documentation presents the skill as a pure offline visualization utility, yet also includes an embedded learner that records operational telemetry after each run. Even if the data stays local, undisclosed or weakly justified telemetry creates privacy and trust risks because user actions, dataset context, and outcomes may be retained in a way unrelated to the core charting function.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

A self-improvement and operation-recording subsystem is not necessary to fulfill a local data-visualization task, so it expands the skill's behavior beyond its stated mission. Unnecessary persistence and adaptive behavior increase attack surface, make review harder, and can lead to covert accumulation of usage history or sensitive metadata over time.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The docstring explicitly advertises a 'universal self-evolving learning module' for any skill, which conflicts with the manifest's narrowly scoped visualization purpose. That mismatch is a strong indicator of undeclared capability expansion, making the skill harder to audit and increasing the chance that users grant trust to code performing unrelated data collection.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

This Python file contains its primary docstring, CLI description, and operational messages entirely in Chinese, which imposes a specific language on users. The file does not offer any language selection or explain that the tool is intended only for a Chinese-speaking or region-specific context.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The resolver accepts either an arbitrary directory path or a skill name resolved under ~/.workbuddy/skills, enabling this module to read and write learning data for other skills. For a single-purpose data-visualization skill, cross-skill filesystem access exceeds least privilege and could be misused to inspect or modify state outside its own directory.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The generated dashboard hard-codes lang="zh" and uses Chinese-only UI text in the output HTML. This imposes a specific language/locale choice on users without offering an option or documenting a justified regional constraint.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.