Back to skill

Security audit

Invest Analyzer

Security checks for vulnerabilities and agentic risk

Overview

This is a transparent stock-analysis skill with an avoidable API-key handling weakness, but no hidden, destructive, or purpose-mismatched behavior was found.

Before installing, configure any Baidu search key through a secure secret mechanism where possible. If a file is unavoidable, restrict permissions and avoid pasting real keys into shell commands. Treat the reports as research support only, verify figures against official filings, and do not let the skill place trades or access brokerage accounts.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Warning
Location
prompts/init.md:18
Finding
Insecure API Credential Handling in Documentation## Vulnerability Details **File Location**: `prompts/init.md:18-20`; `README.md:68-75` **Vulnerability Type**: Plaintext credential exposure and insecure secret handling **Risk Level**: Medium ### Vulnerable Code Snippets `prompts/init.md:18-20`: ```markdown ### 推荐方式:baidu-search(首选) ```bash BAIDU_API_KEY="你的APIKey" python3 skills/baidu-search/scripts/search.py '{"query":"股票名 2024年 财报 净利润 经营现金流", "search_recency_filter":"year"}' ``` ``` `README.md:68-75`: ```markdown ### 0) 前提:搜索 Key 的放置(稳定,不依赖 shell / launchd) 推荐把百度 AI Search 的 key 放到固定文件路径: - `~/.openclaw/env/BAIDU_API_KEY` - 文件内容可以是纯 key(单行),也可以是 `BAIDU_API_KEY=...` 的 .env 风格。 这样无论是后台 gateway / cron / skill 运行,都不会因为“终端能 echo、服务拿不到”而翻车。 ``` ### Technical Analysis The initialization prompt encourages users to place an API key directly in an interactive shell command. Such commands may be retained in shell history, terminal logs, session recordings, support transcripts, or automation logs. Depending on the operating system and process-inspection permissions, environment variables may also be visible to other processes running under the same account or to privileged local processes. The README recommends storing the key as plaintext at a predictable filesystem path but does not require restrictive ownership and permissions. If the file is created under an unsafe `umask`, inherited from another user, included in backups, or accessible to another local process, the credential may be disclosed. The recommendation that gateways, cron jobs, and Skills all use this file broadens the number of components that may access it. The project does not contain code that directly exfiltrates this credential, and exploitation requires local access, exposed logs, or another compromised process. Nevertheless, the documented procedure creates avoidable credential-exposure risks. ### Attack Path 1. A user follows `prompts/init.md` and substitutes a real Baidu API key into the inline shell command, or follows `README. ...[truncated 1052 chars]
Remediation
## Remediation Suggestions 1. Remove real-secret placeholders from inline command examples. Instruct users to configure credentials through the dependency's supported secure credential mechanism before running the command. 2. Prefer an operating-system secret store or managed secret facility over a plaintext file. 3. If file-based storage is unavoidable: - Create the directory and file with restrictive permissions, such as directory mode `0700` and file mode `0600`. - Verify that the file is owned by the expected account before reading it. - Reject files that are symbolic links or are writable/readable by unintended users. - Use an atomic file-creation procedure under a restrictive `umask`. 4. Do not print credentials in commands, logs, exceptions, debugging output, process titles, or generated reports. 5. Limit credential access to the specific process that requires it instead of making it broadly available to gateways, cron jobs, and unrelated Skills. 6. Document credential rotation and revocation procedures in case the key was previously entered into shell history or stored with unsafe permissions. 7. Advise affected users to remove historical commands securely where practical, inspect automation logs, rotate exposed keys, and review API usage for unauthorized activity.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (13)

Credential Access

High
Category
Privilege Escalation
Content
推荐把百度 AI Search 的 key 放到固定文件路径:

- `~/.openclaw/env/BAIDU_API_KEY`
  - 文件内容可以是纯 key(单行),也可以是 `BAIDU_API_KEY=...` 的 .env 风格。

这样无论是后台 gateway / cron / skill 运行,都不会因为“终端能 echo、服务拿不到”而翻车。
Confidence
95% confidence
Finding
The documentation instructs users to place an API key in a predictable plaintext file under ~/.openclaw/env/BAIDU_API_KEY, including .env-style storage. Storing credentials in a fixed, discoverable path increases the risk of accidental exposure to other skills, local users, backups, logs, or tooling that reads home-directory dotfiles, especially in multi-skill or shared execution environments.

Natural-Language Policy Violations

Medium
Confidence
89% confidence
Finding
The README is written as a Chinese-only user guide and presents the skill's interaction model entirely in Chinese, with no indication that users may choose another language or locale. Under the policy, language constraints should be opt-in or clearly justified; this file does not provide such an option or justification.

Vague Triggers

Medium
Confidence
95% confidence
Finding
The activation example uses the phrase "帮我分析[股票代码/名称]", which is a very general request pattern and could collide with ordinary conversation outside a narrowly scoped command context. The README does not provide stricter trigger constraints, negative examples, or a bounded invocation context to reduce unintended activation.

Natural-Language Policy Violations

Medium
Confidence
89% confidence
Finding
The entire skill description, examples, and recommended queries are written as Chinese-only interactions, and the examples assume Chinese-language prompts. There is no indication that users may choose another language, nor a documented justification that the skill is intentionally limited to a China-specific locale for compliance or operational reasons.

Vague Triggers

Medium
Confidence
95% confidence
Finding
The skill exposes broad natural-language invocation examples such as '帮我分析腾讯控股' and similar generic phrasing that could cause the skill to activate unintentionally when a user is having a general investment conversation. In an agent environment, overly generic triggers increase the chance of misrouting, unexpected tool use, and unsafely initiating network retrieval or financial analysis workflows without clear user intent boundaries.

Natural-Language Policy Violations

Medium
Confidence
93% confidence
Finding
The file is entirely written as a Chinese-only decision template and output format, including fixed Chinese section headers and instructions, with no indication that users may choose another language. Under the policy rule, a skill that implicitly requires a specific language without opt-in is a natural-language policy violation.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
The skill is written entirely in Chinese and does not offer any language selection or fallback, which can exclude or confuse users who do not understand Chinese. In a financial-analysis skill, this can increase the risk of user misunderstanding of workflows, disclaimers, or investment-related caveats, though it is primarily an accessibility and usability issue rather than a direct security exploit.

Natural-Language Policy Violations

Medium
Confidence
97% confidence
Finding
The entire skill is written as mandatory Chinese operational guidance and the output format is specified only in Chinese, with no indication that users may choose another language. This creates a language/locale policy concern because it implicitly enforces a specific language without user opt-in or a documented region-specific justification.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
This markdown skill file presents all instructions, labels, and output format requirements exclusively in Chinese. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale constraint is explicitly documented and justified, which is not present here.

Natural-Language Policy Violations

Medium
Confidence
93% confidence
Finding
This markdown file contains user-facing instructions and fields exclusively in Chinese, with no indication that the skill is region-specific or that users may choose another language. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation.

Natural-Language Policy Violations

Low
Confidence
87% confidence
Finding
The display name and description are written entirely in Chinese, indicating a fixed language choice in user-facing metadata. There is no indication in the manifest that users can choose another language or that the locale restriction is intentional and documented as region-specific.

Natural-Language Policy Violations

Low
Confidence
90% confidence
Finding
This markdown file presents all instructions and labels only in Chinese, which can constitute a language/locale policy issue when the skill does not offer an explicit user language choice. There is no visible statement that the template is region-specific or that Chinese is optional.

Natural-Language Policy Violations

Low
Confidence
93% confidence
Finding
该 markdown 模板全文以中文呈现,未见提供用户语言选择、可切换语言说明,或明确说明这是仅面向中文用户的区域性模板。根据规则,强制特定语言而无用户选择可构成自然语言层面的组织政策问题。

Static analysis

No suspicious patterns detected.