Back to skill

Security audit

股票数据服务

Security checks for vulnerabilities and agentic risk

Overview

This stock-data skill has review-worthy scoping issues because it routes requests through XiaoBenYang, stores an API key in a plaintext .env file, and contains stale cross-domain references.

Review carefully before installing. Use only a XiaoBenYang API key you are comfortable storing in a local plaintext .env file, avoid providing reusable Xueqiu/session tokens, and treat requests and parameters as being sent to XiaoBenYang rather than directly to AKShare. Prefer a sandboxed workspace and rotate/remove any credential after testing.

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 (3)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/config.py:45
Finding

API Key Persisted in a Plaintext File Without Enforced Access Controls

Content
View full analysis
bool: """将API key保存到.env文件""" try: env_path = Path(".env") lines = [] if env_path.exists(): lines = env_path.read_text(encoding="utf-8").splitlines() found = False new_lines = [] for line in lines: if line.startswith("XBY_APIKEY="): new_lines.append(f"XBY_APIKEY={api_key}") found = True else: new_lines.append(line) if not found: new_lines.append(f"XBY_APIKEY={api_key}") env_path.write_text("\n".join(new_lines) + "\n", encoding="utf-8") os.environ["XBY_APIKEY"] = api_key return True ``` ### Technical Analysis The user-provided API key is stored directly in a plaintext `.env` file. `Path.write_text()` does not explicitly create or enforce owner-only permissions, so the resulting access controls depend on the process umask and any permissions already assigned to the file. The path is also relative to the current working directory rather than anchored to a known private configuration directory. Consequently, the credential may be written into a shared directory, project checkout, backup location, or source-controlled workspace. If `.env` already exists with permissive permissions, rewriting it does not correct those permissions. The implementation also does not protect against the destination being a symbolic link. In an attacker-controlled working directory, a local attacker could potentially arrange for `.env` to point to another writable file, causing the credential to be placed in an unintended location. ### Attack Path 1. A user is instructed to provide an `XBY_APIKEY`. 2. The Agent calls `set_api_key()`, which invokes ...[truncated 1024 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/tools.py:78
Finding

Optional Third-Party Authentication Token Is Forwarded to an Intermediary Service

Content
View full analysis
Dict[str, Any]: """ 获取雪球财经-个股-公司概况-公司简介 Args: symbol (str): 带市场标识的股票代码,例如:"SH601127" token (str): 认证令牌,默认为空 timeout (float): 超时参数,默认不设置 """ arguments = { "symbol": symbol, "token": token, "timeout": timeout } return call_api( "1777419072866307", "get_stock_individual_basic_info_xq", arguments ) ``` The common API client transmits the complete argument object to the intermediary: ```python url = f"{settings.base_url}/api" mcp_id = mcp_id or settings.mcp_id api_key = get_api_key() if not api_key: raise UpstreamError("API密钥未设置,请先调用 set_api_key()") headers = { "XBY-APIKEY": api_key, "func": tool_name, "mcpid": mcp_id, "Content-Type": "application/json", } resp = self._session.post( url=url, headers=headers, data=json.dumps(params), timeout=settings.timeout_seconds, ) ``` ### Technical Analysis The tool accepts a parameter described as an authentication token for a Xueqiu-related operation. Rather than communicating directly with Xueqiu, the wrapper places the token in the generic `arguments` dictionary. The common client serializes the entire dictionary and sends it to `https://mcp.xiaobenyang.com/api`. This means any supplied token is disclosed to the XiaoBenYang intermediary. The Skill documentation identifies the parameter as an authentication token but does not clearly explain that the credential will be transmitted to and processed by a separate service. TLS protects the token in transit from ordinary network interception, but it does not protect the ...[truncated 1260 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Note
Location
requirements.txt:1
Finding

Dependencies Are Not Pinned to Reviewed Versions or Integrity Hashes

Content
View full analysis
=2.31.0 pydantic>=2.7.0 pydantic-settings>=2.2.0 python-dotenv>=1.0.1 ``` ### Technical Analysis Each dependency specifies only a minimum version and permits the package resolver to install any later release. The project therefore does not define a reproducible, reviewed dependency set. A future installation may receive code that did not exist when the Skill was audited. This can introduce incompatible behavior, newly published vulnerabilities, or a compromised upstream release. The requirements also do not provide package hashes, so integrity is delegated entirely to the configured package index and TLS connection. The package names appear legitimate, and the reviewed files do not demonstrate dependency confusion or typosquatting. The confirmed weakness is the lack of version and artifact integrity controls. ### Attack Path 1. A user installs the project dependencies at a later date. 2. The package resolver selects the newest versions satisfying the open-ended constraints. 3. A selected release contains a vulnerability, malicious modification, or behavior incompatible with the audited Skill. 4. That package is installed and imported by the Skill. 5. Package code executes with the privileges of the Python process running the Skill. Exploitation depends on a compromised or vulnerable future dependency release, a compromised package index, or unsafe dependency resolution. The repository does not itself contain evidence that such a compromise has already occurred. ### Impact Assessment If a resolved dependency is compromised, malicious package code may execute with the same filesystem, network, environment-variable, and process privileges as the Skill. This could expose the API key, alter API requests, manipulate returned data, or access other resources avai ...[truncated 276 chars]
Remediation
View remediation
Vulnerability Patterns
  • 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
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (29)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The documentation says the skill is for stock data, but the project structure and instructions reveal configuration persistence, .env management, and references to a different domain ('xiaobenyang_gaokao_skill'). Such cross-domain and credential-management mismatch is a strong integrity warning because it suggests the skill may perform operations unrelated to the user's expected task.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The documentation says the skill is for stock data, but the project structure and instructions reveal configuration persistence, .env management, and references to a different domain ('xiaobenyang_gaokao_skill'). Such cross-domain and credential-management mismatch is a strong integrity warning because it suggests the skill may perform operations unrelated to the user's expected task.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The implementation materially differs from the stated skill purpose: instead of directly providing AKShare-based stock data access, it proxies requests to an unrelated external '小笨羊MCP' API using configurable tool names and parameters. This hidden delegation expands the trust boundary and can enable undisclosed data exfiltration, unexpected remote actions, or policy bypass because users and reviewers would reasonably expect a stock-data-only integration.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

call_tool accepts arbitrary tool_name and params and forwards them to an external API via headers and JSON body, creating a generic remote tool-execution primitive. In the context of a skill advertised as stock data service, this is unnecessarily broad and dangerous because any caller that can influence these values may invoke unintended upstream capabilities beyond the declared business purpose.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/config.py (reported line 13)May include surrounding context.

python
model_config = SettingsConfigDict(
        env_prefix="XBY_GAOKAO_",
        env_file=".env",
        env_file_encoding="utf-8",
        extra="ignore",
    )

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/config.py (reported line 32)May include surrounding context.

python
model_config = SettingsConfigDict(
        env_prefix="XBY_GAOKAO_",
        env_file=".env",
        env_file_encoding="utf-8",
        extra="ignore",
    )

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/config.py (reported line 31)May include surrounding context.

python
default_year: int = 2025

    def model_post_init(self, __context):
        # 强制从 .env 文件读取 XBY_APIKEY
        env_path = Path(".env")
        if env_path.exists():
            content = env_path.read_text(encoding="utf-8")

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/config.py (reported line 39)May include surrounding context.

python
default_year: int = 2025

    def model_post_init(self, __context):
        # 强制从 .env 文件读取 XBY_APIKEY
        env_path = Path(".env")
        if env_path.exists():
            content = env_path.read_text(encoding="utf-8")

Credential Access

High
Category
Privilege Escalation
Confidence
86% confidence
Finding

This function explicitly saves an API key into a plaintext .env file, which creates durable local secret storage outside the stated stock-data functionality. In environments with weak filesystem hygiene, source-control mistakes, or shared access, this can lead to credential disclosure and unauthorized API use.

Content

Scanner excerpt · scripts/config.py (reported line 48)May include surrounding context.

python
def save_api_key_to_env(api_key: str) -> bool:
    """将API key保存到.env文件"""
    try:
        env_path = Path(".env")
        lines = []
        if env_path.exists():
            lines = env_path.read_text(encoding="utf-8").splitlines()

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
85% confidence
Finding

The skill exposes capabilities implying environment access, file read/write, and network use, but the manifest does not declare any tool scope or permission boundaries. In an agent setting, this weakens least-privilege controls and makes it harder for users or the platform to understand that the skill can persist secrets and call remote services.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

Manifest 描述将技能定位为“通过AKShare提供中国股票市场数据”,语义上聚焦于中国股票市场本身。但文档中的工具参数明确支持“港股”“基金”“债券”“监管”“预披露”等更广泛的数据域,超出了单纯股票市场数据服务的宣称范围。这不是实现细节,而是对外能力边界的扩大。

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill instructs the model to solicit an API key from the user and save it, but provides no warning about persistence, storage location, access controls, or alternatives. This creates a secret-handling risk because users may reveal credentials without informed consent and the key may be stored in a recoverable or overexposed manner.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The natural-language workflow directs the agent to collect a user secret and persist it before continuing. In skill contexts, this is risky because the model becomes a credential-collection intermediary, increasing the chance of accidental logging, display, reuse across sessions, or storage in insecure files.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The code persists the API key to a local .env file and also mirrors it into process environment variables, creating unnecessary long-term credential storage for a stock-data skill. If the working directory is shared, backed up, logged, or accidentally committed, the credential can be exposed and reused.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The function writes the supplied API key to .env without any user-facing warning, confirmation, or indication that the credential will be stored persistently on disk. This increases the risk of silent credential retention, especially in developer workspaces where .env files may be copied, synced, or committed.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
77% confidence
Finding

The file's natural-language descriptions are written exclusively in Chinese and repeatedly specify Chinese-market conventions and examples, but do not offer any language or locale choice. Under the stated policy, forcing a specific language without user opt-in can be a locale-policy violation unless the constraint is explicitly documented and justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

The skill name, description, and all operational instructions are presented only in Chinese and are narrowly scoped to Chinese stock-market sources, but the file does not explicitly state that the skill is China-market/Chinese-language only or offer a language/locale choice. This can violate locale policy when users are not given opt-in or clear notice of the language constraint.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
93% confidence
Finding

The dependency is specified with a lower-bound only, which permits installation of any later version and makes builds non-reproducible. This can unintentionally introduce vulnerable or breaking releases into the environment, especially for a server component that fetches external market data over the network.

Content

Scanner excerpt · requirements.txt (reported line 1)May include surrounding context.

text
requests>=2.31.0
pydantic>=2.7.0
pydantic-settings>=2.2.0
python-dotenv>=1.0.1

Unverifiable Dependency: requests has 16 known advisory(ies) (CVE-2014-1830 (Exposure of Sensitive Information to an Unauthorized Actor in Requests); CVE-2024-47081 (Requests vulnerable to .netrc credentials leak via malicious URLs); CVE-2024-35195 (Requests `Session` object does not verify requests after making first request wi) +13 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
88% confidence
Finding

requests has multiple known advisories, and because the manifest does not pin a version, there is no way to determine from this file whether deployment will use a fixed or vulnerable release. In a stock data service that makes outbound HTTP requests, a vulnerable HTTP client could expose credentials, weaken TLS assumptions, or mishandle attacker-controlled URLs.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
92% confidence
Finding

Using pydantic>=2.7.0 leaves the installed version unconstrained above the minimum, reducing reproducibility and making it difficult to verify whether deployed environments are using a safe release. In practice, this can allow accidental adoption of versions with known security defects or incompatible behavior.

Content

Scanner excerpt · requirements.txt (reported line 2)May include surrounding context.

text
requests>=2.31.0
pydantic>=2.7.0
pydantic-settings>=2.2.0
python-dotenv>=1.0.1

Unverifiable Dependency: pydantic has 4 known advisory(ies) (CVE-2021-29510 (Use of "infinity" as an input to datetime and date fields causes infinite loop i); CVE-2024-3772 (Pydantic regular expression denial of service); CVE-2021-29510 (Pydantic is a data validation and settings management using Python type hinting.) +1 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
84% confidence
Finding

pydantic has published advisories, and the open-ended version range prevents verification that the installed release is patched. Since this library validates and parses potentially external data, unresolved version ambiguity can expose the service to denial-of-service or parsing-related issues if an affected version is selected.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
91% confidence
Finding

pydantic-settings>=2.2.0 is not pinned, so installations may vary over time and across environments. For configuration-parsing libraries, this is risky because security-relevant behavior around secrets, environment loading, or file handling can change unexpectedly.

Content

Scanner excerpt · requirements.txt (reported line 3)May include surrounding context.

text
requests>=2.31.0
pydantic>=2.7.0
pydantic-settings>=2.2.0
python-dotenv>=1.0.1

Unverifiable Dependency: pydantic-settings has 1 known advisory(ies) (CVE-2026-58203 (pydantic-settings: NestedSecretsSettingsSource follows symlinks outside secrets_)), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
83% confidence
Finding

The manifest cannot demonstrate that pydantic-settings resolves to a safe version despite known advisories existing for the package. Because settings libraries can touch secrets sources and filesystem paths, uncertainty about the exact version increases the risk of unsafe configuration or secret-loading behavior.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
92% confidence
Finding

The python-dotenv dependency is unpinned, which can cause unpredictable dependency resolution and may introduce versions with vulnerable file-handling behavior. Because dotenv libraries often interact with secrets and local files, version drift can have direct security consequences.

Content

Scanner excerpt · requirements.txt (reported line 4)May include surrounding context.

text
requests>=2.31.0
pydantic>=2.7.0
pydantic-settings>=2.2.0
python-dotenv>=1.0.1

Unverifiable Dependency: python-dotenv has 2 known advisory(ies) (CVE-2026-28684 (python-dotenv: Symlink following in set_key allows arbitrary file overwrite via ); CVE-2026-28684 (python-dotenv reads key-value pairs from a .env file and can set them as environ)), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
85% confidence
Finding

python-dotenv has known advisories, and without a pinned version the actual installed release may still be vulnerable. In software that may load environment files or manipulate local configuration, a vulnerable dotenv version could contribute to file overwrite or symlink-related attacks in certain deployment workflows.

Content

No source excerpt is available for this finding.