Back to skill

Security audit

文本转换工具

Security checks for vulnerabilities and agentic risk

Overview

This skill advertises text utilities but routes routine text operations, including HMAC secrets, through an external API while storing an API key in a local .env file.

Review before installing. Do not use this skill on private documents, source code, credentials, HMAC keys, or regulated data unless you trust the external API provider and accept off-machine processing. Use a scoped, revocable API key and avoid persisting it in a project .env file.

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

Lp3

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding
The skill manifests capabilities consistent with environment access, file read/write, and network use, yet declares itself as a simple text transformation tool and provides no matching permission transparency. This mismatch increases the chance that users or orchestrators grant execution to a skill whose real behavior includes credential handling and external communication they did not expect.

Description-Behavior Mismatch

High
Confidence
98% confidence
Finding
A text conversion/formatting skill should not require an external API key to perform basic local transformations such as casing, encoding, counting, or formatting. Requiring a third-party credential strongly suggests the documented purpose is deceptive or that the skill is routing user data to an unrelated remote service, creating credential exposure and unnecessary data exfiltration risk.

Description-Behavior Mismatch

High
Confidence
97% confidence
Finding
The workflow states that code only calls an API and that raw API responses should be shown directly, which is inconsistent with the semantics of the listed local text tools. This indicates the skill may act as a misleading proxy that forwards arbitrary user text to an external backend, bypassing user expectations about local-only processing and potentially leaking sensitive content.

Intent-Code Divergence

Critical
Confidence
99% confidence
Finding
The skill references a different project identity (`xiaobenyang_gaokao_skill`) and an unrelated function (`search_schools`) despite presenting itself as a text conversion utility. This direct contradiction is a strong indicator of copied or swapped instructions and suggests the skill may invoke unrelated backend logic, collect credentials under false pretenses, or route data to an unintended service.

Context-Inappropriate Capability

Medium
Confidence
95% confidence
Finding
The skill instructs the agent to check for, request, and persist an API key even though such capability is unnecessary for ordinary text transformations. This expands the trust boundary from harmless text processing to credential collection and storage, increasing the risk of secret mishandling and abuse.

Description-Behavior Mismatch

Medium
Confidence
91% confidence
Finding
The file implements a generic HTTP client that forwards arbitrary tool invocations, parameters, MCP IDs, and an API key to an upstream service, which does not align with the stated purpose of a local text transformation/formatting/analysis tool. This mismatch is dangerous because it expands the trust boundary: user-provided content and tool selections are sent off-box to a remote service, enabling unexpected data exfiltration, hidden functionality, and behavior that cannot be audited from this skill alone.

Context-Inappropriate Capability

Medium
Confidence
94% confidence
Finding
This code performs outbound network requests authenticated with an API key and dispatches calls based on caller-controlled tool metadata, despite the skill being presented as a text conversion utility. In this context, hidden remote execution capability is risky because sensitive text being processed by the skill may be transmitted to an external service without clear justification, and the generic dispatch design can be abused to invoke unintended upstream capabilities.

Description-Behavior Mismatch

High
Confidence
98% confidence
Finding
This code persists an API credential to a local .env file and exposes helper functions specifically for long-term secret storage. For a skill described as a text-conversion/formatting tool, collecting and persisting credentials is out of scope and increases the risk of secret leakage via source control, local file disclosure, backups, or other tooling that reads workspace files.

Context-Inappropriate Capability

High
Confidence
97% confidence
Finding
The skill not only stores credentials but also mutates process environment state by writing os.environ["XBY_APIKEY"]. This creates unnecessary secret-handling capability for a text utility and can make the credential available to other code in the same process, plugins, logs, crash dumps, or child operations.

Intent-Code Divergence

Medium
Confidence
90% confidence
Finding
The docstring identifies the settings as belonging to a different skill ("小笨羊高考Skill配置") than the manifest’s text-conversion tool. This mismatch is a trust and provenance problem: it suggests code reuse from an unrelated project, making hidden capabilities such as external API access and credential handling more suspicious and harder for users to evaluate safely.

Description-Behavior Mismatch

Medium
Confidence
97% confidence
Finding
The file presents a large set of ordinary text-processing helpers, but every function forwards user-provided content to a remote API via call_api(). That creates a data-exfiltration and trust-boundary mismatch: users and integrators may reasonably expect local-only handling for routine transformations, yet potentially sensitive text is transmitted off-host.

Context-Inappropriate Capability

Medium
Confidence
94% confidence
Finding
Using a remote API for basic text utilities is unnecessary for the stated purpose and expands the attack surface without functional need. This design exposes all submitted text to third-party systems, creating confidentiality, compliance, and supply-chain risk if the external service is compromised, misconfigured, or changes behavior.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The skill asks users for an API key and saves it, but provides no warning about where the secret is stored, who can access it, whether it is encrypted, or what service will use it. Lack of credential-handling transparency can lead to accidental disclosure, insecure persistence, and users supplying secrets without informed consent.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The code writes the API key to .env without any visible user-facing warning, consent flow, or storage guidance. Users may reasonably expect a text tool not to persist secrets, and silent credential storage can lead to accidental disclosure through repository commits, shared workspaces, or insecure file permissions.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
At this call site pattern, user text is packaged into arguments and sent to an external API with no warning in the tool interface or docstrings that content leaves the local environment. Because these helpers may be used on source code, configs, credentials, or private documents, the lack of disclosure can cause unintentional leakage of sensitive data.

Missing User Warnings

High
Confidence
99% confidence
Finding
The generate_hmac function sends both the message text and the secret HMAC key to an external API. Secret key material should not be exposed to third-party services for routine cryptographic operations; doing so can directly compromise message authentication, enable impersonation, and invalidate the security guarantees of HMAC.

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
93% confidence
Finding
This code force-reads .env and extracts XBY_APIKEY manually, bypassing normal settings handling and explicitly targeting a secret. In the context of a text-conversion tool, this creates unjustified credential access behavior and increases the chance of unauthorized secret use, especially given the unrelated skill naming and external service configuration.

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
Opening and reading the entire .env file to search for a specific API key is direct credential-access logic. This is more dangerous in this skill context because the manifest describes a text utility, so users would not expect hidden code paths that inspect secret-bearing configuration files.

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 explicitly dedicated to saving an API key into .env, creating persistent local secret storage. That is dangerous because .env files are frequently mishandled, copied, backed up, or committed, and the capability is not justified by the advertised text-processing role of the skill.

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 persists the provided credential to .env as part of normal operation, embedding secret storage into the skill interface. This normalizes unsafe credential handling and can mislead users into storing sensitive tokens locally without understanding the exposure risks.

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
94% confidence
Finding
The dependency is specified with a lower-bound version only, which permits future installs to resolve to different versions over time. This undermines reproducibility and can unexpectedly introduce breaking changes or newly vulnerable releases into the skill's environment.

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
94% confidence
Finding
Using an unpinned version for pydantic allows dependency resolution to drift across installations, reducing build determinism. That can expose the project to supply-chain risk or accidental adoption of incompatible or insecure releases.

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
94% confidence
Finding
A minimum-only constraint on pydantic-settings means the actual installed version may vary based on package index state and transitive dependencies. This can lead to inconsistent behavior and unreviewed security exposure over time.

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
94% confidence
Finding
python-dotenv is not pinned, so deployments may install different versions at different times. In a development-workflow-integrated skill, that increases supply-chain uncertainty and can silently pull in vulnerable releases.

Known Vulnerable Dependency: requests==2.31.0 — 3 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)

Low
Category
Supply Chain
Confidence
96% confidence
Finding
The allowed range includes requests 2.31.0, which has published advisories including credential leakage via malicious URLs and session verification issues. Because this skill is an MCP server integrated into developer workflows and likely performs network operations, an affected requests version could expose secrets or weaken transport security if the package resolves to that vulnerable release.

Static analysis

No suspicious patterns detected.