Back to skill

Security audit

A股量化 AkShare

Security checks for vulnerabilities and agentic risk

Overview

This skill is a straightforward China A-share market data helper, with some quality and dependency caveats but no evidence of hidden, destructive, persistent, or deceptive behavior.

Install this only in an isolated Python environment, preferably with reviewed pinned versions of dependencies. Expect it to make network requests to retrieve A-share market data. Be aware that some advertised features appear incomplete or broken, and the skill should not be treated as investment advice.

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:12
Finding

Unpinned Third-Party Dependency Installation

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 12–15
Vulnerability Type: Unpinned and unverifiable third-party dependency
Risk Level: Medium

Vulnerable Code:

markdown
Install dependencies:
```bash
pip install akshare
text

### Technical Analysis

The installation instructions retrieve the latest available version of `akshare` without specifying a reviewed version, validating an integrity hash, or using a dependency lock file. Consequently, the dependency code installed by this command may change after the Skill has been reviewed.

Python package installation can execute package-controlled build and installation logic. If a future release or the relevant package-distribution channel is compromised, following this instruction could execute attacker-controlled code. No evidence was found that the current `akshare` package or this project is malicious; the issue is the absence of controls that ensure reproducible and integrity-verified installation.

### Attack Path

1. An attacker compromises the dependency's publisher account, release process, distribution channel, or a future package release.
2. The attacker publishes a modified `akshare` version containing malicious installation or runtime code.
3. A user follows the documented `pip install akshare` instruction.
4. `pip` selects the attacker-controlled release because no reviewed version is pinned.
5. Malicious package code executes during installation or when `scripts/stock_cli.py` imports and uses `akshare`.

### Impact Assessment

Successful exploitation could execute arbitrary code with the privileges of the account running `pip` or the stock CLI. In a virtual environment or unprivileged installation, access would generally be limited to that user and environment. If installation is performed using an administrator account or otherwise elevated privileges, the affected scope could include system-level files and configuration.

Pote
...[truncated 239 chars]
Remediation
View remediation

Remediation Suggestions

  1. Pin akshare to a specific version that has been reviewed and tested.
  2. Record all direct and transitive dependencies in a lock file.
  3. Require package hashes during installation, for example:
    bash
    pip install --require-hashes -r requirements.txt
    
  4. Populate requirements.txt with exact versions and trusted hashes generated from reviewed artifacts.
  5. Install dependencies inside an isolated virtual environment using a non-privileged account.
  6. Obtain packages only from an explicitly configured trusted package index.
  7. Add automated dependency vulnerability and provenance checks to the release process.
  8. Review dependency updates before changing pinned versions rather than automatically accepting the newest release.
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 (4)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The code generally aligns with part of the description: it is an A-share data tool using AkShare and supports quote lookup, historical price data, board/sector information, and stock search. However, the declared description is broader than the actual implementation. There is no code for retrieving财务数据 (financial statements/metrics), no analysis logic for财务分析, and no选股/screening functionality. Additionally, the资金流向 function calls stock_individual_fund_flow(...) without the ak. namespace or a local definition, so that feature likely fails at runtime. This is a description-behavior mismatch because several advertised core capabilities are absent or broken.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The natural-language content of the skill, including its description, headings, examples, and notes, is entirely in Chinese and does not state that the skill is China-specific or that users may choose another language. This can violate a language/locale policy when skills are expected to avoid forcing a language without user opt-in or documented justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The file uses Chinese-only natural-language descriptions and user-facing messages throughout, including the module docstring, CLI help text, and error output. This enforces a specific language/locale without any opt-in or alternative, which matches the policy-violation category for language or locale constraints.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

L052-L055 的函数注释表明该函数用于获取股票资金流向,但实现中在 L054 直接调用 stock_individual_fund_flow(...),而文件中只导入了 akshare as ak。这与模块其余函数统一通过 ak. 调用 AkShare 接口的实现意图相矛盾,导致该声明的能力实际上无法按所述工作。

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.