Back to skill

Security audit

语音合成服务

Security checks for vulnerabilities and agentic risk

Overview

This skill appears to be a remote speech-generation wrapper, but it stores an API key in a local plaintext .env file and has enough documentation/provenance mismatches to warrant careful review before use.

Install only if you are comfortable giving this skill a XiaoBenYang API key, having that key saved in a local plaintext .env file, and sending speech text to the remote XiaoBenYang API. Avoid using it with confidential text or high-value credentials unless the publisher clarifies storage, endpoint, retention, and removes the unrelated template residue.

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
90% confidence
Finding
The skill exposes capabilities to read environment variables, read/write local files, and make network requests, yet it declares no permissions or trust boundaries. This is dangerous because users and hosting platforms cannot accurately assess that the skill will persist secrets locally and send data to a remote service.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
The documented behavior does not match the stated purpose: instead of only providing Edge-based speech synthesis, the skill persists an API key, calls a third-party remote platform, and appears to support generic remote tool invocation. This mismatch undermines informed consent and creates a larger attack surface, since users may provide sensitive text or credentials believing processing is local or limited to TTS.

Intent-Code Divergence

Medium
Confidence
88% confidence
Finding
The workflow example instructs the model to call an unrelated school-search function, indicating copy-pasted or inconsistent routing guidance. In an agent setting, such mismatched instructions can cause unintended tool calls, data leakage to wrong backends, or execution of functionality outside the user's requested scope.

Intent-Code Divergence

Low
Confidence
72% confidence
Finding
The instruction to directly display raw API responses is inconsistent with a speech-generation tool and may expose internal metadata, storage URLs, request identifiers, or backend error details unnecessarily. While lower severity, this can leak implementation details or sensitive response fields to end users.

Intent-Code Divergence

Low
Confidence
80% confidence
Finding
The API key domain, variable naming, and project references are inconsistent with the claimed skill identity, suggesting template residue and poor provenance control. Such inconsistencies increase the risk that credentials are collected for an unexpected service or that requests are routed to the wrong backend.

Description-Behavior Mismatch

Medium
Confidence
85% confidence
Finding
The module implements local API credential persistence and retrieval logic that is not clearly aligned with the stated voice-synthesis purpose, especially given the manifest/implementation mismatch. This expands the skill's trust boundary by storing secrets on disk and mutating process environment state, increasing the chance of unintended credential exposure or abuse.

Context-Inappropriate Capability

Medium
Confidence
91% confidence
Finding
Saving API keys into a local .env file creates a plaintext secret at rest that may be exposed through backups, repository mistakes, local file reads, or other tooling. For a speech-synthesis skill, this capability is not obviously necessary and therefore raises risk beyond the declared functionality.

Intent-Code Divergence

Low
Confidence
78% confidence
Finding
The Settings docstring refers to a different skill than the manifest, indicating code reuse or documentation drift. While not directly exploitable on its own, such divergence reduces auditability and can hide capabilities or assumptions that operators do not expect.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The code persists an API key to both .env and process environment state without any user-facing disclosure or consent flow. This is dangerous because users may believe a key is used ephemerally, while the skill silently creates long-lived plaintext secret storage on the host.

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 force-reads .env manually in model_post_init specifically to extract XBY_APIKEY, bypassing the normal settings abstraction and creating bespoke credential-parsing logic. This increases secret-handling complexity, may ignore expected prefixes or policy controls, and contributes to unnecessary plaintext secret dependence.

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
Opening and reading the .env file directly for secret extraction makes the skill depend on local plaintext credential files and expands the chance of mishandling or leaking secrets through future code changes. In this context, the direct credential access is not clearly required for the advertised speech-synthesis capability.

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 explicitly persists the API key into a local .env file, creating a durable plaintext copy of a secret. Such storage is vulnerable to accidental inclusion in source control, leakage via filesystem access, or recovery from backups and logs.

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
93% confidence
Finding
The setter function is designed to persist credentials rather than merely validate or use them transiently, which broadens exposure and makes credential retention the default behavior. In a voice-synthesis skill, persistent credential management should be narrowly justified and transparently handled.

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 dependency is specified with a lower-bound only constraint, 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 a vulnerable version without any review by the project maintainer.

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 an unpinned version for pydantic means builds are not deterministic and may pull in newer releases automatically. In a service component, this increases the chance of accidental introduction of insecure or incompatible dependencies through normal installation or deployment workflows.

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
91% confidence
Finding
An unpinned pydantic-settings dependency permits uncontrolled upgrades, weakening build integrity and making security posture dependent on the package index state at install time. This is a classic supply-chain hygiene issue even if no immediate exploit is present in the file 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
92% confidence
Finding
The python-dotenv requirement is not pinned, so environments may install different versions depending on timing and resolver behavior. For infrastructure-related libraries that handle configuration files, this can expand attack surface or operational instability if an unsafe version is fetched.

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 requirement allows installation of requests 2.31.0, a version with known advisories, and the static analyzer specifically identifies multiple CVEs affecting that release. Because this skill is a network-facing service that likely performs outbound HTTP operations for cloud storage or remote integration, a vulnerable HTTP client library is more relevant and increases real exploitation risk.

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
86% confidence
Finding
The file permits installation of python-dotenv 1.0.1, which is reported to contain a symlink-following issue in set_key that can lead to arbitrary file overwrite under the right conditions. This is somewhat contextual because exploitation depends on the application actually invoking the affected functionality on attacker-influenced paths, but it remains a real dependency risk.

Static analysis

No suspicious patterns detected.