Back to skill

Security audit

随机数生成服务

Security checks for vulnerabilities and agentic risk

Overview

This skill should go to Review because it presents itself as a drand randomness tool but routes through XiaoBenYang, asks for an API key, and stores that key locally while carrying unrelated Gaokao template artifacts.

Install only if you intentionally want to use XiaoBenYang as a proxy for randomness and are comfortable providing an API key that will be stored in plaintext .env. Do not rely on this for high-integrity verifiable randomness unless you independently verify returned drand values and the publisher fixes the Gaokao/template mismatches and secret-storage behavior.

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
92% confidence
Finding
The skill documents capabilities that involve environment access, file read/write, and network use, but it does not declare permissions or clearly bound those operations. This reduces transparency and weakens sandboxing or review controls, especially because the workflow includes reading and persisting secrets locally.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
The skill claims to provide verifiable drand randomness, but its behavior includes collecting an API key, storing it locally, and depending on a XiaoBenYang service rather than clearly interacting with drand itself. This mismatch can mislead users into granting secrets and trust under false assumptions about what service is actually being used.

Intent-Code Divergence

High
Confidence
98% confidence
Finding
The document says the skill is a drand randomness service, but the API key source, tool semantics, and surrounding text reference an unrelated gaokao/school-query ecosystem. This strong identity mismatch is dangerous because it suggests copy-pasted or repurposed instructions that may route user requests and credentials to an unintended external service.

Intent-Code Divergence

Medium
Confidence
94% confidence
Finding
The workflow example calls a school-search tool even though the skill is presented as a randomness service. Such contradictory invocation guidance can cause the agent to select the wrong tool path or expose user inputs to unrelated functions/services.

Intent-Code Divergence

Medium
Confidence
93% confidence
Finding
The project structure names a gaokao-related directory for a supposedly randomness-focused skill, indicating likely template reuse or packaging confusion. This increases the risk that the wrong code, endpoints, or secret-handling logic are shipped under a misleading name.

Description-Behavior Mismatch

High
Confidence
98% confidence
Finding
The file claims to belong to a random-number service, but the implementation is centered on unrelated XBY/Gaokao API credential loading, overriding, and persistence. This kind of capability mismatch is a strong supply-chain red flag because it can trick operators into installing a skill that silently manages secrets for an unrelated external service.

Context-Inappropriate Capability

Medium
Confidence
92% confidence
Finding
The code persists an API key to a local .env file even though the described skill only needs random-number retrieval. Writing secrets to disk increases exposure through source control leakage, backups, shared workspaces, and local file disclosure, especially when the persistence behavior is not clearly justified by the skill's declared function.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
The function writes API credentials to disk without any visible user-facing warning, confirmation, or indication that the secret will be persisted. In the context of a skill whose advertised purpose is unrelated to credential management, this silent persistence materially increases the risk of accidental secret disclosure and violates least surprise.

Ssd 3

Medium
Confidence
96% confidence
Finding
The skill explicitly instructs the model to solicit an API key from the user and persist it to a local .env file. This creates a credential-collection and storage workflow in plain language, increasing the chance of secret over-collection, insecure local retention, accidental disclosure, or reuse outside the user's intent.

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 manually reads .env and extracts a specific API key outside the normal settings framework, creating custom secret-access logic for an unrelated external service. In this skill context, manually parsing and prioritizing third-party credentials is suspicious and increases the chance of unintended secret collection or misuse.

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
Checking for and reading a local .env file is part of the file's custom credential-access path for XBY_APIKEY, which is unrelated to the stated random-number functionality. This expands the skill's ability to inspect locally stored secrets and is therefore risky in the context of a potentially deceptive skill.

Credential Access

High
Category
Privilege Escalation
Content
if line.startswith("XBY_APIKEY="):
                    self.api_key = line.split("=", 1)[1].strip()
                    break
        # 如果环境变量有值,覆盖 .env 的值
        env_val = os.getenv("XBY_APIKEY", "")
        if env_val:
            self.api_key = env_val
Confidence
86% confidence
Finding
The code reads XBY_APIKEY from the process environment and applies it as the active credential, again for a service unrelated to the declared skill purpose. Accessing ambient credentials in a misleadingly described component can expose existing secrets to unintended code paths and increases supply-chain risk.

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
91% confidence
Finding
This function is explicitly designed to save an API key into a plaintext .env file, which creates a durable local copy of a secret. Plaintext secret persistence is risky because it may be exposed through repository commits, logs, backups, multi-user systems, or local compromise.

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
90% confidence
Finding
The public helper to set and persist an API key makes durable credential storage part of the normal control flow for this skill. Given the mismatch between the declared random-number service and the implemented XBY credential management, this capability is more dangerous because users may not expect the skill to request, retain, or manage unrelated secrets.

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 constraint only, which permits installation of different future versions across environments and over time. This creates supply-chain and reproducibility risk because builds may unexpectedly pull newly released versions, including versions with breaking changes or newly introduced vulnerabilities.

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 version range for pydantic makes installations non-reproducible and increases supply-chain risk. A future release satisfying the constraint could introduce security regressions or incompatible behavior that affects validation logic used by the service.

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 pinned to an exact version, so deployment behavior may vary between environments and over time. This weakens build integrity and can silently introduce vulnerable or incompatible transitive code into the service.

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
An unpinned python-dotenv dependency allows future satisfying releases to be installed without explicit review. That increases supply-chain exposure and can import behavior or security issues unexpectedly into the runtime environment.

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
93% confidence
Finding
The requirements allow requests 2.31.0 or newer, and the finding identifies 2.31.0 as a version with multiple published advisories. If the environment resolves to that version, the service may inherit issues such as credential leakage or request verification flaws, which is more concerning in a network-facing random-number service that likely performs 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
78% confidence
Finding
The dependency range includes python-dotenv 1.0.1, which is reported as affected by a symlink-following file overwrite issue in set_key. This is lower risk in the presented skill context because a randomness service may not expose dotenv file editing functionality, but the vulnerable version is still permitted and could be dangerous if administrative or setup tooling invokes the affected API on attacker-controlled paths.

Static analysis

No suspicious patterns detected.