Back to skill

Security audit

电动自行车检测

Security checks for vulnerabilities and agentic risk

Overview

The skill appears to be a disclosed API-backed e-bike image detector, but users should know it stores an API key locally and sends image inputs to an external service.

Install only if you are comfortable giving this skill a XiaoBenYang API key and sending the selected image URL or base64 image content to XiaoBenYang's API. Treat the .env file as sensitive because it will contain XBY_APIKEY in plaintext, and consider removing it when you no longer use the skill. The stale Gaokao references are a packaging quality concern, so review updates carefully before upgrading.

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

Lp3

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding
The skill documentation instructs the agent to read environment/config values, write an API key via `set_api_key`, and call a remote API, but it declares no corresponding permissions. This creates a transparency and policy-enforcement gap: users and platforms may not realize the skill can access credentials, write local state, and transmit data over the network.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The skill claims to perform electric-bicycle detection, but the documented behavior also includes collecting API keys, persisting them locally/in environment state, and sending requests to an external service. This mismatch is dangerous because users may provide sensitive credentials and image data without understanding the true data flows or storage behavior.

Description-Behavior Mismatch

High
Confidence
98% confidence
Finding
The file’s functionality is materially inconsistent with the declared skill purpose: instead of image-based e-bike detection logic, it implements configuration for a different '高考' skill and handles API key persistence. That mismatch is dangerous because it can conceal undeclared credential-handling behavior inside an unrelated skill, reducing user scrutiny and increasing supply-chain trust abuse risk.

Context-Inappropriate Capability

Medium
Confidence
93% confidence
Finding
The skill includes the ability to persistently store and manage an API key in a local .env file, which is unrelated to simple image inference for e-bike detection as described. Undisclosed secret persistence broadens the attack surface by leaving credentials on disk where they may be exposed through logs, backups, repository mistakes, or later compromise.

Intent-Code Divergence

High
Confidence
97% confidence
Finding
The class docstring explicitly identifies this as a '高考Skill配置', directly contradicting the advertised e-bike detection skill. Such provenance and purpose mismatch is a strong indicator of repackaged or mislabeled code, which is dangerous because it can hide unexpected capabilities like credential handling in a seemingly harmless computer-vision skill.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The skill asks users for an API key and processes image inputs via an external service, yet it provides no clear warning that credentials and image data may be transmitted off-platform. This undermines informed consent and may expose sensitive user data or secrets to third parties unexpectedly.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The code writes the provided API key to a .env file without any user-facing warning, consent flow, or disclosure. Silent persistence of secrets is risky because users may assume the key is transient while it remains on disk and becomes accessible to other local processes, accidental commits, or forensic recovery.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The function sends a user-supplied image URL to an external API service via call_api, but this file provides no disclosure, consent check, or data-handling notice. Even if expected for the skill’s functionality, transmitting image-derived user data to a third party can create privacy, compliance, and data-governance risk, especially if users do not realize their content leaves the local system.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
This function transmits raw base64-encoded image content to an external API, which may include sensitive visual information or metadata embedded in the image payload. Because the transfer is inherent to the feature but not accompanied here by any explicit warning or consent mechanism, it presents a genuine privacy and compliance issue rather than a code-execution flaw.

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
84% confidence
Finding
This code forcibly reads XBY_APIKEY directly from the .env file in custom logic, bypassing normal configuration expectations and tying the skill to local credential file inspection. In the context of a mislabeled e-bike detection skill, this undisclosed secret-reading behavior is more suspicious because it is unrelated to the advertised function.

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
84% confidence
Finding
The existence check precedes direct reading of the local .env file to extract a specific API key, which is unnecessary for a skill advertised as offline image detection. This creates hidden credential dependency and increases the chance of secret exposure through local file handling or code reuse in an untrusted package.

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
93% confidence
Finding
This function is dedicated to saving an API key into .env, creating persistent local secret storage inside a skill whose stated purpose does not justify such behavior. Persisting credentials in plaintext on disk increases exposure to accidental commits, local compromise, and unauthorized reuse.

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
92% confidence
Finding
The set_api_key function explicitly persists the provided secret to .env, making credential storage a first-class capability of the skill. In context, that is more dangerous because the skill is presented as a simple image detector, so users may not expect or review local secret persistence behavior.

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, which allows future installs to resolve to newer, unreviewed versions and makes builds non-reproducible. In a security-sensitive deployment pipeline, this can introduce vulnerable or breaking package versions without explicit approval.

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
Using an unpinned version for pydantic permits uncontrolled upgrades during installation, reducing reproducibility and potentially introducing vulnerable or incompatible releases. This is a supply-chain hygiene issue rather than an immediate exploit by itself.

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
A minimum-only version constraint for pydantic-settings means installs may pull newer transitive states over time, making the environment drift and weakening supply-chain control. This can expose deployments to newly introduced vulnerabilities or unexpected behavior.

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 unpinned python-dotenv dependency allows uncontrolled version selection across environments, which undermines reproducibility and can silently introduce insecure versions. This is especially relevant because the package also has a known advisory at the matched minimum version.

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 permits requests 2.31.0, and the static analysis indicates that version has multiple published advisories. If the skill performs outbound HTTP requests against attacker-controlled URLs or uses affected utility functions, these issues could lead to credential leakage, verification bypass in some session flows, or unsafe file handling.

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
93% confidence
Finding
The allowed version includes python-dotenv 1.0.1, which is flagged for a symlink-following issue in set_key that can enable arbitrary file overwrite in affected usage patterns. The actual exploitability depends on whether this skill invokes set_key on attacker-influenced paths, but carrying a known vulnerable version is still a valid dependency risk.

Static analysis

No suspicious patterns detected.