Back to skill

Security audit

古诗词知识图谱

Security checks for vulnerabilities and agentic risk

Overview

The skill is not clearly malicious, but it asks for an API key, stores it locally, and exposes broad graph-query access with stale high-school-project references that do not fully match the poetry description.

Install only if you trust the xiaobenyang.com service and are comfortable giving it an API key. Treat the key as a real secret: the skill stores it in a local .env file, so avoid shared workspaces and do not commit that file. Review generated Cypher queries before use, because the skill permits broad read-only graph queries rather than only fixed poetry lookups.

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

Lp3

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding
The skill declares a narrow poetry knowledge-graph purpose, but its documented behavior includes environment access, local file read/write, and network access without any explicit permission declaration or user-facing disclosure. This reduces transparency and increases the risk that users or hosting platforms will not realize the skill can persist secrets locally and communicate with external services.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The skill is presented as a Chinese poetry knowledge graph, but it exposes generic schema inspection and arbitrary read-only Cypher execution against a remote graph database, plus local API-key persistence. That mismatch can mislead users into granting trust and credentials to a tool with substantially broader data-access capability than advertised, enabling unintended data discovery or exfiltration from whatever backend the key authorizes.

Intent-Code Divergence

Medium
Confidence
90% confidence
Finding
The documentation references a different 'gaokao/school query' project structure and example calls, which indicates copy-paste reuse and weak change control in a skill that also handles credentials and remote queries. Such inconsistencies make it easier to misroute requests, call unintended tools, or mask broader behavior than the declared poetry-only purpose.

Description-Behavior Mismatch

High
Confidence
94% confidence
Finding
The configuration is clearly mismatched to the declared skill: it references a different '高考' skill, a remote MCP endpoint, and a hard-coded service identifier. This kind of scope mismatch is dangerous because it suggests copied or repurposed code that may connect the poetry skill to an unintended backend, causing data to be sent to the wrong service or enabling hidden functionality outside the stated purpose.

Context-Inappropriate Capability

Medium
Confidence
89% confidence
Finding
This file adds API-key management, remote-service configuration, and credential persistence even though the stated skill is a local knowledge graph for classical poetry. In context, that unnecessary credential handling expands the attack surface and creates a risk that user secrets are collected, stored, or used by infrastructure unrelated to the skill's advertised functionality.

Missing User Warnings

Medium
Confidence
97% confidence
Finding
The skill instructs the agent to ask the user for an API key and persist it via configuration storage, but it does not warn the user that the secret will be saved to a local .env file or explain retention and handling. This creates a clear secret-management risk: users may disclose credentials without informed consent, and the key may be left accessible to other local processes or future sessions.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The code persists the provided API key directly into a local .env file without any notice, consent, or security controls. Silent persistence increases the chance of accidental credential exposure through source control, backups, logs, shared workspaces, or later file reads by unrelated code.

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
93% confidence
Finding
The code explicitly opens and parses .env to extract a specific API key outside the standard settings mechanism. In this skill's context, manual secret reading is suspicious because it bypasses normal configuration controls and is not justified by the stated poetry knowledge-graph functionality.

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
93% confidence
Finding
This line continues the manual .env inspection flow used to extract credentials directly from local files. Such direct credential access increases the chance of mishandling secrets and is especially concerning in a skill whose declared purpose does not require custom secret-processing logic.

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 designed to persist an API key into .env, creating a durable plaintext credential on disk. Plaintext secret storage is dangerous because the file may be exposed via repository commits, shared directories, backups, local compromise, or later reads by unrelated components.

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
This function wraps secret persistence as a normal application operation, making it easy for callers to save credentials permanently with little friction or visibility. In the context of a poetry knowledge skill, this is unnecessary and increases the likelihood of covert credential collection or accidental long-term exposure.

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 constraint only, which permits installation of different future versions and makes builds non-reproducible. This increases supply-chain risk because a later resolved version could introduce breaking changes or a malicious/compromised release 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
95% confidence
Finding
Using an unpinned minimum version for pydantic allows dependency resolution to drift over time, reducing reproducibility and weakening change control. While not an immediate exploit by itself, it creates a supply-chain exposure window if an unsafe upstream release is pulled in.

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 package is not strictly pinned, so deployments may install different versions at different times. This weakens build integrity and can unexpectedly introduce vulnerable or incompatible releases into the skill 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
A lower-bound-only requirement for python-dotenv permits version drift and undermines deterministic builds. In combination with a package that already has a known advisory, this makes dependency hygiene weaker and increases the chance of pulling unsafe versions.

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
98% confidence
Finding
The requirement allows installation of requests 2.31.0, a version with published advisories, including issues related to credential leakage and request verification behavior. Because this skill likely performs network access for knowledge retrieval or API calls, a vulnerable HTTP client is more relevant than in a purely offline package and could expose secrets or enable insecure communications under certain usage patterns.

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
91% confidence
Finding
python-dotenv 1.0.1 has a published advisory involving symlink following in set_key, which can lead to arbitrary file overwrite if the vulnerable function is used on attacker-controlled paths. The skill context does not suggest high-risk filesystem manipulation, so danger is somewhat reduced, but the vulnerable dependency is still a genuine supply-chain weakness.

Static analysis

No suspicious patterns detected.