Back to skill

Security audit

股票分析助手

Security checks for vulnerabilities and agentic risk

Overview

This stock-analysis skill mostly does what it says, but it exposes credential-like values in documentation and passes broad environment secrets to external helper processes.

Review carefully before installing. Rotate the exposed API keys if they were ever real, remove the release report secrets, restrict child-process environments to only the required keys, validate or remove TUSHARE_API_URL, and make external search/LLM use explicit to users.

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

T09 · Insecure Skill Coding Practices

Error
Location
RELEASE_REPORT.md:23
Finding

Credential-like secrets remain exposed in release documentation

Content
View full analysis
Remediation
View remediation
" ``` 4. Run secret-scanning tools against the complete Git history and all distribution artifacts. 5. Add automated secret scanning to CI and block releases when credential patterns are detected. 6. Document secret rotation and incident-response procedures. 7. Never include real credentials in migration examples, test fixtures, screenshots, or release notes. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
scripts/analyze_stock.py:25
Finding

Tushare credential can be redirected to an arbitrary API endpoint

Content
View full analysis
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Error
Location
scripts/analyze_stock.py:653
Finding

Complete runtime environment is passed to separately installed search Skills

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
scripts/analyze_stock.py:15
Finding

Dependency installation guidance is not reproducible or integrity-verified

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • 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
Findings (46)

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · README.md (reported line 24)May include surrounding context.

bash
# 复制示例文件
cd ~/.openclaw/workspace/skills/stock-analysis
cp .env.example .env

# 编辑 .env 文件,填入你的 TUSHARE_TOKEN
nano .env

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · RELEASE_REPORT.md (reported line 147)May include surrounding context.

bash
# 复制示例文件
cd ~/.openclaw/workspace/skills/stock-analysis
cp .env.example .env

# 编辑 .env 文件,填入你的 TUSHARE_TOKEN
nano .env

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · README.md (reported line 26)May include surrounding context.

cd ~/.openclaw/workspace/skills/stock-analysis cp .env.example .env

编辑 .env 文件,填入你的 TUSHARE_TOKEN

nano .env

text

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · README.md (reported line 27)May include surrounding context.

cd ~/.openclaw/workspace/skills/stock-analysis cp .env.example .env

编辑 .env 文件,填入你的 TUSHARE_TOKEN

nano .env

text

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · RELEASE_REPORT.md (reported line 76)May include surrounding context.

cd ~/.openclaw/workspace/skills/stock-analysis cp .env.example .env

编辑 .env 文件,填入你的 TUSHARE_TOKEN

nano .env

text

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · RELEASE_REPORT.md (reported line 149)May include surrounding context.

cd ~/.openclaw/workspace/skills/stock-analysis cp .env.example .env

编辑 .env 文件,填入你的 TUSHARE_TOKEN

nano .env

text

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · RELEASE_REPORT.md (reported line 150)May include surrounding context.

cd ~/.openclaw/workspace/skills/stock-analysis cp .env.example .env

编辑 .env 文件,填入你的 TUSHARE_TOKEN

nano .env

text

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · RELEASE_REPORT.md (reported line 186)May include surrounding context.

cd ~/.openclaw/workspace/skills/stock-analysis cp .env.example .env

编辑 .env 文件,填入你的 TUSHARE_TOKEN

nano .env

text

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · RELEASE_REPORT.md (reported line 191)May include surrounding context.

cd ~/.openclaw/workspace/skills/stock-analysis cp .env.example .env

编辑 .env 文件,填入你的 TUSHARE_TOKEN

nano .env

text

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · SKILL.md (reported line 71)May include surrounding context.

cd ~/.openclaw/workspace/skills/stock-analysis cp .env.example .env

编辑 .env 文件,填入你的 TUSHARE_TOKEN

nano .env

text

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · SKILL.md (reported line 72)May include surrounding context.

cd ~/.openclaw/workspace/skills/stock-analysis cp .env.example .env

编辑 .env 文件,填入你的 TUSHARE_TOKEN

nano .env

text

Ssd 3

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The report embeds full example values for TUSHARE_TOKEN, BAIDU_API_KEY, and TAVILY_API_KEY in plain text. Even if described as 'before cleanup,' publishing real-looking secret values in documentation is a direct sensitive-data exposure that can enable unauthorized API use, billing abuse, or downstream compromise if the credentials were ever valid.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The skill is presented as a stock-analysis helper, but the content indicates broader behavior including external search/news retrieval and subprocess execution beyond plain financial-data lookup. This mismatch can mislead users and policy layers about what data leaves the system and what code paths may run, increasing the risk of undisclosed data exfiltration or unexpected command execution.

Content

No source excerpt is available for this finding.

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
98% confidence
Finding

Using os.environ.copy() for subprocess execution copies the entire process environment, not just the needed API key. This can expose unrelated secrets, tokens, proxy settings, and internal configuration to the called sibling skill, which is especially risky because that child code is outside this skill's trust boundary.

Content

Scanner excerpt · scripts/analyze_stock.py (reported line 658)May include surrounding context.

python
import os
        
        # 设置环境变量(从系统环境读取)
        baidu_env = os.environ.copy()
        if not baidu_env.get('BAIDU_API_KEY'):
            baidu_env['BAIDU_API_KEY'] = ""  # 请通过环境变量配置 BAIDU_API_KEY

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
98% confidence
Finding

This second full environment copy passes all ambient variables to the Tavily subprocess. Because the child process is a separate Node-based tool with its own dependencies and possible network access, inherited secrets may be exposed or misused well beyond the stock-analysis function.

Content

Scanner excerpt · scripts/analyze_stock.py (reported line 662)May include surrounding context.

python
if not baidu_env.get('BAIDU_API_KEY'):
            baidu_env['BAIDU_API_KEY'] = ""  # 请通过环境变量配置 BAIDU_API_KEY
        
        tavily_env = os.environ.copy()
        if not tavily_env.get('TAVILY_API_KEY'):
            tavily_env['TAVILY_API_KEY'] = ""  # 请通过环境变量配置 TAVILY_API_KEY

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
98% confidence
Finding

Another os.environ.copy() occurs before invoking an external search helper, repeating the broad secret-exposure pattern. Since this path is used for business-information enrichment rather than core stock retrieval, the extra credential exposure is unnecessary and increases the chance of accidental leakage.

Content

Scanner excerpt · scripts/analyze_stock.py (reported line 983)May include surrounding context.

python
import json
        import os
        
        baidu_env = os.environ.copy()
        if not baidu_env.get('BAIDU_API_KEY'):
            baidu_env['BAIDU_API_KEY'] = ""  # 请通过环境变量配置 BAIDU_API_KEY

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
98% confidence
Finding

This environment copy again forwards the entire parent environment into a child search process. Repeated ambient-secret propagation across multiple subprocesses substantially raises risk because any one helper, dependency, or log path could disclose credentials unrelated to stock analysis.

Content

Scanner excerpt · scripts/analyze_stock.py (reported line 1079)May include surrounding context.

python
import json
        import os
        
        baidu_env = os.environ.copy()
        if not baidu_env.get('BAIDU_API_KEY'):
            baidu_env['BAIDU_API_KEY'] = ""  # 请通过环境变量配置 BAIDU_API_KEY

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The README instructs users to configure third-party API keys for Baidu and Tavily to support news and deep-analysis features, but it does not clearly warn that stock queries and related user data may be transmitted to external services. This creates a transparency and privacy risk because users may unknowingly expose their prompts, ticker interests, or investment research activity to third parties.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The listed triggers include broad phrases such as "看股票", "stock", "买点", "卖点", and "仓位" without any contextual constraints or exclusion conditions. In a markdown file, this creates an ambiguous activation scope that could cause unintended invocation during ordinary financial discussion.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding

The skill declares executable and environment-backed capabilities via python3 and required API-key environment variables, but it does not declare an explicit tool scope such as permissions or allowed-tools. That weakens least-privilege boundaries and makes it harder for the platform or user to understand what execution and data-access surface the skill actually needs.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The trigger set includes broad everyday phrases that can cause the skill to auto-activate in contexts where the user did not intend to invoke an external-data, code-capable workflow. In this skill, accidental activation is more concerning because it may lead to external requests and processing of user queries by third-party services.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill description does not clearly warn that stock queries, and potentially related user context, may be sent to external services such as Tushare, Baidu, or Tavily. This creates a transparency and privacy problem because users may disclose sensitive investment interests without informed consent.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill sends stock-related context to an external LLM service via ctx.claw.llm.chat without informing the user or obtaining consent. Even if the data is not highly sensitive by default, user-supplied identifiers, investment interests, and derived financial context may be transmitted to third-party infrastructure, creating a privacy and transparency risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This second LLM call again transmits compiled stock analysis context to an external model without explicit disclosure, compounding the privacy issue and increasing unnecessary third-party data exposure. Repeated external transmission also broadens the audit/compliance surface, especially in a financial-analysis skill where user intent and holdings interest may be sensitive.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This markdown file presents all user-facing guidance exclusively in Chinese, and there is no indication that the user can select a preferred language or that the skill is intentionally limited to a Chinese-speaking or region-specific context. Under the policy rule for natural-language violations, forcing a specific language without user opt-in is in scope.

Content

No source excerpt is available for this finding.