Back to skill

Security audit

药物化学信息提取服务

Security checks for vulnerabilities and agentic risk

Overview

The skill claims to use PubChem, but its code actually uses a third-party XiaoBenYang MCP service, asks for that service's API key, and stores it locally.

Review this carefully before installing. Only use it if you intend to trust xiaobenyang.com/MCP as the real provider, are comfortable sending chemical queries there, and are willing to store an XBY API key in a local plaintext .env file. Prefer a version that either calls PubChem directly or clearly documents the proxy service, credential storage, and cleanup steps.

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

Lp3

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding
The skill advertises only a documentation-level interface, but its described behavior includes environment access, local file read/write, and network operations without declaring permissions. This reduces transparency and prevents users or platform policy from making an informed trust decision, especially because the skill also handles API credentials and persists them locally.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
The skill claims to use PubChem, but the instructions require a third-party XBY API key from xiaobenyang.com and mention credential persistence to local files/environment. This mismatch can mislead users into disclosing credentials to an unexpected upstream service and obscures the real data flow, which is a serious trust and supply-chain risk.

Intent-Code Divergence

Medium
Confidence
83% confidence
Finding
The workflow example references unrelated gaokao/search_schools functionality inside a chemistry-information skill, indicating copied or inconsistent instructions. Such inconsistencies increase the risk of incorrect tool routing, unintended API calls, or hidden behavior that users cannot reasonably verify from the documentation.

Intent-Code Divergence

Medium
Confidence
95% confidence
Finding
The document says the skill works through PubChem API, yet it mandates a third-party XBY_APIKEY obtained from an unrelated website. This contradiction is a red flag because it disguises the true service boundary and may cause users to trust a public scientific API workflow when they are actually sending requests and secrets to a separate provider.

Description-Behavior Mismatch

High
Confidence
96% confidence
Finding
The skill metadata claims it extracts drug chemistry data via the PubChem API, but the implementation actually sends requests to a generic "小笨羊MCP API" endpoint. This mismatch is dangerous because it hides the true data flow and trust boundary from users and reviewers, enabling undisclosed third-party transmission and behavior inconsistent with the stated purpose.

Context-Inappropriate Capability

High
Confidence
94% confidence
Finding
The client accepts arbitrary tool names and parameter dictionaries, then forwards them to a generic upstream tool interface using privileged API credentials. In a skill that is supposed to perform narrow chemical information retrieval, this overbroad capability creates a confused-deputy risk where the skill can be repurposed to invoke unrelated or sensitive upstream actions.

Description-Behavior Mismatch

High
Confidence
99% confidence
Finding
The file’s configuration clearly targets a different service ('小笨羊高考' / XBY API) than the declared PubChem-based drug chemistry extractor. This mismatch is dangerous because it indicates hidden or repurposed functionality, including unrelated remote endpoint and credential handling, which can mislead reviewers and users about where data is sent and what secrets are used.

Context-Inappropriate Capability

Medium
Confidence
92% confidence
Finding
The skill includes functionality to persist and modify API credentials in a local .env file even though that behavior is not necessary for a read-only chemical information extraction service. Storing secrets this way increases the risk of accidental exposure through source control, local file disclosure, backups, or multi-tenant host access.

Intent-Code Divergence

High
Confidence
98% confidence
Finding
The class docstring explicitly identifies the code as configuration for a different skill, directly contradicting the advertised drug chemistry extraction purpose. In security review, this kind of identity mismatch is a strong indicator of copied or disguised code and makes the hidden credential and network behavior more concerning.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The skill instructs the agent to ask the user for an API key and save it locally, but gives no warning about storage location, persistence, access controls, or risks of credential exposure. Secret collection and persistence without explicit handling guidance can lead to accidental disclosure, reuse across contexts, or compromise of the third-party account.

Missing User Warnings

Low
Confidence
88% confidence
Finding
The skill instructs displaying the raw API response directly to the user without any filtering or validation. Even if the intended data is chemical metadata, raw responses can include unexpected fields, internal identifiers, error details, or echoed inputs that may expose unnecessary information or create downstream injection/content-safety risks.

Missing User Warnings

Medium
Confidence
82% confidence
Finding
The code forwards arbitrary parameters together with an API credential to an external service without any evidence in this file of user disclosure, consent, or data minimization. While not a memory-safety flaw, it is a real security and privacy weakness because sensitive user-supplied content could be exfiltrated to an undisclosed upstream endpoint.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The code writes API keys to .env without any user-facing warning, consent flow, or disclosure of persistence. This is dangerous because users may assume the key is used only in memory, while the skill silently creates a durable secret on disk that may later be exposed or committed.

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
91% confidence
Finding
The code forcibly reads XBY_APIKEY from .env outside normal settings handling, specifically searching for a credential unrelated to the declared skill purpose. This increases concern because it performs direct secret access tied to mismatched service identity, making unauthorized or undisclosed credential use more plausible.

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
91% confidence
Finding
This direct existence check precedes manual reading of the local .env secret store and is part of undisclosed credential access logic for an unrelated service. In context, the issue is not the file check itself but its role in concealed secret retrieval inconsistent with the skill’s stated PubChem purpose.

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
94% confidence
Finding
This function is explicitly designed to persist an API key into .env, creating a durable local credential store. In the context of a skill that claims only to query PubChem data, this is unnecessary and increases exposure risk through accidental disclosure, filesystem compromise, or source-control leakage.

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
93% confidence
Finding
The setter persists credentials to .env as part of normal operation, again introducing plaintext local secret storage without clear necessity for the declared skill purpose. This broadens the attack surface by making secret handling part of the public API of the module.

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
The dependency is specified with a lower bound only (`requests>=2.31.0`), which allows future unintended versions to be installed. This weakens build reproducibility and can silently introduce breaking changes or vulnerable releases into the environment.

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
The `pydantic>=2.7.0` specification is unpinned, so installations may resolve to different versions over time. This creates supply-chain and stability risk because unreviewed upstream changes can be pulled in automatically.

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-settings>=2.2.0` without an upper bound or exact pin permits uncontrolled dependency drift. That can expose the service to newly introduced vulnerabilities or incompatible behavior during deployment.

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
The `python-dotenv>=1.0.1` dependency is unpinned, which means future installations may fetch different versions than the one tested. This reduces reproducibility and increases the chance of importing a vulnerable or incompatible release.

Known Vulnerable Dependency: requests==2.31.0 — 5 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) +2 more

Medium
Category
Supply Chain
Confidence
89% confidence
Finding
The static finding ties the lower-bound requirement to `requests==2.31.0`, a version with published advisories. Even though the file uses `>=` rather than exact pinning, environments may still resolve to 2.31.0, leaving the service exposed to issues such as credential leakage or improper request verification depending on how `requests` is used.

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
78% confidence
Finding
The requirement allows installation of `python-dotenv==1.0.1`, which is flagged with a published advisory. If the skill uses affected functionality such as `set_key` on attacker-controlled paths or in unsafe filesystem contexts, it could enable file overwrite through symlink following.

Static analysis

No suspicious patterns detected.