Back to skill

Security audit

黄金白银行情日报

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent gold/silver HTML report generator, but it needs review because generated reports can embed untrusted HTML/JavaScript and load a remote chart script.

Install only if you are comfortable with a Chinese-market report workflow that writes local HTML files. Review or harden the renderer before using untrusted JSON, auto-ingesting external text, emailing reports, or hosting them on an authenticated site; prefer escaping plain text, generating structured HTML/JS internally, and vendoring or integrity-pinning ECharts.

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 (2)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/generate_report.py:58
Finding

Stored HTML and JavaScript Injection Through Unescaped Template Substitution

Content
View full analysis
{{REPORT_DATE}} | 数据截止:{{DATA_ASOF}}
{{HEADER_TAG}}

简明结论与风险提示(速览)

结论:{{CONCLUSION_TEXT}}

    {{RISK_ITEMS}}

{{DISCLAIMER}}

{{SEC1_ROWS}}
品种最新价
(USD/oz)
折合
(元/克)
涨跌幅昨收
(USD/oz)
日内高日内低盘面
``` JavaScript sinks in `assets/report_template.html:175-203`: ```html
Remediation
View remediation

T08 · Insecure Dependencies

Note
Location
assets/report_template.html:7
Finding

Third-Party JavaScript Loaded Without Subresource Integrity

Content
View full analysis
``` ### Technical Analysis Every generated report loads and executes ECharts from a third-party CDN. Although the dependency version is pinned to `5.5.0`, the template does not specify a Subresource Integrity hash. The browser therefore has no cryptographic mechanism to verify that the delivered script matches the version reviewed by the project. If the CDN, package publication process, or delivery path is compromised, modified JavaScript can be served and executed when recipients open a report. The dependency also contradicts the report's characterization as self-contained because chart rendering and executable behavior depend on an external service. ### Attack Path 1. An attacker compromises the CDN response, upstream package artifact, or another part of the dependency delivery chain. 2. A recipient opens a generated report while connected to the network. 3. The browser downloads the altered `echarts.min.js`. 4. Because no `integrity` attribute is present, the browser accepts the response without comparing it to an expected cryptographic digest. 5. The malicious script executes in the report's browser context. ### Impact Assessment A compromised dependency receives the same browser-side execution capability as the report's own scripts. It can manipulate report content, intercept chart data, initiate network requests, or access data available to scripts under the report's origin. This issue does not directly grant operating-system privileges. Its practical scope depends on how the report is opened or hosted. Reports served from a trusted authenticated web origin create greater impact than reports opened as isolated local files. ]]>
Remediation
View remediation
``` 4. Calculate and independently verify the digest against the exact production artifact; do not use a placeholder digest. 5. Add a restrictive Content Security Policy that limits script sources to the report itself and the explicitly approved dependency location. 6. Establish a dependency update process that reviews release notes, validates checksums, and tests the precise artifact before changing versions. ]]>
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • 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 (10)

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The README presents the skill entirely as a Chinese-language reporting tool and frames the generated artifact as a fixed-format Chinese report. There is no indication that users may opt into another language or locale, which matches the policy category for language/locale constraints without user choice.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill explicitly instructs the agent to write an output file (黄金白银日报-YYYY-MM-DD.html) but does not declare any tool scope or allowed-tools restrictions. That mismatch can lead to overbroad file-write behavior, making it easier for an agent runtime to write files in unintended locations or with unintended names if the surrounding platform defaults are permissive.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest description specifies generating a Chinese daily report using Chinese phrases and output conventions, but does not indicate that the language is optional or based on user preference. This is a natural-language policy concern because it appears to impose a specific language/locale by default rather than offering a choice.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The HTML template explicitly sets lang="zh-CN" and uses a Chinese-only report title and section labels, which indicates the skill output is fixed to a specific language/locale. Under the policy, locale constraints should either be optional for the user or clearly documented as justified for a region-specific use case.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The template imports ECharts from a public CDN at render time, which creates a supply-chain and integrity risk: anyone able to tamper with the CDN response, exploit a compromised dependency release, or intercept traffic in a weak environment could execute arbitrary JavaScript in the generated report. Because this skill's purpose is only to generate a static daily market report, pulling third-party executable code from the network is not strictly necessary and increases attack surface beyond the stated scope.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

This JSON file embeds user-facing natural-language content entirely in Chinese, including date formatting and narrative text, with no indication that language selection is optional. The policy requires flagging language or locale constraints when the skill forces a specific language without user opt-in or clear justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The title and the rest of the template are written as fixed Chinese output requirements, and no language choice or opt-in is provided. Under the policy, forcing a specific language without user choice is a natural-language policy violation unless the locale restriction is explicitly justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This Python file contains natural-language documentation, CLI descriptions, warnings, and status output entirely in Chinese, indicating the skill is designed to operate in a fixed language/locale. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is clearly documented and justified, which is not present here.

Content

No source excerpt is available for this finding.

Dynamic import via __import__()

Medium
Category
Dangerous Code Execution
Confidence
75% confidence
Finding

Dynamic import() can load arbitrary modules at runtime, bypassing static analysis and potentially importing malicious code.

Content

Scanner excerpt · scripts/generate_report.py (reported line 74)May include surrounding context.

python
if missing:
        uniq = sorted(set(missing))
        print("警告: 以下占位符未在数据中提供,已保留原样: " + ", ".join(uniq), file=__import__('sys').stderr)

    with open(args.out, 'w', encoding='utf-8') as f:
        f.write(html)

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
97% confidence
Finding

This code file contains natural-language documentation and CLI output entirely in Chinese, including the module docstring and help text, with no indication that the user can choose another language. Under the stated policy, forcing a specific language without user opt-in is a locale-policy issue unless clearly justified as region-specific.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.