Back to skill

Security audit

akshare-stock

Security checks for vulnerabilities and agentic risk

Overview

This A-share market-data skill is purpose-aligned and disclosed, with ordinary package and network risks plus some quality bugs but no hidden persistence, credential access, or destructive behavior.

Install dependencies in a dedicated virtual environment, consider pinning and reviewing AkShare before use, and expect the skill to make network calls to financial data sources. Treat results as research data, not investment advice, and be aware that some documented features may need fixes before they work reliably.

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

Unpinned Third-Party Dependency Installation

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:10-13
Vulnerability Type: Unpinned and unverified third-party dependency
Risk Level: Medium

bash
安装依赖:
```bash
pip install akshare
text

### Technical Analysis

The installation instructions retrieve and install the current `akshare` package release without pinning a reviewed version or verifying package integrity. Package installation may execute package build logic and also installs transitive dependencies. Consequently, the code ultimately installed can change after this Skill has been reviewed.

This is a software supply-chain weakness rather than evidence that the current AkShare package is malicious. Exploitation would require compromise of the package distribution channel, a malicious or compromised future package release, or compromise of an unpinned transitive dependency.

### Attack Path

1. An attacker compromises an upstream AkShare release, one of its dependencies, or the package-distribution path.
2. The attacker publishes or causes distribution of a malicious version that still satisfies the unrestricted installation request.
3. A user follows the Skill documentation and runs `pip install akshare`.
4. `pip` resolves and downloads the attacker-controlled package or dependency because no reviewed version or hash is required.
5. Malicious build or runtime code executes with the privileges of the user running the installation or invoking the Skill.

### Impact Assessment

Successful exploitation could execute arbitrary code under the installing user's account. Depending on that account's privileges and environment, the attacker could access user-readable files and credentials, alter Python environments, tamper with project data, or perform network operations. The weakness does not itself provide privilege escalation; its scope is bounded by the privileges available to the package installation and runtime processes.
Remediation
View remediation

Remediation Suggestions

  1. Pin AkShare to a specifically reviewed version, for example with an exact == constraint.
  2. Record all transitive dependencies in a lock file rather than resolving mutable versions during each installation.
  3. Generate and verify cryptographic hashes for every downloaded distribution, using pip --require-hashes where practical.
  4. Install dependencies from the official package index or a controlled internal mirror over authenticated TLS.
  5. Perform installation inside a dedicated virtual environment or container under an unprivileged account.
  6. Periodically review and deliberately update pinned dependencies after vulnerability and provenance checks.
  7. Avoid running package installation with administrator or root privileges.
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 (3)

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

The description broadly claims an A-share quant data analysis tool covering行情、财务数据、板块信息 and use cases including stock query, market data, financial analysis, and stock screening. The actual code only provides a small command-line interface for quotes, historical price data, industry/concept board lists, and stock search. There is no financial statement/data retrieval, no analysis logic, and no screening/selection functionality. Additionally, the fund flow function does not reference akshare correctly and will likely fail at runtime. So the code only partially matches the declared scope and overstates key capabilities.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This code presents its title, help, and installation/error messaging in Chinese only, indicating a fixed language experience. Under the policy rule, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is explicitly documented and justified.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

Lines L052-L055 document this function as returning '资金流向', implying it fetches stock fund-flow data. However, the code calls stock_individual_fund_flow(...) without the ak. namespace, which contradicts the documented intent because it will fail rather than perform the described data retrieval.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.