Back to skill

Security audit

Stock Reporting Interaction

Security checks for vulnerabilities and agentic risk

Overview

This stock assistant is not clearly malicious, but it asks for persistent agent behavior and sensitive financial memory without enough scoping or cleanup controls.

Review before installing. Only use this skill if you are comfortable with it storing sensitive investment records in persistent memory, modifying agent-level instructions, creating recurring scheduled jobs, and sending reports through channels. Require explicit confirmation for cron jobs and memory writes, restrict file paths, verify the external stock_data_adapter source, and fix the dashboard HTML injection before use in a shared or untrusted environment.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • System PersistenceInstalls backdoors, hooks, services, or scheduled tasks that survive the run
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
Findings (5)

T06 · System Persistence

Error
Location
SKILL.md:508
Finding

Persistent Scheduled Agent Execution Through Cron Jobs

Content
View full analysis
Remediation
View remediation

T01 · Skill Instruction Hijacking

Warning
Location
SKILL.md:335
Finding

Persistent Modification of Agent Instructions and Long-Term Financial Memory

Content
View full analysis
[--params ...] ``` ```markdown Use the OpenClaw Memory mechanism (memory/YYYY-MM-DD.md and MEMORY.md) to build a persistent investment journal. Persisted information includes: - Trades and transaction rationales - Market observations - Position decisions - Risk preferences - Maximum position sizing - Stop-loss rules - Watch lists - Historical performance - Lessons inferred from prior activity ``` ### Technical Analysis The Skill instructs the Agent to write task-specific behavioral rules into `AGENTS.md`, a persistent instruction file, rather than keeping them scoped to the current Skill invocation. It also directs the system to place investment records and derived behavioral conclusions into daily and long-term Agent memory. User-provided journal entries, observations, trade rationales, and decisions can contain instruction-like text. If persistent memory is later incorporated into an Agent prompt without strict separation between instructions and data, such content can influence future sessions. Storing detailed holdings, risk preferences, transaction history, and performance conclusions in general-purpose Agent memory also expands the retention scope of sensitive financial information. The audited package does not contain the documented `jo ...[truncated 1170 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
canvas/dashboard.html:144
Finding

DOM-Based Cross-Site Scripting in the Canvas Dashboard

Content
View full analysis
{ const cls = idx.change >= 0 ? 'up' : 'down'; const sign = idx.change >= 0 ? '+' : ''; return `
${idx.name}
${idx.value.toFixed(2)}
${sign}${idx.change.toFixed(2)}%
`; }).join(''); document.getElementById('indices').innerHTML = indicesHtml; const sectorsHtml = (data.sectors || []).slice(0, 8).map(s => { const cls = s.change >= 0 ? 'up' : 'down'; const width = Math.min(Math.abs(s.change) * 10, 100); const bgColor = s.change >= 0 ? 'var(--up)' : 'var(--down)'; return `
${s.name}
${s.change >= 0 ? '+' : ''}${s.change.toFixed(2)}%
`; }).join(''); document.getElementById('sectors').innerHTML = sectorsHtml; const capitalHtml = (data.capital || []).map(c => { const cls = c.value >= 0 ? 'up' : 'down'; return `
${c.label}
${c.value >= 0 ? '+' : ''}${c.value.toFixed(1)}
${c.trend}
`; }).join(''); document.getElementById('capital').innerHTML = capitalHtml; const alertsHtml = (data.alerts || []).map(a => { const cls = a.level === 'danger' ? ...[truncated 2100 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
tools/chart_renderer.py:406
Finding

Unrestricted Local File Read and Arbitrary File Overwrite Through CLI Paths

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
tools/report_generator.py:12
Finding

Unverified External Python Module Loaded Through Runtime Path Precedence

Content
View full analysis
Remediation
View remediation
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 (14)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

声明描述的是一个较完整的股票投资分析与助理系统,涵盖报告生成、图表渲染、日志管理和问答交互。实际代码仅是 tools/chart_renderer.py,一个专注于可视化输出的渲染组件。它使用 matplotlib/mplfinance 读取输入数据并保存图片,没有看到生成盘前/盘后/研报/周报文本报告的逻辑,也没有任何日志存储、检索、编辑或会话问答处理。虽然声明中的“渲染可视化图表”与该代码相符,但整体描述明显比代码能力宽泛得多。另一个细节是,命令行参数允许多种 type 取值,但分支逻辑实际上只对 kline 和 dashboard 做了专门处理,其它类型都回退成 render_kline,因此代码行为也未完全达到自身注释/参数枚举暗示的能力范围。综上,该代码块仅部分匹配声明,存在明显描述—行为不一致。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

该代码块的核心用途与“生成股票分析报告”部分基本一致,但声明描述的能力范围明显大于实际实现。实际代码只做报告文本组装和输出,且依赖数据适配器获取行情数据;没有任何可视化图表渲染、投资日志管理、自然语言问答代理或周报/盘前盘后专项逻辑。虽然描述中包含的部分能力(报告生成)与代码一致,但整体描述会让人预期这是一个更完整的投资助理/分析系统,而该代码只是其中的报告生成子模块,因此应判定为描述与实际行为存在不匹配。

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill describes capabilities that write persistent data, including investment logs under memory/YYYY-MM-DD.md and MEMORY.md, but it does not declare an explicit tool scope such as permissions or allowed-tools. In an agent environment, missing scope boundaries can let the skill perform file writes more broadly than reviewers or orchestrators expect, increasing the chance of unintended persistence, file clobbering, or abuse through prompt-triggered actions.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

Broad trigger phrases for weekly summaries can cause accidental activation from ordinary conversation, leading the agent to perform reporting workflows or scheduled-style actions without clear user intent. In this skill, unintended activations could also cascade into data retrieval, file generation, or persistent logging behaviors described elsewhere.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

Ambiguous chart trigger phrases such as casual requests to 'look at the trend' are prone to overlap with normal conversation, which can invoke chart rendering unexpectedly. While lower severity, this still matters because rendering may consume resources, create files, or expose internal workflow behavior without sufficiently explicit consent.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The question-answer triggers are underspecified for a financial assistant handling analysis, journaling, alerts, and recommendations. Overbroad activation in this context is more dangerous because a simple conversational question could route into high-impact behaviors like investment advice, memory writes, or alert creation without robust intent confirmation.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill's policy says it will never provide concrete buy/sell instructions, yet the actionable example includes explicit entry, stop-loss, and target prices. This contradiction weakens safety controls and can cause the agent to generate regulated or high-risk financial advice despite stated guardrails, especially in ambiguous user interactions.

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", uses Chinese-only UI text throughout, and formats timestamps with toLocaleString('zh-CN'). This enforces a specific language/locale experience without any visible opt-in or explanation that the dashboard is intentionally region-specific.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This code file contains user-facing natural-language text that fixes the skill's interface and description to Chinese only, including the module docstring and command description. Under the policy, forcing a specific language without offering user choice is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This code file contains natural-language descriptions and user-facing output entirely in Chinese, including the module docstring and CLI help text, with no indication that the skill is region-specific or that users can opt into another language. Under the language/locale policy, forcing a specific language without user choice is a policy concern.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

The module docstring says the renderer supports K线图、技术指标面板、估值分位图、雷达图、资金热力图等, but no capital heatmap renderer exists anywhere in this file. The contradiction is reinforced by the CLI exposing capital-heatmap while the dispatcher never implements it, so the documentation overstates the module's real capabilities.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill manifest describes professional stock-report visualization features, and the CLI exposes types such as capital-heatmap, sector-rotation, portfolio-pie, and backtest-curve. However, this file only implements kline, dashboard, valuation-band, and radar renderers, and the main dispatch falls back to render_kline for unsupported types. This creates a clear mismatch between claimed behavior and actual operations.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The docstring and module header describe this component as generating stock analysis reports, which implies substantive analysis output. However, the stock report's '操作建议' section is hardcoded as '待综合技术面和基本面后生成', indicating the advertised analysis is not actually implemented there.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The manifest emphasizes generating investment reports, charts, logs, and interactive assistant behavior, while this module's documented purpose is report generation. In addition to producing report text, the CLI persists output to a user-specified file path, which is a broader side effect than pure generation and is not mentioned in the module documentation.

Content

No source excerpt is available for this finding.