Back to skill

Security audit

《红楼梦》人物关系图谱

Security checks for vulnerabilities and agentic risk

Overview

The skill appears to call a hosted graph service, but it asks for an API key in chat and saves it in a plaintext .env file while carrying unrelated gaokao project remnants.

Install only if you trust the XiaoBenYang service and are comfortable giving it an API key. Prefer configuring the key through a platform secret store instead of chat, and avoid installing until the publisher removes the unrelated gaokao remnants, clarifies the backend/provider, and stops saving credentials in plaintext .env files.

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

Lp3

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding
The skill describes capabilities that imply environment access, file read/write, and network use, yet it declares no corresponding permissions. This creates a transparency and policy-enforcement gap: users and hosting systems cannot accurately assess or constrain what the skill may do, especially when it also instructs collection and storage of secrets.

Description-Behavior Mismatch

High
Confidence
96% confidence
Finding
The skill claims to be a 《红楼梦》 relationship graph, but the instructions pivot to an unrelated external API key flow and gaokao-style integration. This mismatch is dangerous because it can mislead users into providing secrets or approving behaviors that are unrelated to the advertised purpose, a classic trust-boundary violation.

Intent-Code Divergence

High
Confidence
94% confidence
Finding
The documentation says the model should route to graph tools, but the embedded examples reference unrelated functions such as school-search behavior. These contradictions make the skill's true behavior non-auditable and increase the risk of users triggering unintended external actions or data flows under false pretenses.

Intent-Code Divergence

Medium
Confidence
88% confidence
Finding
The project structure names a gaokao skill while the top-level identity claims a 红楼梦 graph skill, indicating packaging or documentation contamination from another project. This weakens provenance and makes it harder to verify what code will actually run, which is a meaningful supply-chain and review risk.

Description-Behavior Mismatch

High
Confidence
98% confidence
Finding
The configuration clearly targets a different product context ('高考Skill', XBY_GAOKAO prefix, external MCP service) than the declared 红楼梦 relationship-graph skill. This mismatch is dangerous because it suggests code reuse or hidden functionality that can collect or transmit credentials unrelated to the stated purpose, undermining user trust and expanding the attack surface.

Context-Inappropriate Capability

Medium
Confidence
97% confidence
Finding
The skill reads, stores, and exposes an API credential for an external service even though the advertised function is a local literary knowledge graph. Unrelated credential handling is dangerous because it conditions users or operators to provide secrets to a skill that should not need them, creating risk of accidental secret disclosure or later misuse.

Intent-Code Divergence

High
Confidence
95% confidence
Finding
Gaokao-specific docstrings and comments inside a 红楼梦 skill indicate the file was copied from another project or intentionally mislabeled. This is dangerous because misleading metadata can conceal unrelated behaviors such as credential use, making review and user consent ineffective.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The function persists a provided API key into .env and the process environment automatically, without explicit user confirmation, warning, or secure storage controls. Silent persistence increases the chance that secrets are stored on disk unexpectedly, leaked through backups, logs, or later tooling, and reused beyond the user's intent.

Ssd 3

Medium
Confidence
97% confidence
Finding
The skill explicitly instructs the agent to ask the user for an API key in natural language and then store it. Collecting secrets through conversational flow is dangerous because it normalizes credential exfiltration, increases phishing risk, and may persist sensitive data without clear consent, scope limitation, or secure handling guarantees.

Ssd 3

Medium
Confidence
96% confidence
Finding
Repeating the instruction to collect and save the user's API key reinforces a persistent secret-handling workflow inside the skill prompt. This increases the likelihood that the model will request credentials even when unnecessary and store them in ways that are opaque to the user and difficult to audit.

Credential Access

High
Category
Privilege Escalation
Content
model_config = SettingsConfigDict(
        env_prefix="XBY_GAOKAO_",
        env_file=".env",
        env_file_encoding="utf-8",
        extra="ignore",
    )
Confidence
84% confidence
Finding
Configuring automatic reads from a local .env file introduces credential access behavior for a skill whose stated purpose does not justify secret handling. In this context, loading secrets from .env expands exposure of local credentials and normalizes unnecessary secret access.

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 force-read XBY_APIKEY, bypassing the normal settings abstraction. Manual secret scraping is more dangerous because it widens the opportunity for hidden credential collection and makes review harder, especially given the mismatch between the code and the declared skill purpose.

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
The existence check precedes direct reading of the .env file for credential extraction, confirming intentional secret access logic. In a knowledge-graph skill, this behavior is disproportionate and increases the risk of accessing local secrets unrelated to user expectations.

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
90% confidence
Finding
The function dedicated to saving an API key into .env establishes plaintext credential persistence on disk. Plaintext local storage is dangerous because secrets can be exposed via repository mistakes, backups, local compromise, or support tooling, especially when the skill's declared purpose does not warrant secret management.

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
88% confidence
Finding
A helper specifically designed to set and persist an API key reinforces unnecessary credential handling for this skill. This is dangerous because it encourages durable storage and operational dependence on a secret unrelated to the advertised 红楼梦 graph functionality.

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
93% confidence
Finding
The dependency is specified with a lower-bound only (requests>=2.31.0), which allows future installs to resolve to different versions over time. This creates supply-chain and reproducibility risk because a later release could introduce breaking changes or newly disclosed vulnerabilities, and the file already references a package family with known advisories at the baseline 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
92% confidence
Finding
Using pydantic>=2.7.0 leaves dependency resolution open-ended, so installations may pull different versions in different environments. That weakens build reproducibility and can unintentionally introduce vulnerable or incompatible releases later.

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
92% confidence
Finding
The pydantic-settings package is not pinned to a specific version, which is a real dependency hygiene issue even if not immediately exploitable by itself. Unbounded upgrades increase supply-chain exposure and make the environment non-reproducible.

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
93% confidence
Finding
python-dotenv>=1.0.1 permits resolution to any later version, which is a real but low-severity supply-chain and reproducibility concern. In this case it is somewhat more notable because the package family has a cited advisory at the baseline version, so version control matters for both security and determinism.

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
96% confidence
Finding
The dependency baseline effectively includes requests 2.31.0, which has published advisories including credential leakage via malicious URLs and Session verification issues. Although this file uses a >= specifier rather than an exact pin, environments may still install 2.31.0, so the vulnerable version remains allowed and the risk is real if the skill makes outbound HTTP requests.

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
python-dotenv 1.0.1 is flagged with an advisory involving symlink following in set_key, which can enable arbitrary file overwrite in affected usage patterns. The risk depends on whether the skill actually invokes set_key on attacker-influenced paths; in a knowledge-graph skill about literary characters, that context does not inherently increase danger, but the vulnerable version is still permitted.

Static analysis

No suspicious patterns detected.