Back to skill

Security audit

手机检测

Security checks for vulnerabilities and agentic risk

Overview

This skill is a remote phone-detection wrapper that is mostly coherent, but users should understand it sends images to an external API and stores the API key locally in a plaintext .env file.

Install only if you are comfortable sharing the submitted image or image URL with XiaoBenYang's API service and storing your XBY API key in a local plaintext .env file. Avoid sensitive images, use a limited/rotatable API key, and delete or rotate the key when you no longer use the skill.

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
92% confidence
Finding
The skill declares no permissions while its documented/project capabilities include environment access, file read/write, and network use. This creates a transparency and governance gap: users and reviewers are not informed that the skill can persist secrets, read local configuration, and send data externally.

Description-Behavior Mismatch

High
Confidence
99% confidence
Finding
The file’s behavior is materially inconsistent with the declared skill purpose of phone detection. Instead of image-model configuration, it implements remote service configuration and API key handling for an unrelated '高考' service, which is a strong indicator of hidden capability or repurposed code that could enable unauthorized outbound access and credential use.

Context-Inappropriate Capability

High
Confidence
98% confidence
Finding
The code reads, stores, and exposes an API key via .env and process environment despite this skill being described as local phone detection. In this context, credential handling is unnecessary and dangerous because it creates secret persistence and potential misuse paths unrelated to the advertised functionality.

Context-Inappropriate Capability

Medium
Confidence
95% confidence
Finding
The hardcoded remote endpoint and MCP identifier are unrelated to phone detection and suggest hidden integration with an external service. In a mismatched skill, such undeclared connectivity expands the attack surface and can facilitate covert data transfer or unauthorized API use.

Intent-Code Divergence

High
Confidence
97% confidence
Finding
The class docstring explicitly identifies the code as configuration for a different '高考' skill, directly conflicting with the declared phone-detection purpose. This mismatch is a strong supply-chain red flag because it suggests the package may be mislabeled, repurposed, or intentionally hiding unrelated capabilities.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The skill instructs the model to ask for an API key and persist it via configuration storage without clearly warning the user that the credential is sensitive and will be stored. This can lead to inadvertent secret disclosure, unsafe retention, or reuse of a personal credential beyond the user's expectations.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The skill asks users for image URLs or base64 image content but does not warn that the image data will be transmitted to an external API service. Images can contain sensitive personal or proprietary information, so silent transmission undermines informed consent and may violate privacy expectations.

Missing User Warnings

Medium
Confidence
88% confidence
Finding
The function persists a supplied API key to a plaintext .env file without any visible consent, warning, or secure-storage mechanism. This increases the risk of accidental credential disclosure through source control, backups, local compromise, or multi-user environments.

Ssd 3

Medium
Confidence
91% confidence
Finding
The combined behavior of collecting and persisting a user-provided API key, then instructing the model to continue processing, expands the risk of secret mishandling. Because the skill also emphasizes direct presentation of raw outputs elsewhere, the overall design lacks safeguards against exposing sensitive values or related metadata in downstream responses/logs.

Ssd 3

Medium
Confidence
93% confidence
Finding
Instructing the model to directly display raw API responses without filtering can expose sensitive fields, internal identifiers, error traces, or echoed user inputs from the upstream service. Since this skill handles credentials and user-supplied image data, unreviewed passthrough responses increase the chance of privacy leakage and accidental disclosure.

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 loading from .env enables credential ingestion from a plaintext local file. In this skill context, where credential access appears unrelated to the advertised function, that behavior unnecessarily broadens secret exposure and supports hidden service integration.

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
95% confidence
Finding
The code explicitly forces reading XBY_APIKEY from .env in model_post_init, bypassing normal transparent configuration expectations. In a mislabeled phone-detection skill, deliberate secret extraction logic is especially suspicious because it indicates active credential access unrelated to the claimed 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
Creating a direct Path to .env and reading it as text is explicit credential-access behavior. Because the skill’s declared purpose does not justify secret retrieval, this line contributes to an unnecessary and potentially covert secret-handling path.

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
92% confidence
Finding
The environment-variable override continues the secret-loading flow by prioritizing XBY_APIKEY from process state. In isolation this is common config behavior, but in this mismatched skill it strengthens the assessment that the code is built to acquire and use credentials unrelated to phone detection.

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
The save_api_key_to_env function is dedicated to writing credentials into a plaintext .env file. This creates a persistent local secret store that is easy to leak and is not appropriate for a skill whose published purpose does not require credential 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
90% confidence
Finding
The set_api_key entry point normalizes and persists credentials for later use, extending the secret-management surface of the skill. In this context, that behavior is unnecessary, increases the chance of misuse, and supports undeclared external service access.

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 only, which permits installation of many different future versions and undermines build reproducibility. In a supply-chain context, this can lead to unexpected or vulnerable versions being resolved over time, especially because this same package is also flagged with known advisories at version 2.31.0.

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 with only a minimum version allows unreviewed newer releases to be installed, creating version drift and supply-chain risk. While no specific CVE is cited here, unpinned dependencies reduce reproducibility and can introduce breaking or insecure changes unexpectedly.

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 unpinned, so deployments may silently pull different versions over time. This is a software supply-chain hygiene issue that can expose the skill to regressions or newly introduced vulnerabilities without code changes.

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
python-dotenv is specified with only a lower bound, which permits resolver drift and weakens dependency integrity. This is more concerning because the same version family is separately flagged with a known advisory, so loose pinning can leave vulnerable versions in place or reintroduce them.

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
97% confidence
Finding
The requirement allows requests 2.31.0, which is identified with multiple known advisories. If the skill performs outbound HTTP requests—which is plausible given the package choice—issues such as credential leakage, request verification flaws, or unsafe temporary-file behavior could expose secrets or compromise request integrity.

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 a symlink-following file overwrite issue in set_key. If the skill or supporting tooling writes .env files in a writable or attacker-influenced location, this could allow arbitrary file overwrite via symlink abuse, though the actual exploitability depends on whether set_key is used.

Static analysis

No suspicious patterns detected.