Back to skill

Security audit

Akshare Backtest

Security checks for vulnerabilities and agentic risk

Overview

This skill is a disclosed A-share stock backtesting tool that installs expected Python data libraries, fetches market data, and writes local CSV results, with some documentation accuracy and dependency-pinning issues users should note.

Install this only in an isolated Python environment and treat the results as research, not investment advice. Be aware that dependencies are not pinned, the tool writes CSV files to the selected output directory, and some advertised strategy settings are hardcoded rather than user-configurable.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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)

T08 · Insecure Dependencies

Warning
Location
SKILL.md:8
Finding
Unpinned Third-Party Dependencies Create a Supply-Chain Risk## Vulnerability Details **File Location**: `SKILL.md:8-29` and `SKILL.md:68` **Vulnerability Type**: Unpinned and non-hash-verified Python dependencies **Risk Level**: Medium ### Vulnerable Code ```yaml metadata: { "openclaw": { "install": [ { "id": "pip-deps", "kind": "python", "package": "akshare", "label": "Install AkShare" }, { "id": "pip-deps", "kind": "python", "package": "pandas", "label": "Install Pandas" }, { "id": "pip-deps", "kind": "python", "package": "numpy", "label": "Install NumPy" } ] } } ``` ```bash pip install akshare pandas numpy ``` ### Technical Analysis The Skill declares and recommends installing `akshare`, `pandas`, and `numpy` without exact version constraints, integrity hashes, or a lock file. Consequently, dependency resolution is mutable: two installations performed at different times can retrieve different artifacts without any change to the audited Skill. The package names appear consistent with the script's imports, and there is no evidence that the project intentionally references a typosquatted package or an unauthorized package index. The risk arises from implicitly trusting whichever compatible releases and transitive dependencies the package installer resolves at installation time. If an upstream release, dependency, package-index account, or distribution artifact is compromised, code outside the reviewed repository may execute under the user's identity. ### Attack Path 1. An attacker compromises an upstream dependency release, one of its transitive dependencies, a maintainer account, or the package-distribution channel. 2. The attacker publishes a malicious version under a dependency name used by the Skill. 3. A user installs the dependencies usin ...[truncated 1185 chars]
Remediation
## Remediation Suggestions 1. Pin every direct dependency to an exact, reviewed version instead of allowing unconstrained resolution. 2. Generate a lock file that also fixes transitive dependencies. Suitable approaches include `pip-tools`, Poetry, or another reproducible dependency-management system. 3. Require cryptographic hashes for downloaded artifacts, for example through a hash-locked requirements file and `pip install --require-hashes`. 4. Configure installation to use an explicitly trusted package index and prevent unintended fallback to untrusted indexes. 5. Install dependencies in an isolated virtual environment under a non-privileged account; do not run package installation as root. 6. Scan and periodically review pinned dependencies for known vulnerabilities and anomalous ownership or release changes. 7. Update both the `openclaw.install` metadata and the documented installation command so they enforce the same reviewed versions. 8. Test dependency upgrades in a controlled environment before updating pins and hashes.
Vulnerability Patterns
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (5)

Natural-Language Policy Violations

Medium
Confidence
88% confidence
Finding
The natural-language content of the skill is presented only in Chinese, including the description, usage guidance, and risk notes. Under the policy, forcing a specific language without user opt-in or a clearly documented locale-specific justification is a violation.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
The script's user-facing docstrings, help text, status output, and error messages are entirely in Chinese, which imposes a language choice on users. Under the policy, forced language/locale behavior should be flagged unless the file offers a language choice or clearly documents a justified region-specific constraint.

Description-Behavior Mismatch

Medium
Confidence
92% confidence
Finding
The manifest says the skill supports custom stop-profit/stop-loss parameters and is suitable for validating a range of short-term strategies such as '涨停基因+均线多头+量价配合'. In code, the engine is fixed to a single '龙头低吸' strategy with hardcoded position limits, holding days, stop-loss, take-profit thresholds, and pullback rules, with no CLI or runtime inputs to customize them.

Intent-Code Divergence

Medium
Confidence
90% confidence
Finding
The documentation at the top and surrounding comments describe dynamically identifying leader stocks based on recent limit-up behavior. However, the code explicitly uses a fixed 'popular_stocks' list when no pool is supplied, despite the comment admitting '实际应该从涨停板中筛选', so the implemented selection path contradicts the documented strategy intent.

Missing User Warnings

Low
Confidence
83% confidence
Finding
This code file performs filesystem writes by saving daily and trade results to CSV files. Although the output path is configurable, there is no confirmation prompt or explicit disclosure in user-facing messages before creating directories and writing files, so users may not realize the script will modify the filesystem.

Static analysis

No suspicious patterns detected.