Back to skill

Security audit

数学可视化服务

Security checks for vulnerabilities and agentic risk

Overview

This skill is a remote visualization wrapper that asks for and persists an API key, but its scope and credential handling are under-disclosed.

Install only if you are comfortable sending visualization inputs to XiaoBenYang's remote API and storing the API key in a local plaintext .env file. Use a low-privilege API key, avoid confidential business or engineering data, and prefer an environment with a fixed trusted endpoint and protected working directory.

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

Warning
Location
scripts/config.py:45
Finding

API Key Stored in a Plaintext .env File Without Enforced Access Controls

Content
View full analysis
bool: """将API key保存到.env文件""" 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 ``` The Skill documentation explicitly directs the agent to collect and persist the credential: ```markdown - On first use, if `.env` does not contain `XBY_APIKEY`, the user must be asked for an API key. - After receiving the key, call `scripts.config.set_api_key(api_key)` to save it. ``` ### Technical Analysis The API key is written directly into a plaintext `.env` file. `Path.write_text()` creates the file according to the process umask and does not explicitly enforce owner-only permissions such as `0600`. Consequently, the confidentiality of the credential depends on external runtime settings. In an environment with a permissive umask, shared working directory, broad backup access, or accidental source-control inclusion, another user or process may be able to read the key. The implementation also places the key in `os.environ`, where it remains available to the current process and may be inherited by subsequently launched child processes. No command execution was found in this project, but expo ...[truncated 1216 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/call_api.py:55
Finding

Configurable API Endpoint Can Redirect Credentials to an Untrusted Host

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Note
Location
requirements.txt:1
Finding

Open-Ended Dependency Versions Prevent Reproducible and Integrity-Verified Installation

Content
View full analysis
=2.31.0 pydantic>=2.7.0 pydantic-settings>=2.2.0 python-dotenv>=1.0.1 ``` ### Technical Analysis All dependencies use open-ended minimum-version constraints. An installation may therefore resolve to any future release satisfying the lower bound. The project does not provide a lock file or package hashes, so the exact dependency artifacts reviewed or tested cannot be reproduced from the repository. The listed package names correspond to established packages; the audit found no evidence of typosquatting, dependency confusion, or a known malicious package in the provided manifest. The risk arises from uncontrolled future resolution and lack of artifact integrity verification. If a future release is compromised, introduces a security regression, or becomes incompatible, a fresh installation may automatically consume it without a source change in this project. ### Attack Path 1. The project is installed at a later date or in a clean environment. 2. The package resolver selects newer versions allowed by the `>=` constraints. 3. A selected package version contains a compromised distribution, malicious installation behavior, or an exploitable regression. 4. The package is installed and imported with the privileges of the installing or running user. 5. Malicious or vulnerable dependency behavior affects the Skill at installation or runtime. This is a supply-chain hardening concern rather than evidence that the currently named dependencies are malicious. ### Impact Assessment The potential impact depends on the behavior of a compromised dependency and the privileges used to install or run the Skill. In a worst-case supply-chain event, dependency code could execute with the current user's privileges and access the API key, submitted visualization data, and files available t ...[truncated 205 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 (54)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The documentation claims 13 math tools but lists more than 13 and includes cross-domain functions like economics, structural engineering, and logo design. Overstating or mischaracterizing capability scope is risky because reviewers may approve the skill for one purpose while it performs materially broader actions.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The documentation claims 13 math tools but lists more than 13 and includes cross-domain functions like economics, structural engineering, and logo design. Overstating or mischaracterizing capability scope is risky because reviewers may approve the skill for one purpose while it performs materially broader actions.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The documentation claims 13 math tools but lists more than 13 and includes cross-domain functions like economics, structural engineering, and logo design. Overstating or mischaracterizing capability scope is risky because reviewers may approve the skill for one purpose while it performs materially broader actions.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The manifest and top-level docs suggest a math visualization service, but these lines require collecting a user API key and saving it for use with an external service. Hidden credential collection behind an unrelated purpose is dangerous because users may disclose secrets they would never provide to a local rendering tool.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The documentation instructs the agent to ask the user for an API key and persist it via configuration, but gives no warning about storage, retention, or sensitivity handling. Prompting for raw secrets inside conversational flow creates a strong risk of credential leakage, accidental logging, and unsafe long-term storage.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The workflow describes generic API-routing behavior and even includes an unrelated example function name for school search, which strongly suggests copy-pasted or misleading documentation. This raises supply-chain risk because the actual service boundaries and data flows are unclear, making abuse and accidental over-privilege more likely.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The configuration code is materially inconsistent with the declared math-visualization skill and instead manages credentials for an unrelated remote 'XBY/Gaokao' service. That mismatch is a strong indicator of code reuse or hidden external connectivity, increasing the risk that users unknowingly provide secrets to a service outside the advertised scope.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The class docstring identifies the component as a '小笨羊高考Skill配置', directly contradicting the declared math-visualization service. This kind of identity mismatch is dangerous because it can conceal the true purpose of the code and mislead reviewers about external dependencies, credential use, and data handling.

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

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

This code manually parses the .env file to force-load a specific API key, bypassing normal configuration expectations and explicitly targeting credential material. In the context of a purported math-visualization skill, such secret-reading behavior is unexpected and increases the risk of covert credential use or user deception.

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
90% confidence
Finding

Opening and reading the local .env file to extract API credentials is direct access to secret-bearing material. In this skill context, the behavior is outside the expected functionality of mathematical visualization and therefore materially elevates concern about hidden external-service integration and secret harvesting.

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

Credential Access

High
Category
Privilege Escalation
Confidence
94% confidence
Finding

The function is explicitly designed to save an API key into a local .env file, creating persistent plaintext storage of a secret. If exploited through local compromise, accidental repository inclusion, or backup leakage, the credential can be recovered and abused against the external service.

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

Ae4

Medium
Category
analysis-evasion
Confidence
80% confidence
Finding

Suspicious Unicode normalization or mixed-script content

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding

The skill declares no explicit tool scope or permission boundaries even though its documented behavior includes environment access, file writes, and outbound network calls. That increases the blast radius of prompt-driven misuse and makes it harder for a host to enforce least privilege.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill name and description are entirely in Chinese, and the operational instructions throughout the file are written to the model in Chinese without stating that the user may choose another language. This creates a natural-language locale constraint that is not documented as optional or region-specific.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The project structure names the package as a gaokao/school-related skill, which conflicts with the claimed math visualization identity. This inconsistency is a red flag for repurposed code and makes it difficult to trust what data is processed or where requests are routed.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This code includes multiple user-facing strings in Chinese, such as the class/docstring descriptions and raised/returned error messages, but provides no mechanism for user language selection or opt-in. Under the policy, forcing a specific language without user choice is a natural-language policy violation unless the locale restriction is clearly documented and justified.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

清单描述将技能定位为“基于JSXGraph的MCP协议服务器,提供13种数学可视化工具”,但该文件实现的是一个可向配置的上游地址发送任意 tool_name 和 params 的通用 HTTP 客户端。代码没有体现与 JSXGraph 或数学可视化直接绑定的限制,语义上超出了描述中看起来较为专用的可视化服务范围。

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
82% confidence
Finding

此代码会读取 API Key 并向 settings.base_url 指定的远程端点发起 POST 请求,请求头中还允许动态指定 func/tool。对于一个描述为数学可视化服务的技能,这种通用外部 API 代理能力并非从用途上直接可推导出的必要能力,尤其当清单未明确说明其会充当远程 MCP 网关时。

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The file provides functionality to persist and manage an external API key in a local .env file, which exceeds what users would reasonably expect from a local math-visualization tool. Unnecessary credential collection and persistence broaden the attack surface and can expose secrets through local file disclosure, backups, logs, or source-control mistakes.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The code writes the API key to .env automatically without any user-facing disclosure that the credential will be stored persistently in plaintext. Users may believe they are supplying a transient secret, while the implementation leaves a recoverable local artifact that can be accessed by other processes, users, backups, or accidental commits.

Content

No source excerpt is available for this finding.

Ae4

Medium
Category
analysis-evasion
Confidence
80% confidence
Finding

Suspicious Unicode normalization or mixed-script content

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

This function forwards user-supplied graph data to an external API via call_api without any visible disclosure in the function contract or comments that inputs leave the local environment. In a math-education context users may paste proprietary formulas, student data, or problem content, so silent remote transmission creates a meaningful privacy and trust risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

Parametric-curve inputs are sent off-box through call_api with no explicit warning in this file that user data is transmitted externally. Because the tool invites arbitrary expressions and annotations, users may unknowingly submit sensitive educational or proprietary material to a third-party backend.

Content

No source excerpt is available for this finding.