Back to skill

Security audit

基金知识查询服务

Security checks for vulnerabilities and agentic risk

Overview

This skill is a disclosed remote API client for fund-related queries, but users should understand it stores the service API key in a local .env file and sends query parameters to xiaobenyang.com.

Before installing, use a dedicated XiaoBenYang API key, assume your queries and key are sent to xiaobenyang.com, and avoid placing the generated .env file in shared folders, backups, or source control. Consider rotating or deleting the key after use, and expect rough packaging quality because the artifact contains stale names and a likely invalid Python tools file.

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

Lp3

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding
The skill documentation directs the agent to access environment configuration, read and write local files, and call remote network APIs, yet it declares no corresponding permissions. This creates a transparency and consent gap: a user or platform may believe the skill is low-privilege when it can persist secrets and make outbound requests.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding
The documented behavior materially exceeds and contradicts the stated purpose: besides fund knowledge lookup, it includes stock search, an unrelated echo tool, local API-key persistence, and behavior more consistent with a remote API client than a 'knowledge server.' Such mismatches are dangerous because they obscure the true trust boundary and can mislead reviewers and users about what data is collected, stored, and transmitted.

Description-Behavior Mismatch

Medium
Confidence
82% confidence
Finding
A skill presented as a fund knowledge query service also exposes stock search functionality, expanding scope beyond the advertised domain. While not inherently malicious, hidden scope expansion can cause users to disclose data or rely on behavior they did not consent to, especially when it triggers outbound API use.

Intent-Code Divergence

Medium
Confidence
78% confidence
Finding
The workflow example references inconsistent tool names and a different domain context, indicating copy-paste or routing confusion. In agent skills, such inconsistencies can cause the model to invoke unintended functions or mishandle parameters, increasing the chance of unauthorized data flow or use of the wrong backend.

Intent-Code Divergence

Medium
Confidence
80% confidence
Finding
The project structure references a different skill context than the manifest claims, suggesting the package may be repurposed from another project. This weakens reviewability and can hide unexpected code paths, capabilities, or secret handling not anticipated by users or auditors.

Description-Behavior Mismatch

Medium
Confidence
89% confidence
Finding
The module implements credential mutation and persistence functions (`save_api_key_to_env`, `set_api_key`) even though the stated skill purpose is fund knowledge querying. Persisting secrets to `.env` and mutating process environment expands the skill's authority and creates unnecessary secret-handling risk, especially if the working directory is shared, backed up, or logged. The mismatch between declared capability and implemented behavior makes this more suspicious in context.

Context-Inappropriate Capability

Medium
Confidence
92% confidence
Finding
This code stores an API key to disk in `.env` and also copies it into `os.environ`, creating multiple secret copies without a clear need tied to the skill's retrieval-only purpose. Local persistence increases exposure to accidental disclosure through source-control mistakes, filesystem access by other local users/processes, backups, or support bundles.

Intent-Code Divergence

High
Confidence
95% confidence
Finding
The `Settings` class docstring describes a different skill domain (高考) than the manifest (fund knowledge query service). This inconsistency is a supply-chain red flag because it suggests copied or repurposed code and reduces confidence that the component's actual behavior matches its declared purpose, which can mask unauthorized capabilities such as secret handling.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The skill instructs the agent to collect a user-provided API key and persist it locally via configuration changes, but it gives no warning about storage location, retention, access controls, or exposure risk. Persisting secrets to local files such as .env can leak credentials to other processes, logs, backups, repositories, or future sessions without informed consent.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
The skill writes API keys to `.env` without any user-facing disclosure, consent flow, or warning that secrets will be persisted locally. Silent credential persistence can violate user expectations and security policy, and may leave sensitive material behind after the session ends.

Credential Access

High
Category
Privilege Escalation
Content
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")
Confidence
88% confidence
Finding
The code forcibly reads `.env` manually in `model_post_init` to extract `XBY_APIKEY`, bypassing normal settings abstractions and introducing explicit secret-access logic. In this skill context, manual credential retrieval is more dangerous because the service is supposed to query fund knowledge, not implement custom secret-handling routines.

Credential Access

High
Category
Privilege Escalation
Content
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")
            for line in content.splitlines():
Confidence
88% confidence
Finding
Opening and reading `.env` directly gives the component explicit access to local secret material. Although there is no exfiltration shown here, unnecessary direct secret-file access broadens the trust boundary and can enable abuse if the module is later extended or compromised.

Credential Access

High
Category
Privilege Escalation
Content
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()
Confidence
93% confidence
Finding
This function is dedicated to saving API keys into `.env`, which is a local credential persistence mechanism. For a knowledge-query skill, embedding secret-storage capability is unnecessary and increases risk of leakage through local files, backups, repository mistakes, or unauthorized file access.

Credential Access

High
Category
Privilege Escalation
Content
def set_api_key(api_key: str) -> bool:
    """设置API key并持久化到.env"""
    if not api_key or not api_key.strip():
        return False
    api_key = api_key.strip()
Confidence
91% confidence
Finding
`set_api_key` is an interface for receiving and persistently storing credentials, which expands the module from passive configuration to active secret management. That is an unnecessary and risky capability for the declared service purpose, and it may surprise integrators who expect read-only query behavior.

Unpinned Dependencies

Low
Category
Supply Chain
Content
requests>=2.31.0
pydantic>=2.7.0
pydantic-settings>=2.2.0
python-dotenv>=1.0.1
Confidence
96% confidence
Finding
The dependency is specified with a lower-bound only (requests>=2.31.0), which allows future unreviewed versions to be installed and can also make builds non-reproducible. In a network-facing MCP service, dependency drift increases supply-chain risk and may unexpectedly introduce vulnerable or breaking releases.

Unpinned Dependencies

Low
Category
Supply Chain
Content
requests>=2.31.0
pydantic>=2.7.0
pydantic-settings>=2.2.0
python-dotenv>=1.0.1
Confidence
95% confidence
Finding
Using pydantic>=2.7.0 permits any newer release, which reduces reproducibility and can introduce untested changes or future security issues into the runtime. For an MCP-backed service that parses structured data, unexpected dependency upgrades may affect validation behavior and security assumptions.

Unpinned Dependencies

Low
Category
Supply Chain
Content
requests>=2.31.0
pydantic>=2.7.0
pydantic-settings>=2.2.0
python-dotenv>=1.0.1
Confidence
94% confidence
Finding
The pydantic-settings package is also unpinned, so deployments may silently consume different versions over time. This creates supply-chain and stability risk, especially for configuration loading code where behavior changes can alter security-relevant defaults.

Unpinned Dependencies

Low
Category
Supply Chain
Content
requests>=2.31.0
pydantic>=2.7.0
pydantic-settings>=2.2.0
python-dotenv>=1.0.1
Confidence
95% confidence
Finding
python-dotenv>=1.0.1 allows arbitrary later versions and makes builds non-deterministic. Since dotenv libraries influence environment/config loading, unreviewed upgrades can affect secret handling and configuration safety.

Known Vulnerable Dependency: requests==2.31.0 — 3 advisory(ies): 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); CVE-2026-25645 (Requests has Insecure Temp File Reuse in its extract_zipped_paths() utility func)

Low
Category
Supply Chain
Confidence
92% confidence
Finding
Although the requirement is expressed as requests>=2.31.0 rather than exactly ==2.31.0, it still permits installation of the known-vulnerable 2.31.0 release unless a safer version is explicitly selected. Because this skill is an MCP service likely making outbound HTTP requests, Requests vulnerabilities affecting credential handling or TLS/session verification can become relevant in realistic deployments.

Known Vulnerable Dependency: python-dotenv==1.0.1 — 1 advisory(ies): CVE-2026-28684 (python-dotenv: Symlink following in set_key allows arbitrary file overwrite via )

Low
Category
Supply Chain
Confidence
84% confidence
Finding
The requirement python-dotenv>=1.0.1 includes the cited vulnerable version, so an affected installation remains possible. The practical risk depends on whether the skill uses python-dotenv's set_key functionality on attacker-influenced paths, but allowing a known-affected baseline is still a legitimate dependency vulnerability.

Static analysis

No suspicious patterns detected.