Back to skill

Security audit

chart-toolkit

Security checks for vulnerabilities and agentic risk

Overview

This is a charting/report-generation skill whose file exports and visualization dependencies fit its purpose, though users should choose output paths carefully and treat some README integrations as out of scope.

Install and run this only in a normal project workspace, use explicit output directories and unique filenames, and avoid feeding untrusted labels or report names into the HTML snippets unless you add HTML escaping and path validation. Treat the README's database and Feishu imports as unrelated, unreviewed integrations rather than part of this chart toolkit.

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

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:231
Finding

Unescaped Values in Generated HTML Data Tables

Content
View full analysis
{title} {"".join([f"" for c in columns])} ''' for row in data: html += '' + "".join([f"" for v in row]) + '' html += '
{c}
{v}
' return html ``` ### Technical Analysis The documented `create_data_table` implementation inserts `title`, column names, and row values directly into an HTML document. These values are converted to strings but are not HTML-escaped or sanitized. If any value originates from an untrusted dataset, an attacker can supply HTML elements or browser-executable event handlers. For example, a cell containing an image element with an error event handler would be emitted unchanged into the generated report. This issue is present in the operational instructions in `SKILL.md`. Users or agents following the documented implementation would reproduce the vulnerable behavior even though the function is not defined in the primary Python module. ### Attack Path 1. An application accepts report data, column names, or a report title from an untrusted source. 2. The application passes those values to the documented `create_data_table` function. 3. The function concatenates the attacker-controlled value into the HTML without contextual encoding. 4. The generated content is saved or embedded in an HTML report. 5. A user opens the report in a browser. 6. The injected markup is interpreted in the report's browser context, and active content may execute if browser policy permits it. ### Impact Assessment Successful exploitation can modify report content, create dec ...[truncated 368 chars]
Remediation
View remediation
{safe_title} {"".join(f"" for column in safe_columns)} ''' for row in data: safe_values = [escape(str(value), quote=True) for value in row] html += "" + "".join( f"" for value in safe_values ) + "" html += "
{column}
{value}
" return html ``` Additional hardening measures: - Prefer an auto-escaping template engine rather than manual string concatenation. - Treat dataset labels, titles, and cell values as untrusted by default. - Do not attempt to prevent injection using incomplete deny lists. - Apply a restrictive Content Security Policy when serving generated reports. - Add tests containing HTML metacharacters and active-content payloads to verify that output is encoded. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:294
Finding

HTML Injection and Output Path Traversal in Stock Report Generation

Content
View full analysis
{code} 分析报告

{code} 分析报告

''' with open(f'{code}_report.html', 'w') as f: f.write(html) return f'{code}_report.html' ``` ### Technical Analysis The `code` value is used in two security-sensitive contexts without validation: 1. It is inserted directly into HTML title and heading elements without HTML encoding. 2. It is inserted into a filesystem path without restricting path separators or verifying the canonical output location. A crafted stock code containing HTML syntax can inject markup into the generated report. A stock code containing traversal sequences such as `../` can cause the report to be written outside the intended working directory. The fixed `_report.html` suffix limits the final filename but does not prevent directory traversal or replacement of an existing file with the resulting name. The chart paths are also inserted into HTML attributes without encoding. If those values can become attacker-controlled in a concrete implementation, they must be encoded for attribute context as well. ### Attack Path #### HTML injection 1. An attacker supplies a crafted stock code through a report-generation interface. 2. The value is passed to the documented `stock_report` implementation. 3. The value is interpolated directly into the document title and heading. 4. The report is written and later opened in a browser. 5. The browser interprets the injected markup, potentially executing active content. #### Path traversal 1. An attacker supplies a stock code containing one or more parent-directory components. 2. The function constructs the filename as `f'{code}_report.html'`. 3. Python resolves the ...[truncated 835 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Note
Location
requirements.txt:1
Finding

Unpinned Third-Party Visualization Dependencies

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (22)

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The documentation and usage guidance are overwhelmingly written in Chinese, with no indication that other languages are supported or that users may choose their preferred language. This can constitute a natural-language policy violation because it imposes a specific language/locale without opt-in or a documented regional justification.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The README for a charting toolkit suddenly instructs users to import unrelated modules such as DatabaseOps and FeishuSheets in an OpenClaw/Claude Code context. This creates scope confusion and can prompt an agent or user to load broader capabilities than expected, increasing the chance of unauthorized data access, external service interaction, or execution of unintended code paths.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The natural-language interface examples and command syntax are entirely in Chinese, and the code example explicitly configures Chinese fonts, but the document does not state that the skill is China/Chinese-specific or offer multilingual use. Under SQP-3, forcing a specific language or locale without user opt-in is a policy concern.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill repeatedly writes charts and reports to fixed or user-influenced filenames such as 'chart.png', 'bar.png', and '{code}_report.html' without warning about filesystem side effects, overwrite behavior, or constraining output paths. In an agent context, this can unintentionally clobber existing files or write artifacts to unexpected locations if filenames or report names are derived from user input.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This code file performs filesystem writes via savefig(path) using a caller-supplied path, but provides no confirmation prompt, visible user disclosure, or warning in the surrounding docstrings/comments about overwriting or creating files. Because writing output files can affect user data or filesystem state, the operation should be disclosed clearly.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The Plotly save helper writes output to disk through write_html(path) or write_image(path) but does not include any confirmation, logging, or explicit warning that files will be created or overwritten. This is a safety-relevant filesystem operation in a code file and lacks user disclosure.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The chart_to_image helper automatically generates and saves a chart to output_path, causing a file write as part of a convenience function with no visible warning or confirmation. Users invoking a helper like this may not realize it modifies the filesystem unless the behavior is explicitly disclosed.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

When output_path is provided, plot_wordcloud calls plt.savefig(output_path) and writes to disk, but the function provides no user-facing disclosure beyond a brief docstring that does not warn about filesystem changes. This qualifies as a file write lacking an explicit warning in a code file.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The plot_map function calls m.save(output_path) when an output path is supplied, creating a file on disk without any confirmation, logging, or explicit warning. This is a filesystem-modifying action that should be clearly disclosed to users.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This function can create a directory and write multiple files in a loop with broad exception suppression, which increases the chance of unnoticed filesystem changes. In an agent skill context, batch writes are more dangerous than single explicit exports because they can generate many artifacts or overwrite files without clear visibility to the user.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The dashboard function exports an HTML dashboard using fig.write_html(output_path), which writes to disk but does not provide any visible disclosure, confirmation, or warning about file creation/overwrite. This is a safety-relevant side effect for a code file.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This Python file contains natural-language strings and docstrings in Chinese, beginning with the module title at L003 and continuing throughout user-facing prints and descriptions. Under the policy, forcing a specific language without user opt-in or documented justification is a locale/language policy violation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

This markdown file includes examples that save chart outputs to local paths such as chart.png and presents them as routine usage, but it does not warn users that running the examples will create or potentially overwrite files in the working directory. Under the markdown-specific warning rule, file-affecting behavior should be disclosed when documenting skill behavior that affects user data or filesystem state.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The batch generation example documents batch_charts(data, output_dir='charts') and states that multiple charts are generated, but it does not explicitly warn that running it will create a directory and write multiple output files. In markdown documentation, this is a user-visible filesystem-impacting behavior that should be disclosed.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

This markdown file is entirely written in Chinese and does not indicate any user language choice or opt-in. Under the policy rule for natural-language violations, forcing a specific language without user choice can be considered a locale/language policy issue.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The module docstring presents the skill name and description in Chinese only, which is a natural-language locale choice embedded in the file. Because there is no indication that the skill is region-specific or that users can opt into another language, this may conflict with organizational language/locale policy requirements.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

Function docstrings such as the chart and map labels are written in Chinese throughout the file. These natural-language strings can surface in generated documentation or tool introspection, and the file does not offer an alternative language or justify a Chinese-only audience.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
90% confidence
Finding

The dependency 'matplotlib' is unpinned, so installations may pull different versions over time, including releases with future vulnerabilities or breaking changes. This weakens supply-chain integrity and reproducibility, making it harder to verify that a known-safe version is installed.

Content

Scanner excerpt · requirements.txt (reported line 1)May include surrounding context.

text
matplotlib
pandas
# 可选:
plotly

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
95% confidence
Finding

The dependency 'pandas' is unpinned, which allows an unpredictable version to be installed. Because pandas has had security advisories in some versions, leaving it unpinned increases the risk of inadvertently installing a vulnerable release and reduces auditability.

Content

Scanner excerpt · requirements.txt (reported line 2)May include surrounding context.

text
matplotlib
pandas
# 可选:
plotly
kaleido  # for plotly image export

Unverifiable Dependency: pandas has 1 known advisory(ies) (CVE-2020-13091 (** DISPUTED ** pandas through 1.0.3 can unserialize and execute commands from an)), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
82% confidence
Finding

The manifest includes 'pandas' without a version pin, and there is at least one known advisory affecting some pandas releases. Although the cited CVE is disputed and applicability is unknown here, the lack of version pinning prevents verification that the installed version is unaffected, which is a real supply-chain security weakness in context.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

The requirements file contains a Chinese comment ('可选:') on L3. For files subject to organizational language/locale policies, embedding a fixed non-English instruction without offering language choice or documenting a justified locale constraint can be a policy violation.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
90% confidence
Finding

The dependency 'plotly' is unpinned, so the build is not reproducible and may consume an unexpected version from the package index. This creates avoidable supply-chain risk and can expose the environment to vulnerable or incompatible releases.

Content

Scanner excerpt · requirements.txt (reported line 4)May include surrounding context.

text
matplotlib
pandas
# 可选:
plotly
kaleido  # for plotly image export

Static analysis

No suspicious patterns detected.