Back to skill

Security audit

my_stock_analysis_skill

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a coherent stock-analysis assistant, but it automatically stores sensitive portfolio data across sessions without clear user consent or protection details.

Review this skill before installing if you would provide real holdings, cost basis, account screenshots, or total capital. Use it only if you are comfortable with portfolio snapshots being saved locally, and consider deleting or protecting ~/.openclaw/memory/portfolio.json; do not treat its trade actions as personalized financial advice without independent review.

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
SKILL.md:163
Finding
Unprotected Plaintext Persistence of Sensitive Portfolio Data## Vulnerability Details **File Location**: `SKILL.md`, line 163 **Vulnerability Type**: Plaintext storage of sensitive financial data **Risk Level**: Medium **Complete Code Snippet**: ```text Each time Trade Actions are produced, save the portfolio snapshot to ~/.openclaw/memory/portfolio.json. On the next invocation, read it first and use it as the position baseline. If the file does not exist, ask the user to provide the initial portfolio. ``` ### Technical Analysis The Skill requires portfolio snapshots to be persisted across sessions in a predictable local JSON file. The stored information may include securities, share counts, cost bases, current values, profit or loss, and allocation percentages. No controls are specified for explicit user consent, file permissions, encryption, data minimization, retention, deletion, schema validation, ownership verification, or safe atomic updates. Consequently, the file may expose sensitive financial information to other local users or processes when default permissions are permissive. The integrity of future recommendations also depends on this file. If a process with access to the user's account can modify the JSON content, it may manipulate the portfolio baseline used by subsequent analyses. The Skill does not require validation of numeric ranges, ticker formats, file ownership, or unexpected fields before using stored state. ### Attack Path 1. The user invokes the Skill and receives Trade Actions. 2. The Skill writes a portfolio snapshot to the predictable path `~/.openclaw/memory/portfolio.json`. 3. A local user or process that already has sufficient filesystem access discovers the file. 4. For a confidentiality attack, the party reads the file and obtains portfolio holdings and related financial information. 5. For an integrity attack, the party modifies holdings, costs, capital, or allocation data. 6. During a later invocation, the Skill reads the altered snapshot as its po ...[truncated 788 chars]
Remediation
## Remediation Suggestions 1. Make persistent portfolio storage opt-in and obtain explicit user consent before the first write. 2. Default to session-only state when persistence is unnecessary. 3. Store only the minimum fields needed for subsequent analysis and exclude account identifiers or unrelated metadata. 4. Use platform-managed secure storage where available. If a local file is necessary, create the directory and file with owner-only permissions, such as `0700` for the directory and `0600` for the file. 5. Verify file ownership and reject symbolic links, unexpected file types, or files writable by other users. 6. Validate stored content against a strict schema, including permitted fields, ticker formats, finite numeric values, nonnegative share counts, and reasonable value limits. 7. Use atomic writes through a securely created temporary file in the same protected directory, followed by an atomic rename. 8. Apply integrity protection or authenticated encryption when supported by platform key management. 9. Define a retention period and provide user-facing commands to inspect, replace, export, and delete stored portfolio data. 10. If ownership, permissions, integrity, or schema validation fails, do not use the file for financial recommendations; request a fresh portfolio confirmation from the user.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (4)

Natural-Language Policy Violations

High
Confidence
94% confidence
Finding
The skill description mandates Chinese-language behavior without asking for user preference, which can cause miscommunication about trading instructions, risks, and disclosures. In a financial-analysis context, language mismatch increases the chance that users misunderstand recommendations, consent notices, or data-handling behavior.

Context-Inappropriate Capability

Medium
Confidence
93% confidence
Finding
The skill instructs the agent to persist a user's portfolio snapshot to ~/.openclaw/memory/portfolio.json across sessions, even though this storage capability is not clearly justified in the declared interface or disclosed to the user. Portfolio holdings, costs, and trading history are sensitive financial data, and retaining them locally increases the risk of unintended reuse, leakage, or access by other skills/processes.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The skill stores portfolio data locally but does not warn the user in the description or operating instructions that their financial information will persist beyond the current session. This lack of transparency prevents informed consent and can lead users to disclose holdings and cost basis without understanding the retention and privacy implications.

Ssd 3

Medium
Confidence
94% confidence
Finding
Natural-language instructions to retain a user's portfolio across sessions create a data retention risk because future runs may expose prior holdings, cost basis, and allocation information to unrelated prompts or users sharing the environment. In a stock-analysis skill, this context makes the issue more sensitive because the retained data is financially private and can reveal investment strategy and net-worth signals.

Static analysis

No suspicious patterns detected.