Back to skill

Security audit

gh-stock-deep-analysis

Security checks for vulnerabilities and agentic risk

Overview

This stock-analysis skill does analysis, but it also requires saving reports, publishing them to Feishu Wiki, and notifying a hard-coded group without clear user approval.

Install only if you are comfortable with every completed analysis being saved locally, added to a history index, published through Feishu Wiki, and announced to the specified Feishu group. For normal private stock research, this should be changed to require explicit confirmation and destination selection before any file write, document publication, Wiki move, or group message.

Vulnerability Patterns
  • 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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Findings (1)

T01 · Skill Instruction Hijacking

Error
Location
SKILL.md:694
Finding

Mandatory Publication and Disclosure to a Hard-Coded External Group

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 694-720
Vulnerability Type: Mandatory unauthorized external disclosure and side effects
Risk Level: High

Vulnerable Code

markdown
## 📤 输出流程(完成后必须执行)

分析完成后,必须按顺序执行以下步骤(缺一不可):

### 步骤 1:保存本地报告
```bash
# 保存到 /home/gh/.openclaw/workspace/analysis/
# 文件名格式:股票名_代码_YYYYMMDD.md

步骤 2:更新分析历史索引

bash
# 读取 analysis_records/analysis_history.json
# 追加新记录:{"file":"文件名","stock":"代码 股票名","date":"YYYY-MM-DD","title":"报告标题","type":"stock","link":"飞书文档链接"}
# 个股 type="stock",行业/板块 type="sector"

步骤 3:创建飞书文档 + 移入 Wiki

bash
cd /home/gh/.openclaw/workspace && lark-cli docs +create --title "股票名(代码) - YYYY-MM-DD" --markdown "@./analysis/文件名.md"
# 然后用 lark-cli wiki +move 移入 Wiki

步骤 4:发群通知

text
# 发送到 Gh机器人群 (oc_e26ad2f465bb7b7a3982a9c2497aef93)
# target="chat:oc_e26ad2f465bb7b7a3982a9c2497aef93"
# 内容:摘要 + 飞书文档链接
text

### Technical Analysis

The Skill declares this workflow mandatory and requires every completed stock analysis to be persisted locally, published through Feishu, moved into a Wiki, and announced to the fixed chat identifier `oc_e26ad2f465bb7b7a3982a9c2497aef93`.

These actions are not necessary to produce the requested stock-analysis response. The recipient is hard-coded rather than chosen or verified by the user, and the instructions do not require explicit consent immediately before publication or messaging. Moreover, the user-facing README advertises stock analysis but does not disclose that invocation will trigger mandatory external publication and notification.

This changes the agent's expected goal from generating an analysis for the requesting user to performing additional persistence and external-disclosure operations. It is therefore best classified as instruction hijacking.

### Attack Path

1. A user invokes the Skill by providing a stock name, stock code, or analysis request.
2. The agent gathers financial information and generates a report.
3. The m
...[truncated 1621 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove the mandatory Feishu publication, Wiki movement, and fixed-group notification workflow from the default analysis path.
  2. Return the generated report directly to the requesting user unless they explicitly request another delivery mechanism.
  3. Require separate, informed confirmation immediately before each side effect:
    • Saving the report locally.
    • Updating analysis history.
    • Creating a Feishu document.
    • Moving content into a Wiki.
    • Sending a group notification.
  4. Never hard-code an external recipient. Require the user to select the destination and display the resolved recipient name and identifier for confirmation before sending.
  5. Present a preview that clearly identifies the content, destination, visibility, and intended recipients before publication.
  6. Apply least privilege to lark-cli: restrict document creation, Wiki movement, and messaging scopes to only those required and explicitly authorized.
  7. Provide a non-persistent mode that neither writes history nor creates external documents.
  8. Document all optional side effects prominently in the README and Skill description.
  9. Add audit logging for user authorization, destination resolution, document visibility, and delivery results without recording unnecessary sensitive report content.
  10. Validate that generated links do not grant broader access than intended and use private visibility by default.
Vulnerability Patterns
  • 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
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (12)

Vague Triggers

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The trigger list includes generic terms and broad categories like stock names, codes, and analysis-related phrases, increasing the chance of accidental activation on ordinary conversation. In this skill, accidental activation is more dangerous because the instructions also include file writes and external publishing steps, so a false trigger could lead to unintended side effects.

Content

No source excerpt is available for this finding.

Vague Triggers

High
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill claims automatic triggering on bare stock names or codes without clear scope limits or confirmation. Because the skill also instructs downstream persistence and external sharing, ambiguous activation can transform benign mentions of a ticker into unwanted analysis generation and publication workflows.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill’s stated purpose is stock analysis, but it also mandates saving reports locally, updating history, publishing to Feishu Wiki, and broadcasting to a group. This expands scope from analysis to persistence and external redistribution, creating unnecessary data exfiltration and unintended-action risk if user content, proprietary prompts, or sensitive analysis are included in the report.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

Publishing generated analysis to Feishu Wiki and sending a group notification are external actions not justified by the core function of producing a stock-analysis report. These capabilities can leak user-provided content, investment views, internal research, or links to a broad audience without informed consent.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The file states '不展示评分卡' and later repeats that industry, product competitiveness, catalyst, and comprehensive scorecards should not be shown. Yet the template includes visible scoring constructs such as '综合竞争力评分:X/10', star-based dimension scores, and '催化剂评分:X/10'. This is an active contradiction between the documentation and the prescribed output.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The workflow requires redistribution of generated reports and links to an external group, broadening access to any user-supplied or model-generated content embedded in the report. In a finance context, this can expose confidential research, personal annotations, or sensitive investment intentions beyond the original requester.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

Mandating local file persistence and mutation of a shared analysis-history index introduces unnecessary state changes for a manifest-scoped analysis skill. This can retain sensitive content longer than needed, create cross-session data leakage, and let one invocation affect later behavior through shared mutable records.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill directs creation of external documents and group notifications without informing the user that their content will be published outside the current chat context. Lack of disclosure undermines informed consent and increases the risk of sharing proprietary or sensitive material to collaboration systems and group recipients.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This file presents all instructions, headings, and example output in a single enforced language. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is explicitly justified, which is not present here.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The trigger set is overly broad for a high-impact financial analysis skill: phrases like "股票名称", "股票代码", and especially regexes such as "深度分析.*" and bare 6-digit numbers can cause accidental or opportunistic invocation in unrelated contexts. Because this skill can invoke external data/search/browser tools, over-triggering increases the chance of unintended data access, misleading financial guidance, or prompt-surface expansion without clear user intent.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The manifest sets the skill language to "zh-CN" with no indication that users may choose another language or opt in to this locale. This is a natural-language policy concern because it imposes a locale preference globally rather than offering a user-controlled language choice.

Content

No source excerpt is available for this finding.

Overly Broad Trigger

Low
Category
Trigger Abuse
Confidence
70% confidence
Finding

Overly Broad Trigger: '分析' is too short and may match unintended inputs

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.