Back to skill

Security audit

图像提取转换服务

Security checks for vulnerabilities and agentic risk

Overview

This skill appears to handle images through a remote API, but its documentation and credential handling are too inconsistent for a simple image-to-base64 utility.

Install only if you are comfortable sending image content, image URLs, local-path-derived data, and an API key to the upstream service. Avoid using it with sensitive screenshots, IDs, invoices, private documents, or secrets until the publisher clearly documents the remote data flow, removes unrelated copied instructions, and makes credential persistence explicit and opt-in.

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

Lp3

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding
The skill advertises capabilities that include environment access, local file read/write, and network access, but does not declare permissions or clearly communicate those capabilities to the user. In this context, that is dangerous because the skill handles local file paths, persists API keys to a local .env file, and sends data to a remote service, creating hidden trust and consent boundaries.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The documented purpose says the skill extracts images and converts them to base64 for LLM analysis, but the actual behavior includes forwarding user data to an external API, accepting base64 directly, and persisting an API key locally. This mismatch is dangerous because users and calling agents may disclose local files, URLs, or sensitive image content under a false assumption that processing is local and limited to conversion.

Description-Behavior Mismatch

High
Confidence
96% confidence
Finding
The workflow section is internally inconsistent and even includes an unrelated example for school-search routing, which indicates copied or misleading operational instructions. That is dangerous because it undermines trust in what the skill actually does and increases the risk that an agent will invoke the wrong operations, mishandle credentials, or expose unrelated raw API data.

Intent-Code Divergence

Medium
Confidence
90% confidence
Finding
The tool descriptions focus on extraction and analysis of images, while the manifest frames the skill as image-to-base64 conversion. This contradiction is dangerous because users may consent to a simple format conversion while the skill actually performs remote analysis, which can reveal image contents and embedded text.

Intent-Code Divergence

Medium
Confidence
93% confidence
Finding
The return-value instructions tell the agent to present raw API results, which conflicts with the stated purpose of conversion and increases the chance of exposing more data than necessary. Returning raw upstream data can leak sensitive metadata, analysis content, or implementation details to the end user or calling system.

Description-Behavior Mismatch

High
Confidence
96% confidence
Finding
The file implements API credential persistence and global credential management even though the declared skill purpose is local/URL image extraction and base64 conversion. This mismatch expands the skill's privilege surface and can enable unintended secret collection or retention, especially in an agent environment where users may not expect credential handling.

Context-Inappropriate Capability

High
Confidence
97% confidence
Finding
The code reads, writes, and exposes an API key through both .env and process environment variables, which is an unnecessary credential-management capability for an image-to-base64 utility. In skill ecosystems, unjustified secret handling is dangerous because it creates opportunities for credential capture, accidental leakage, or reuse by other components.

Intent-Code Divergence

Medium
Confidence
88% confidence
Finding
The settings docstring references a different domain (高考/education-related skill) than the manifest's image extraction service, indicating code reuse or repackaging without alignment. That discrepancy undermines trust in the stated behavior and raises the risk that unrelated functionality, endpoints, or data handling may be present but undisclosed.

Missing User Warnings

Medium
Confidence
97% confidence
Finding
The skill asks for local file paths, URLs, and base64 image data, but does not warn users that the content may be sent to an external API for processing. In this context, that is a meaningful privacy issue because screenshots, documents, and photos often contain secrets, personal data, or regulated information that users may not expect to leave the local environment.

Missing User Warnings

Medium
Confidence
88% confidence
Finding
This code transmits both the API key and arbitrary tool parameters to an upstream service over HTTP(S) without any user-facing notice, consent, or minimization controls in this file. In the context of an image extraction/conversion skill that may handle local files or fetched URL content for LLM analysis, parameters can contain sensitive paths, URLs, or derived data, so silent forwarding increases privacy and data-exposure risk.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The function persists the API key to .env without any user-facing warning, confirmation, or disclosure that the secret will be stored on disk. Silent credential persistence increases the chance of long-term secret exposure through source control mistakes, backups, shared workspaces, or local file compromise.

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
90% confidence
Finding
Configuring pydantic to load from a local .env file establishes a credential access path for the skill. In the context of an image/base64 service, this is suspicious because it introduces secret-reading capability unrelated to the declared function and can pull in sensitive values from the runtime environment.

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
98% confidence
Finding
The model_post_init method forcibly reads .env to extract XBY_APIKEY, bypassing normal minimal-privilege expectations for a simple image conversion tool. Explicit secret file parsing increases the chance of unauthorized credential use and is especially concerning given the skill's stated purpose mismatch.

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
90% confidence
Finding
Creating a direct Path to .env is part of an intentional local secret access workflow. While not dangerous in isolation, here it supports unnecessary credential handling in a skill whose advertised purpose does not justify reading local secret files.

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
95% confidence
Finding
The code explicitly reads XBY_APIKEY from the process environment, granting the skill access to externally supplied credentials. In a mismatched skill context, this increases the risk that the component can consume secrets users did not expect it to need, broadening the blast radius if the skill is compromised or repurposed.

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
95% confidence
Finding
This function is dedicated to saving an API key into .env, creating persistent on-disk secret storage. Persistent secret storage in a tool that should only process images is an unjustified capability that materially raises exposure risk through filesystem access, backups, and accidental commits.

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
94% confidence
Finding
The set_api_key helper normalizes and persists a secret as part of normal application behavior, making credential capture and retention a first-class feature of the skill. That is disproportionate to the declared image conversion function and increases the likelihood of secret misuse or unintended propagation.

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 makes builds non-reproducible and allows future installs to pull in unexpected versions, including versions later found vulnerable or incompatible. In a service that fetches local files and remote URLs for image processing, dependency drift can directly affect network-handling security 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
88% confidence
Finding
Using `pydantic>=2.7.0` leaves the resolved version open-ended, which can introduce unreviewed upstream changes and reduce reproducibility across environments. While not an immediately exploitable bug by itself, it weakens supply-chain control and can amplify risk in an agent-exposed 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
88% confidence
Finding
`pydantic-settings>=2.2.0` is unpinned, so deployments may resolve to different versions over time, making behavior less predictable and increasing supply-chain exposure. For a service likely driven by configuration and environment variables, unexpected dependency changes can have security-relevant side effects.

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
`python-dotenv>=1.0.1` is unpinned, which permits uncontrolled upgrades and also currently allows resolution to a version with a known advisory if the minimum version is selected. In configuration-loading libraries, even low-severity file-handling flaws can matter if the service runs with access to sensitive files.

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
95% confidence
Finding
The finding indicates `requests==2.31.0`, a version with multiple published advisories, including issues around credential leakage via malicious URLs and request verification/session behavior. Because this skill explicitly fetches content from URLs, vulnerable HTTP client behavior is more relevant than in an offline-only tool and could expose secrets or weaken transport security assumptions.

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
82% confidence
Finding
The finding flags `python-dotenv==1.0.1` with a low-severity advisory involving symlink following in `set_key`, which can enable arbitrary file overwrite in affected usage patterns. This is context-dependent and may not be reachable unless the application actually uses the vulnerable write path, but as a dependency issue it remains a real risk until confirmed otherwise.

Static analysis

No suspicious patterns detected.