Back to skill

Security audit

Visualization Chart Generation

Security checks for vulnerabilities and agentic risk

Overview

This skill coherently generates SVG/HTML chart files, with the main caution being that some generated HTML may load chart libraries from a third-party CDN.

Install this if you want a Chinese-first chart-generation skill that creates local SVG/HTML files. For sensitive data, prefer SVG or self-contained HTML, and review or pin any CDN-loaded Chart.js/D3.js scripts before publishing generated pages under a trusted website origin.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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)

T08 · Insecure Dependencies

Warning
Location
assets/chartjs-bar-template.html:7
Finding

Mutable Third-Party JavaScript Is Loaded Without Integrity Verification

Content
View full analysis
``` The generation requirements mandate the same Chart.js dependency: ```html ``` They also mandate a D3.js dependency pinned only to a mutable major-version range: ```html ``` ### Technical Analysis Generated visualization files retrieve and execute JavaScript supplied by `cdn.jsdelivr.net` when opened in a browser. The Chart.js reference does not specify any version, while the D3.js reference allows any release within major version 7. Neither reference provides a Subresource Integrity hash. Consequently, the effective JavaScript payload is not fixed at audit time. It may change because of an upstream package release, package-registry compromise, CDN compromise, or unauthorized modification of the published package. The requirements explicitly state that these CDN imports must be used, causing generated complex visualizations to inherit the risk. No evidence indicates that the currently referenced libraries are malicious. The vulnerability is the absence of controls that ensure the reviewed dependency is the same code later executed by users. ### Attack Path 1. The Skill generates a complex visualization using the mandatory Chart.js or D3.js CDN import. 2. A user opens the generated HTML file or deploys it to a website. 3. The browser requests JavaScript from the external CDN. 4. An attacker compromises the upstream package, its publishing account, the package-delivery path, or th ...[truncated 1031 chars]
Remediation
View remediation
``` 2. Apply the same exact-version and Subresource Integrity controls to D3.js: ```html ``` 3. Generate integrity hashes from independently verified release artifacts and update them only after reviewing the corresponding dependency release. 4. Prefer vendored, audited local copies of the libraries for offline, sensitive, or reproducible output. This removes runtime reliance on an external code-delivery service. 5. Revise `references/viz-requirements.md` so CDN loading is optional rather than mandatory, and require exact versions whenever external resources are used. 6. Add a restrictive Content Security Policy appropriate to generated pages, limiting scripts and outbound connections to explicitly approved sources. 7. Inform users when generated output performs network requests and provide a fully self-contained output option. ]]>
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (29)

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · assets/flowchart-template.svg (reported line 11)May include surrounding context.

text
</marker>
  </defs>

  <!-- 标题 -->
  <text x="340" y="30" text-anchor="middle" fill="#2C2C2A" font-size="15" font-weight="500" font-family="system-ui, -apple-system, sans-serif">流程图模板</text>

  <!-- 开始节点 -->

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · assets/flowchart-template.svg (reported line 20)May include surrounding context.

text
<text x="340" y="72" text-anchor="middle" dominant-baseline="central" fill="#04342C" font-size="13" font-weight="500" font-family="system-ui, -apple-system, sans-serif">开始</text>
  </g>

  <!-- 箭头1 -->
  <line x1="340" y1="94" x2="340" y2="120" stroke="#5F5E5A" stroke-width="1.5" marker-end="url(#arrow)"/>

  <!-- 步骤1节点 -->

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · assets/flowchart-template.svg (reported line 33)May include surrounding context.

text
<!-- 箭头2 -->
  <line x1="340" y1="176" x2="340" y2="200" stroke="#5F5E5A" stroke-width="1.5" marker-end="url(#arrow)"/>

  <!-- 条件判断节点 -->
  <g>
    <rect x="270" y="200" width="140" height="44" rx="8" fill="#FAEEDA" stroke="#854F0B" stroke-width="0.5"/>
    <text x="340" y="222" text-anchor="middle" dominant-baseline="central" fill="#412402" font-size="13" font-weight="500" font-family="system-ui, -apple-system, sans-serif">条件判断?</text>

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · assets/flowchart-template.svg (reported line 43)May include surrounding context.

text
<line x1="340" y1="244" x2="340" y2="270" stroke="#5F5E5A" stroke-width="1.5" marker-end="url(#arrow)"/>
  <text x="350" y="260" fill="#27500A" font-size="12" font-family="system-ui, -apple-system, sans-serif">是</text>

  <!-- 步骤2节点 -->
  <g>
    <rect x="250" y="270" width="180" height="56" rx="8" fill="#EAF3DE" stroke="#3B6D11" stroke-width="0.5"/>
    <text x="340" y="292" text-anchor="middle" dominant-baseline="central" fill="#173404" font-size="13" font-weight="500" font-family="system-ui, -apple-system, sans-serif">步骤2</text>

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · assets/flowchart-template.svg (reported line 54)May include surrounding context.

text
<line x1="410" y1="222" x2="500" y2="222" stroke="#5F5E5A" stroke-width="1.5" marker-end="url(#arrow)"/>
  <text x="450" y="215" fill="#A32D2D" font-size="12" font-family="system-ui, -apple-system, sans-serif">否</text>

  <!-- 步骤3节点 -->
  <g>
    <rect x="500" y="200" width="140" height="44" rx="8" fill="#FCEBEB" stroke="#A32D2D" stroke-width="0.5"/>
    <text x="570" y="222" text-anchor="middle" dominant-baseline="central" fill="#501313" font-size="13" font-weight="500" font-family="system-ui, -apple-system, sans-serif">步骤3</text>

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · references/viz-requirements.md (reported line 22)May include surrounding context.

md
</marker>
  </defs>

  <!-- 标题 -->
  <text x="340" y="30" text-anchor="middle" class="th">图表标题</text>

  <!-- 图表内容 -->

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · references/viz-requirements.md (reported line 55)May include surrounding context.

md
<!-- 图表内容 -->
    <div id="chart">
        <!-- ... -->
    </div>

    <script>

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The trigger list includes very broad terms such as “可视化”, “chart”, and “SVG”, which can match many ordinary user requests and cause the skill to activate unexpectedly. Unintended invocation can lead to unauthorized file-generation behavior or unnecessary loading of the skill in contexts where the user did not explicitly request chart creation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

All natural-language instructions and the manifest description are presented only in Chinese, with no indication that users may choose another language or locale. Under the stated policy, a language constraint should either be opt-in or clearly documented as a justified region-specific limitation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The document declares lang="zh-CN", and the visible UI text throughout the template is Chinese-only. This imposes a specific language/locale without any opt-in, choice, or justification for why the skill is region-specific.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The template executes third-party JavaScript directly from a public CDN, which creates a supply-chain and network trust risk. If the CDN asset is compromised, substituted, or blocked, anyone opening the template may run unintended code or experience broken functionality; in a reusable chart-generation skill, this expands risk because the file is meant to be redistributed and reused.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The document declares zh-CN and all visible UI strings are hard-coded in Chinese, which imposes a specific language/locale on users. There is no indication that this is region-specific by design or that users can opt into another language.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

This markdown file is entirely written in Chinese and provides no indication that other languages are supported or that Chinese is a region-specific requirement. Under the policy rule for natural-language constraints, content that implicitly forces a specific language without user opt-in can be a locale policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The entire template is written as a Chinese-only exemplar and provides no indication that users may request another language or locale. Under the language/locale policy, forcing a specific language without opt-in is a natural-language policy concern unless the regional constraint is explicit and justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The file is written as a prescriptive requirements checklist in Chinese and includes HTML examples fixed to lang="zh-CN", indicating a forced locale rather than an optional one. The stated policy flags language or locale constraints when users are not given a choice and no explicit justification is provided.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The sample HTML structure sets <html lang="zh-CN">, which prescribes a specific locale in generated output. Because no alternative locale selection or user preference mechanism is mentioned, this is a natural-language policy concern under the language/locale rule.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

In the output-saving section, the HTML template repeats <html lang="zh-CN">, reinforcing a mandatory locale choice. The file does not indicate that this should vary according to user preference or project context.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The skill instructs that generated code should be saved as .svg or .html files but does not clearly warn users up front that it writes files to disk. This can surprise users and create minor integrity or privacy risks if files are created in unintended locations or persisted longer than expected.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

This HTML code fetches Chart.js from a public CDN, which causes a network request when the file is opened. The file does not include any visible warning, comment, or other disclosure that loading the template contacts an external third-party service.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

This SVG template uses Chinese-only labels and comments throughout, such as the title and node text, which imposes a specific language/locale in the asset. The file provides no user opt-in, alternative language, or documented region-specific justification, matching the language/locale policy concern.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

This HTML code initiates a local file download when the user clicks the save button, creating an image file on the user's system. Although the button label indicates saving as an image, there is no additional user-facing warning, confirmation, or explanatory note in the code beyond the action label itself.

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 user-facing natural-language instructions and examples exclusively in Chinese, but it does not state that the skill is region-specific or provide any user opt-in for language/locale. Under the policy rule, forcing a specific language without user choice is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

This markdown file is written entirely in Chinese and presents the skill template as the default interaction/output structure, but it does not state that the language is optional or limited to a China-specific use case. 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
78% confidence
Finding

This markdown file contains natural-language instructions that repeatedly require a specific style choice, expressed as 'blue色系、专业风格'. Under the policy rule, forcing a particular language/locale-style choice without opt-in can be a natural-language policy concern when no alternative or user preference mechanism is provided.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

This markdown skill description instructs the agent to save SVG output as a .svg file and return the file path, but it does not warn the user that the operation writes to disk or may overwrite existing files. For markdown files, SQP-2 applies when behaviors affecting user data or system integrity are described without any user-facing warning.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.