Back to skill

Security audit

A股数据分析 (AkShare)

Security checks for vulnerabilities and agentic risk

Overview

This skill is a coherent AkShare market-data reference and small CLI with no evidence of hidden persistence, credential access, destructive actions, or exfiltration.

Before installing, pin AkShare to a reviewed version or use a lockfile, expect outbound requests to public market-data sources, and treat outputs as research data rather than investment advice. The bundled fund-flow CLI command may need a bug fix before use.

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 Creates Supply-Chain Risk## Vulnerability Details **File Location**: `SKILL.md`, line 10 **Related Execution Point**: `scripts/stock_cli.py`, line 10 **Vulnerability Type**: Unpinned third-party dependency **Risk Level**: Medium ### Vulnerable Code ```bash uv pip install akshare ``` The installed package is subsequently imported by the CLI: ```python try: import akshare as ak except ImportError: print("Please install first: pip install akshare") sys.exit(1) ``` ### Technical Analysis The documentation identifies AkShare version 1.18.48, but its installation command does not pin that version or verify the package artifact with a cryptographic hash. The command therefore installs whichever release the package index resolves at installation time, which may differ from the version considered when this Skill was authored or audited. Python executes package initialization code when `akshare` is imported. As a result, compromise of the package, its publishing account, the package index, or the dependency-resolution path could cause unreviewed code to run locally. An unintended future release could also introduce security regressions or incompatible behavior. This is a supply-chain weakness rather than evidence that the current AkShare package is malicious. ### Attack Path 1. An attacker compromises the upstream package, its publisher account, or a package source used by the installer. 2. The attacker publishes a malicious release under the expected package name. 3. A user follows the unpinned `uv pip install akshare` instruction. 4. The resolver downloads and installs the attacker-controlled release. 5. The user invokes `scripts/stock_cli.py`. 6. Python imports `akshare`, executing its package initialization code. 7. Malicious code runs with the same operating-system identity and permissions as the user or Agent running the Skill. ### Impact Assessment Successful exploitation could permit arbitrary Python code execution within the invoking process's privilege boundar ...[truncated 441 chars]
Remediation
## Remediation Suggestions 1. Pin the dependency to the reviewed version: ```bash uv pip install "akshare==1.18.48" ``` 2. Record the complete transitive dependency graph in a committed `uv.lock` file or equivalent lockfile. 3. Verify package artifacts with cryptographic hashes. Where supported, use a hash-locked requirements file and enforce hash checking during installation. 4. Install only from an explicitly configured, trusted package index over TLS. 5. Run dependency vulnerability and provenance checks in CI. 6. Review and deliberately update the lockfile when upgrading rather than resolving the newest release during normal Skill execution. 7. Execute the CLI under a least-privileged account or sandbox with only the filesystem and network access required for market-data retrieval.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (6)

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding
There is a material description-to-behavior mismatch. The description presents a broad stock analysis tool covering multiple markets and many feature areas, but the supplied code implements only a narrow A股 CLI subset. Its actual actions are limited to quote, kline, industry board, concept board, search, and a likely broken fund-flow command. This is not an undeclared malicious capability issue; rather, the description significantly overstates what the code can do. Therefore the declared description does not accurately represent the actual behavior.

Natural-Language Policy Violations

Medium
Confidence
86% confidence
Finding
The title and description present the skill entirely as an A股-focused tool in Chinese, with no indication that users may interact in another language or that Chinese-only output is an intentional, documented locale constraint. Under the policy, language or locale restrictions should either be optional for the user or explicitly justified as region-specific.

Natural-Language Policy Violations

Medium
Confidence
93% confidence
Finding
Natural-language strings throughout the script, including the title, help text, and error messages, force Chinese-language interaction without presenting an opt-in or alternative locale. Under the stated policy, language constraints should either be optional or clearly justified as region-specific; this file provides no explicit user choice or justification.

Intent-Code Divergence

Medium
Confidence
97% confidence
Finding
The documented intent of the fund-flow function is to fetch stock capital-flow data, but the implementation calls an unqualified function name `stock_individual_fund_flow(...)` instead of `ak.stock_individual_fund_flow(...)`. This mismatch is dangerous because it can fail at runtime or, in a broader Python execution context, resolve to an unintended or monkey-patched symbol, causing incorrect behavior or execution of unexpected code paths.

Missing User Warnings

Low
Confidence
77% confidence
Finding
This Python code file performs external data retrieval through AkShare, which implies network access, but the function only has a terse internal docstring and no explicit user-facing notice that running the command will contact remote data sources. For a code-file warning review, this is a mild missing-disclosure issue because users are not clearly informed about outbound requests or data fetching behavior at the operation point.

Missing User Warnings

Low
Confidence
73% confidence
Finding
The search function fetches full A-share spot data through AkShare before filtering locally, which is another network/data-transfer operation in a code file. While the script prints results, it does not disclose that invoking search causes external market data access, and the operation is not explicitly described as network-backed in user-facing text.

Static analysis

No suspicious patterns detected.