Back to skill

Security audit

中药知识图谱

Security checks for vulnerabilities and agentic risk

Overview

The skill appears to target a Chinese medicine knowledge graph, but it should be reviewed because it persists an API key locally and has mismatched documentation plus broad remote query behavior.

Install only if you are comfortable giving this provider an API key and sending your graph queries to its remote service. Check that the skill runs in a directory where writing a plaintext .env file is acceptable, and consider using a scoped or disposable API key because the package retains XBY_APIKEY locally.

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

Lp3

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding
The skill exposes effective capabilities to read environment variables, read/write local files, and access the network, yet does not declare those permissions. This undermines informed consent and security review because operators and users cannot accurately assess what the skill may access, especially since it also handles API keys and remote graph queries.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
The declared purpose is a traditional Chinese medicine knowledge graph, but the documented behavior includes generic remote API access, API-key persistence, schema inspection, and arbitrary read-only Cypher execution with no domain-specific controls. This mismatch is dangerous because users may trust the skill with sensitive credentials or queries under false assumptions about scope, while the skill actually acts as a generic database access wrapper.

Description-Behavior Mismatch

High
Confidence
95% confidence
Finding
The workflow and project structure appear copied from an unrelated gaokao/schools skill, which strongly suggests the skill documentation is unreliable. In a security context, inconsistent identity and copied operational instructions increase the risk of misrouting data, exposing secrets to the wrong backend, or concealing unintended functionality.

Intent-Code Divergence

Medium
Confidence
92% confidence
Finding
The workflow example instructs using an unrelated school-search function, contradicting the stated TCM knowledge-graph purpose. This inconsistency can cause incorrect tool invocation, accidental disclosure of user input to unrelated services, and operator confusion during review or incident response.

Intent-Code Divergence

Medium
Confidence
90% confidence
Finding
The project structure names an unrelated gaokao skill, indicating the artifact may be mispackaged or connected to the wrong codebase. This raises the risk that users interact with a different backend or code path than advertised, making the skill more dangerous than a simple documentation error.

Description-Behavior Mismatch

Medium
Confidence
92% confidence
Finding
The file implements a generic HTTP client that can call an external MCP API with arbitrary tool names and parameters, which exceeds the narrowly described purpose of a traditional Chinese medicine knowledge-graph skill. This creates a capability mismatch: if other parts of the skill pass user-controlled values into this function, the skill can act as a proxy to unintended remote functionality and send data off-platform.

Context-Inappropriate Capability

Medium
Confidence
95% confidence
Finding
The call_tool method accepts arbitrary mcp_id, tool_name, and params, then forwards them directly to the upstream service in headers and body. That design enables arbitrary upstream tool invocation and effectively turns the skill into a general remote-action wrapper, which is unjustified by the manifest and increases the risk of abuse, unexpected data processing, or invocation of sensitive remote capabilities.

Description-Behavior Mismatch

Medium
Confidence
96% confidence
Finding
The code provides functionality to persist an API key into a local .env file even though the declared skill purpose is a traditional-medicine knowledge graph. This creates unnecessary secret-handling and durable local storage of credentials, increasing the risk of accidental disclosure through source control, backups, logs, or local compromise.

Context-Inappropriate Capability

Medium
Confidence
95% confidence
Finding
The file includes local secret-management capability that is not justified by the stated research/knowledge-graph function of the skill. Unnecessary credential management broadens the attack surface and may cause users to entrust secrets to code they would not otherwise expect to store them.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The skill instructs the agent to collect a user API key and persist it via configuration, but does not disclose storage behavior, retention, or access controls. This is dangerous because credentials are highly sensitive, and silent persistence to .env or local files can lead to accidental exposure, reuse across contexts, or leakage through logs and backups.

Missing User Warnings

Medium
Confidence
87% confidence
Finding
This code sends request parameters and an API key to an external service without any evidence in this file of user notice, consent, or minimization. In a skill expected to handle user-provided research inputs, silent transmission to a third party can expose sensitive content and credentials usage patterns, especially because the skill description does not disclose generic remote API forwarding.

Missing User Warnings

Medium
Confidence
97% confidence
Finding
The API key is written to .env automatically without any warning, confirmation, or visibility into the security consequences. This can lead users to unknowingly persist sensitive credentials in plaintext on disk where they may be exposed to other local users, backups, or accidental commits.

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 and manually extracts XBY_APIKEY outside the normal settings mechanism. This custom secret-loading logic is unnecessary, bypasses clearer configuration patterns, and contributes to covert or unexpected credential handling in a skill whose stated purpose does not suggest secret management.

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
Reading the .env file directly to obtain an API key introduces plaintext credential access and expands the code paths that touch secrets. In this context, it is especially concerning because the skill's declared function does not justify bespoke secret parsing behavior.

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
96% confidence
Finding
This function is explicitly dedicated to saving an API key into a .env file, creating persistent plaintext storage of a secret. That increases the chance of credential leakage through local file access, source-control mistakes, endpoint compromise, or operational mishandling.

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
95% confidence
Finding
The helper advertises that it will set and persist the API key to .env, normalizing insecure credential storage as part of ordinary operation. In a skill unrelated to account or secret administration, this hidden persistence is an unnecessary and risky capability.

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
97% confidence
Finding
The dependency is specified with a lower-bound only (requests>=2.31.0), which allows future builds to pull different versions over time. This weakens reproducibility and can unintentionally introduce vulnerable or incompatible releases through the supply chain.

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
Using pydantic>=2.7.0 without an upper bound or exact pin permits unreviewed newer releases to be installed. This creates supply-chain and stability risk because deployments may not be reproducible and could silently consume a problematic version.

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 pydantic-settings package is unpinned and may resolve to different versions across environments or over time. This increases exposure to accidental dependency drift and future vulnerable releases entering the build without explicit review.

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
python-dotenv>=1.0.1 allows arbitrary newer versions to be installed, reducing build reproducibility and increasing supply-chain uncertainty. Even if the current minimum is acceptable, future resolved versions may introduce security or behavioral regressions.

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
94% confidence
Finding
The requirement permits requests 2.31.0, a version with published advisories, so environments may resolve to or remain on a vulnerable release. Because requests commonly handles outbound HTTP and authentication state, these issues can affect confidentiality or transport security depending on how the skill uses the library.

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
90% confidence
Finding
The requirement permits python-dotenv 1.0.1, which is reported as vulnerable to arbitrary file overwrite via symlink following in set_key. If the skill or supporting tooling writes .env files in attacker-influenced paths, this could lead to unintended file modification and potentially privilege abuse.

Static analysis

No suspicious patterns detected.