Back to skill

Security audit

Earnings Tracker

Security checks for vulnerabilities and agentic risk

Overview

This financial-report scanner has a plausible purpose, but its documentation overpromises features while the script writes persistent output to a fixed OpenClaw memory path without clear disclosure or user control.

Review this skill before installing. It appears intended to scan Chinese A-share earnings data, but do not expect the advertised U.S. market scanning, scheduling, or Discord/Telegram delivery to work as documented. Run it only in an isolated environment, pin and review akshare, and change the script to use an explicit user-approved output path outside shared agent memory unless persistent storage is actually desired.

Vulnerability Patterns
  • 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
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (2)

T08 · Insecure Dependencies

Warning
Location
SKILL.md:52
Finding
Unpinned Third-Party Dependency Installation<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, line 52 **Vulnerability Type**: Unpinned dependency installation **Risk Level**: Medium ### Vulnerable Code ```bash pip install akshare ``` ### Technical Analysis The installation instructions retrieve the latest available `akshare` release without specifying an exact version or verifying package integrity. Consequently, the code installed by users can change after this skill has been reviewed. This is a supply-chain weakness because a compromised upstream release, maintainer account, package distribution channel, or transitive dependency could introduce malicious code. Python packages may execute code during installation and subsequently run with the privileges of the user invoking the scanner. The project also lacks a lock file, hash-verified requirements file, or documented trusted version. The package metadata does not declare the Python dependency or constrain its transitive dependency graph. ### Attack Path 1. An attacker compromises the upstream `akshare` package, one of its dependencies, or the associated publishing credentials. 2. The attacker publishes a malicious version to the package index. 3. A user follows the documented `pip install akshare` command after that release becomes current. 4. `pip` downloads and installs the malicious release or dependency without a version or hash validation failure. 5. Malicious installation hooks or imported package code execute with the installing or scanning user's privileges. 6. The payload could read accessible files, alter scanner results, steal credentials, or establish persistence outside this project. This attack requires compromise of the upstream package or its dependency chain; no evidence in the audited files shows that the current `akshare` package is malicious. ### Impact Assessment Successful exploitation would provide code execution under the account that installs or runs the scanner. The accessible scope would include that ...[truncated 203 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Pin `akshare` and all transitive dependencies to reviewed versions. - Maintain dependencies in a lock file or hash-verified requirements file, for example: ```text akshare==REVIEWED_VERSION \ --hash=sha256:REVIEWED_DISTRIBUTION_HASH ``` - Install with hash enforcement: ```bash python3 -m pip install --require-hashes -r requirements.txt ``` - Review dependency updates before changing pins and use automated vulnerability and provenance checks. - Install dependencies inside an isolated virtual environment as an unprivileged user. - Avoid using `sudo pip` or otherwise installing the scanner's dependencies with administrative privileges. - Declare the Python runtime requirements explicitly instead of relying only on prose installation instructions. ]]>

T09 · Insecure Skill Coding Practices

Note
Location
scripts/earnings_scanner.py:160
Finding
Unsafe Hard-Coded Write into the Agent Workspace<![CDATA[ ## Vulnerability Details **File Location**: `scripts/earnings_scanner.py`, lines 160–162 **Vulnerability Type**: Unvalidated persistent file overwrite and symbolic-link following **Risk Level**: Low ### Vulnerable Code ```python output_file = "/Users/xufan65/.openclaw/workspace/memory/earnings-calendar.json" with open(output_file, "w", encoding="utf-8") as f: json.dump(result, f, ensure_ascii=False, indent=2) ``` ### Technical Analysis The scanner unconditionally opens a fixed path in the agent's `memory` workspace with truncating write mode. This behavior is not configurable and is not disclosed as a required filesystem permission in the runtime instructions. Python's ordinary `open(..., "w")` operation follows symbolic links and truncates an existing target. The code does not verify that: - the destination is a regular file; - the resolved path remains within an approved output directory; - the destination is not a symbolic link; - the existing file belongs to this skill; or - the write can be completed atomically. If another local process or user can modify the destination entry or its parent directory, it can replace `earnings-calendar.json` with a symbolic link. Running the scanner would then overwrite the linked target with JSON data, subject to the scanner user's filesystem permissions. Although the path contains a directory named `memory`, the written data consists of timestamps and financial reports rather than attacker-controlled agent instructions. The audited evidence therefore does not establish agent memory poisoning under T02. ### Attack Path 1. An attacker obtains write access to `/Users/xufan65/.openclaw/workspace/memory/` or can replace `earnings-calendar.json`. 2. The attacker creates a symbolic link named `earnings-calendar.json` pointing to another file writable by the scanner user. 3. The user invokes `python3 scripts/earnings_scanner.py` or `npm run scan`. 4. `open(..., "w")` follows the link and truncates the linke ...[truncated 797 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Remove the developer-specific absolute path. - Require an explicit output path or derive it from a documented application data directory. - Resolve and validate the destination against an approved base directory. - Ensure the output directory is owned by the current user and is not writable by untrusted users. - Reject symbolic links and non-regular destination files. - Write to a securely created temporary file in the same directory, flush and synchronize it, and atomically replace the intended destination. - Use restrictive file permissions where supported. - Avoid writing into an agent memory directory unless persistent state is necessary and clearly documented. On platforms supporting `O_NOFOLLOW`, a protected open can be implemented using `os.open` with appropriate flags. Atomic replacement should still be used to prevent partial output and reduce race conditions. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • 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
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (9)

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding
There is a meaningful mismatch between the documented purpose and the detected behavior: promised features such as US earnings-calendar scanning and Discord/Telegram delivery are not implemented, while an undeclared local file-write behavior is present. This discrepancy is dangerous because users and reviewers may grant trust based on the description while the actual behavior performs different actions, including a more sensitive capability than disclosed.

Lp3

Medium
Category
MCP Least Privilege
Confidence
78% confidence
Finding
The skill advertises scheduling, scanning, and notifications but does not declare any explicit tool scope or permissions boundary while static analysis detected file-write capability. Undeclared write access increases the chance of surprising side effects, such as creating or modifying local files outside user expectations, and makes review and sandboxing harder.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
The natural-language content of the skill is presented entirely in Chinese, including the description, headings, workflow, and examples, with no indication that users may choose another language. Under the stated policy, forcing a specific language without user opt-in is a locale-policy concern unless the constraint is explicitly justified.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
This markdown file describes automatic Discord and Telegram notifications, which can disclose the user's watchlist or tracking activity to third-party messaging platforms. Although the workflow mentions waiting for user confirmation before creating reminders, the description does not clearly warn about the privacy implications of sending data to external channels.

Natural-Language Policy Violations

Medium
Confidence
96% confidence
Finding
The file’s natural-language description and all user-facing prompts are written in Chinese and explicitly label the tool as a China-only version. It does not indicate any user opt-in, language selection, or justification for requiring Chinese output, which matches the language/locale policy violation criteria.

Intent-Code Divergence

Medium
Confidence
97% confidence
Finding
The top-level docstring explicitly lists '推送到 Discord/Telegram' as a function of the script. However, no messaging API, webhook call, or bot integration exists; the code only prints a report and writes it to a JSON file.

Description-Behavior Mismatch

Medium
Confidence
95% confidence
Finding
The manifest describes a tracker that scans both A-share and U.S. earnings calendars and pushes important updates. In the implementation, only Chinese-market AKShare APIs are queried, there is no U.S. earnings retrieval logic, and the final output is persisted to a local JSON file rather than sent to Discord or Telegram.

Missing User Warnings

Medium
Confidence
88% confidence
Finding
The script writes results to a fixed absolute path in the user's workspace without prior warning or confirmation. In an agent setting, silent filesystem writes can surprise users, overwrite prior data, leak information into shared workspace state, or create persistence that later tools/processes consume unexpectedly.

Natural-Language Policy Violations

Low
Confidence
88% confidence
Finding
The package description is written in Chinese and explicitly labels the skill as the 'China version', focused on A-share earnings calendars. This indicates a locale-specific constraint without any visible language or locale choice for users in this file.

Static analysis

No suspicious patterns detected.