Back to skill

Security audit

文本转换工具

Security checks for vulnerabilities and agentic risk

Overview

This text utility is API-backed and stores an API key locally, with under-disclosed data exposure for user text and HMAC secrets.

Review before installing. Do not use this skill for confidential text, production secrets, HMAC keys, tokens, private source code, regulated data, or proprietary documents unless you are comfortable sending that content to the XiaoBenYang API. If installed, use a scoped API key, keep .env out of source control, restrict file permissions, and rotate the key if it may have been exposed.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (3)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/tools.py:830
Finding

HMAC secrets and user-supplied content are transmitted to an external service

Content
View full analysis
Dict[str, Any]: """ Generate HMAC hash Args: text: The text to hash key: The secret key for HMAC algorithm: The hashing algorithm to use Returns: """ arguments = { "text": text, "key": key, "algorithm": algorithm } return call_api("1777316659720195", "generate_hmac", arguments) ``` The shared API client then serializes and transmits those arguments: ```python headers = { "XBY-APIKEY": api_key, "func": tool_name, "mcpid": mcp_id, "Content-Type": "application/json", } t0 = time.time() try: resp = self._session.post( url=url, headers=headers, data=json.dumps(params), timeout=settings.timeout_seconds, ) resp.raise_for_status() ``` ### Technical Analysis The HMAC operation sends both the plaintext input and the HMAC secret key to `https://mcp.xiaobenyang.com/api`. HMAC is a deterministic cryptographic operation that can be performed locally and should not require disclosure of the secret key to a remote processor. The same API path is used for all text-processing functions. Consequently, text supplied for JSON, XML, HTML, SQL, encoding, hashing, regular-expression processing, and other transformations is also disclosed to the external service. Such text may contain credentials, source code, personal data, database content, or other confidential information. Transport uses HTTPS by default, which protects data in transit from ordinary network interception, but it does not protect the data from the external service, its application logs, infrastructure operators, backups, or a compromised endpoint. ...[truncated 1401 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/config.py:45
Finding

API key is persisted in a predictable plaintext file without restrictive permissions

Content
View full analysis
bool: try: env_path = Path(".env") lines = [] if env_path.exists(): lines = env_path.read_text(encoding="utf-8").splitlines() found = False new_lines = [] for line in lines: if line.startswith("XBY_APIKEY="): new_lines.append(f"XBY_APIKEY={api_key}") found = True else: new_lines.append(line) if not found: new_lines.append(f"XBY_APIKEY={api_key}") env_path.write_text("\n".join(new_lines) + "\n", encoding="utf-8") os.environ["XBY_APIKEY"] = api_key return True except Exception as e: print(f"Failed to save API key: {e}") return False ``` ### Technical Analysis The API key is written in plaintext to a `.env` file in the process's current working directory. The code does not explicitly create the file with owner-only permissions, verify the security of an existing file, or prevent symbolic-link traversal. The final permissions depend on the process umask and any pre-existing file metadata. In a shared or improperly configured environment, the file may be readable by other local users. Because the location is relative to the current working directory, the credential may also be written into a source repository or another unintended directory. The read-modify-write sequence is not atomic. If an attacker can influence the working directory or prepare the `.env` path, they may be able to redirect or observe the credential write, subject to the process's filesystem permissions. ### Attack Path 1. The Skill requests an API key from the user. 2. `set_api_key` passes the credential to `save_api_key_to_env`. 3. The function writes the key as `XBY_API ...[truncated 1154 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
requirements.txt:1
Finding

Unbounded and unlocked dependency versions create non-reproducible installations

Content
View full analysis
=2.31.0 pydantic>=2.7.0 pydantic-settings>=2.2.0 python-dotenv>=1.0.1 ``` ### Technical Analysis Every dependency is specified only with a minimum version. Installation may therefore resolve to any future version accepted by the package installer. The project provides no lock file, exact version constraints, or package hashes. This does not prove that any listed dependency is currently malicious. However, it makes builds non-reproducible and allows newly published, unreviewed versions to enter the execution environment automatically. A compromised maintainer account, malicious upstream release, or incompatible future version could affect the Skill without changes to this repository. Because Python package installation executes packaging and import-related code in the local environment, compromise of an accepted upstream release could lead to code execution with the permissions of the installing or running user. ### Attack Path 1. An operator installs the project dependencies at a later date. 2. The package resolver selects the newest versions satisfying the lower bounds. 3. A compromised, malicious, or otherwise unreviewed future release is selected. 4. Package installation or runtime import executes code from that release. 5. The dependency code runs with the privileges of the installation or Skill process. 6. Depending on those privileges, it may access local files, environment variables, the stored API key, and network resources. This path requires compromise or malicious publication through an existing upstream package or its distribution channel; no dependency confusion or typosquatted package was identified in the reviewed file. ### Impact Assessment The maximum impact is code execution with the privileges of the user or service installing or ...[truncated 426 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (35)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The documentation claims a text-processing purpose but also instructs the model to read and persist an API key in .env and manage credential state. Secret collection and local credential persistence are materially different from simple text formatting and create confidentiality and persistence risks that are not disclosed in the stated purpose.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The documentation claims a text-processing purpose but also instructs the model to read and persist an API key in .env and manage credential state. Secret collection and local credential persistence are materially different from simple text formatting and create confidentiality and persistence risks that are not disclosed in the stated purpose.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The documentation claims a text-processing purpose but also instructs the model to read and persist an API key in .env and manage credential state. Secret collection and local credential persistence are materially different from simple text formatting and create confidentiality and persistence risks that are not disclosed in the stated purpose.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

Requiring an external API key for a nominal text transformation skill strongly suggests hidden remote processing and undisclosed data flow. Users may provide secrets and content under the assumption of local-only processing, enabling credential capture and off-device transmission without clear expectation.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The workflow and project structure reference a gaokao-oriented API integration that is unrelated to the declared text-tool purpose, indicating copy-pasted or concealed functionality. Such inconsistency is a red flag because it obscures the true trust boundary and may cause users to expose data or credentials to an unintended third party.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
95% confidence
Finding

This file implements a generic authenticated HTTP client that can invoke arbitrary remote MCP tools by passing caller-controlled mcp_id, tool_name, and params to an external API. That materially exceeds the stated scope of a local text transformation/formatting/analysis skill and creates a capability-expansion risk: the skill can proxy requests to remote services using stored credentials, enabling unexpected data exfiltration or unauthorized actions through external tools.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/config.py (reported line 13)May include surrounding context.

python
model_config = SettingsConfigDict(
        env_prefix="XBY_GAOKAO_",
        env_file=".env",
        env_file_encoding="utf-8",
        extra="ignore",
    )

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
95% confidence
Finding

The configuration exposes functionality for remote API connectivity and credential handling that does not align with the declared purpose of a text transformation tool. This mismatch is dangerous because it can hide unexpected data flows to an external service and reduce user ability to make informed trust decisions about what the skill actually does.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
89% confidence
Finding

The code explicitly reads the .env file and extracts XBY_APIKEY manually, bypassing normal settings abstractions and making credential access an intentional feature. In the context of a purported text transformation skill, this hidden secret-harvesting capability is more dangerous because it suggests undisclosed dependency on external services and expands opportunities for secret misuse.

Content

Scanner excerpt · scripts/config.py (reported line 31)May include surrounding context.

python
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")

Credential Access

High
Category
Privilege Escalation
Confidence
88% confidence
Finding

This file-existence check is part of a manual workflow to inspect and read a local secrets file. In context, it contributes to intentional credential access behavior that is not justified by the stated skill purpose, increasing the chance of undisclosed secret handling and lateral exposure of local credentials.

Content

Scanner excerpt · scripts/config.py (reported line 32)May include surrounding context.

python
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():

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/config.py (reported line 39)May include surrounding context.

python
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

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

This code persists an API key to a local .env file even though credential storage is not obviously required for a text conversion utility. Storing secrets in a plaintext project file increases the risk of accidental disclosure through source control, backups, local compromise, or other tools reading workspace files.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
96% confidence
Finding

The function is explicitly designed to save an API key into a local .env file, creating persistent plaintext credential storage. In a skill whose advertised role is text processing, this capability is especially concerning because it introduces secret retention unrelated to user expectations and raises the likelihood of accidental leakage.

Content

Scanner excerpt · scripts/config.py (reported line 48)May include surrounding context.

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

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill declares no explicit tool scope or permissions even though its documented behavior includes reading environment configuration, writing API keys to local files, and making network calls. This overbroad and undeclared capability increases the chance of unintended secret access, persistence, or data egress because users and hosts cannot accurately constrain what the skill may do.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The skill metadata and operating instructions are entirely in Chinese, effectively imposing a fixed language/locale for interaction and comprehension without any opt-in or alternative language path. The file does not state that the skill is region-specific or otherwise justify this language restriction.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill asks the user for an API key and persists it locally, but the user-facing description does not warn that the credential will be stored in configuration. This lack of notice prevents informed consent and increases the risk of accidental long-term secret exposure on the host system.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The documentation simultaneously claims that code only calls APIs and lists many apparently local text-processing functions, creating an intent contradiction that obscures where computation happens. This ambiguity matters because users cannot tell whether their inputs stay local or are transmitted remotely, which affects privacy and security expectations.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

Instructing the agent to display raw API JSON directly to users can expose backend metadata, identifiers, error details, or sensitive fields that should be filtered before presentation. Combined with the hidden API-backed nature of the skill, this increases the risk of accidental information disclosure.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The natural-language strings in the public-facing docstrings and error message are exclusively in Chinese, indicating the skill is designed around a fixed language/locale. The file does not offer a language choice or document a justified region-specific constraint, which can violate the language/locale policy for skills intended for general use.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The code performs outbound network access with API-key authentication inside a skill described as a text-processing utility, which introduces hidden trust-boundary crossing. Even without obvious code injection, any text or parameters handled by the skill may be transmitted to a third-party service, and the presence of an API key means the skill can act on behalf of the user or environment in ways not implied by the skill description.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
99% confidence
Finding

The class docstring identifies the component as a gaokao-related service, contradicting the manifest that claims it is a text transformation tool. Such inconsistencies are a supply-chain red flag because they suggest code reuse from another project or misrepresentation of the skill’s true function, making hidden capabilities more likely.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill reads credentials from .env and environment variables despite its stated text-processing purpose, which signals undisclosed external-service integration. That is risky because it normalizes hidden secret consumption and may enable remote transmission of user content without clear disclosure or necessity.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The code stores an API key persistently without any visible warning, confirmation, or consent mechanism. This is dangerous because users may unknowingly leave long-lived credentials on disk, increasing exposure if the workspace is shared, committed, or inspected by other tools.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This module appears to implement basic text conversion, formatting, encoding, hashing, and regex utilities, but every function forwards user-supplied content to a remote API via call_api instead of processing locally. That creates an unnecessary data-exposure boundary: potentially sensitive text, secrets, URLs, tokens, keys, and regex inputs are transmitted off-host, which can violate user expectations and increase privacy, compliance, and supply-chain risk.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The remote API dependency is unjustified given the nature of the operations: case conversion, Base64/URL/HTML encode-decode, formatting, counting, UUID generation, hashing, and string manipulation are all feasible locally. Using an external service for such primitives broadens the attack surface and makes compromise of the remote service, logging pipeline, or transport path directly relevant to all user input handled by this skill.

Content

No source excerpt is available for this finding.