Back to skill

Security audit

跑步计算服务

Security checks for vulnerabilities and agentic risk

Overview

The skill offers running calculations but relies on a remote API, stores an API key in plaintext, and contains unrelated Gaokao/school-search remnants that make its scope unclear.

Install only if you are comfortable giving this skill a XiaoBenYang API key, storing that key in a local .env file, and sending running and heart-rate inputs to mcp.xiaobenyang.com. Review or fix the Gaokao/school-search leftovers before trusting the package identity, and prefer secure secret storage plus pinned dependencies.

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

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/config.py:48
Finding

API Key Persisted in a Plaintext 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 return True except Exception as e: print(f"保存API key失败: {e}") return False ``` ### Technical Analysis The function writes the user-provided API key directly into a plaintext `.env` file. `Path.write_text()` creates or rewrites the file according to the process umask and does not explicitly enforce owner-only permissions. If `.env` already exists, the function also rewrites it without checking its ownership, file type, or current access mode. In a shared, incorrectly permissioned, backed-up, or externally synchronized workspace, the credential may consequently become accessible outside the intended process. The API key is additionally copied into the process environment. This is conventional for configuration, but it increases exposure to processes or diagnostic systems that are able to inspect the environment. This issue does not by itself provide remote access to the host. Exploitation requires access to the workspace, its backups, or another local disclosure channel. ### Attack Path 1. A user supplies an API key as required by the ...[truncated 1099 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Note
Location
requirements.txt:1
Finding

Unbounded Dependency Versions Permit Unreviewed Future Releases

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 uses only a minimum version constraint. A fresh installation can therefore resolve to any later release accepted by the package resolver, including versions that were not tested or reviewed with this project. The package names shown are conventional and the audit found no evidence that the currently declared packages are malicious. The risk arises because installations are not reproducible and future package contents can enter the execution environment without a corresponding source-code change in this project. Python packages may execute code during installation or when imported. Consequently, compromise of an allowed future release, a malicious takeover of a dependency, or an incompatible release can affect the Skill environment. ### Attack Path 1. An attacker compromises the release process or maintainer account of one of the declared dependencies, or a future permitted release otherwise contains malicious code. 2. The attacker publishes a version greater than or equal to the declared minimum. 3. A user installs the Skill in a fresh environment without a lock file or hash verification. 4. The dependency resolver selects the newer, unreviewed release. 5. Malicious code executes during package installation or when the Skill imports the affected package. 6. The code runs with the privileges of the account installing or invoking the Skill. This path depends on an upstream supply-chain compromise or malicious permitted release; the project itself does not retrieve executable code directly at runtime. ### Impact Assessment Successful exploitation could execute code with the privileges of the installing or running user. De ...[truncated 353 chars]
Remediation
View remediation
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 (32)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill claims to provide running-related computations, but the documentation indicates reading and writing an API key in .env and references configuration associated with an unrelated gaokao service. This strongly suggests copy-paste reuse or misbound backend configuration, which can cause credentials to be stored insecurely and user requests to be routed to an unintended external service.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill claims to provide running-related computations, but the documentation indicates reading and writing an API key in .env and references configuration associated with an unrelated gaokao service. This strongly suggests copy-paste reuse or misbound backend configuration, which can cause credentials to be stored insecurely and user requests to be routed to an unintended external service.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The example call and project naming reference gaokao/school-search functionality inside a skill that claims to be for running calculations. This is a strong indicator of confused-deputy behavior or backend misrouting: a user may believe they are using a harmless sports calculator while the agent may invoke unrelated remote functionality with different data handling and permissions.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The file for a purported running-calculation service is actually wired to an unrelated remote XBY/Gaokao service, including endpoint, MCP ID, and credential handling. This functionality mismatch is dangerous because it enables undisclosed external connectivity and secret management that users would not reasonably expect from a local calculation skill, increasing the risk of data exfiltration or repurposed behavior.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The class docstring explicitly labels this as a Gaokao skill configuration, contradicting the advertised running-calculation purpose. Such identity mismatches are a strong signal of repackaged or misplaced code and undermine trust, because they can hide undeclared functionality and make review or user consent ineffective.

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
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 32)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
94% confidence
Finding

This code explicitly reads the .env file and extracts XBY_APIKEY outside normal settings handling, creating custom secret-access logic for a service whose declared purpose does not justify credential collection. The manual parsing bypasses safer secret-management patterns and makes hidden credential handling harder to audit.

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

This function persists an API key to a project-local .env file, creating durable secret storage in a context where users expect simple running calculations rather than credential management. Stored secrets can be exposed via local file disclosure, accidental repository commits, shared development environments, or later malicious code reuse.

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

The skill declares no explicit tool scope or permission boundaries even though the documentation indicates capabilities for environment access, file reads/writes, and network calls. In an agent setting, missing scope declarations can let a seemingly simple running calculator request broader-sensitive operations than users expect, increasing the risk of unintended credential handling or remote data exfiltration.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

A running calculator should not normally require users to provide and store a third-party API key unless that dependency is clearly justified. Requiring credential collection and persistence broadens the attack surface and can lead to accidental secret exposure, especially because the skill gives no security guidance for handling the key.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill asks the agent to collect a user API key and save it, but provides no warning about persistence, storage location, reuse, or who can later access that credential. In agent environments, silent secret collection and persistence can lead to credential theft, accidental disclosure in logs, or reuse by unrelated tasks.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The documentation states that the model acts as a routing layer and the code only calls an API, which conflicts with the advertised scope of a direct running-calculation utility. This inconsistency makes the skill more dangerous because it hides that user queries and parameters may be forwarded externally rather than processed locally.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This file includes natural-language docstrings and error/messages entirely in Chinese, such as the class and function descriptions and the API-key error message. Under the stated policy, forcing a specific language without user opt-in or a documented regional justification is a locale-policy violation.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill includes code to store and manage an external API key even though the described capability is offline running metric calculations. Unnecessary secret persistence expands the attack surface: any local compromise, accidental repository inclusion, or later code path can expose the credential without any clear user benefit.

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 directly to a local .env file without any visible warning, consent flow, or storage protections. Persisting credentials silently can surprise users and lead to secret leakage through backups, logs, shared workspaces, or accidental source control commits.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The manifest describes a server that provides running calculation tools, which implies local implementation of those calculations. In this file, every advertised function simply packages inputs and forwards them through call_api to an external backend, meaning the skill's real operation is remote API brokering rather than performing calculations itself.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

Multiple functions forward user-supplied performance and health-adjacent data to an external API via call_api, but this file does not provide explicit disclosure or consent signaling that data leaves the local environment. That creates a privacy risk because users may reasonably expect a local calculation tool, while their data is actually transmitted to a third party or remote backend.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The mcmillan_heart_rate_zones function transmits age, resting heart rate, and possibly max heart rate to an external API without explicit notice in the interface that sensitive health-related data leaves the local environment. In the context of a fitness tool, such data can be personal and sensitive, making undisclosed remote transmission a meaningful privacy and compliance concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

Most of the user-facing instructions and descriptions in the skill are written in Chinese, with no indication that users may interact in another language or opt into this locale. Under the language/locale policy, forcing a specific language without user choice can be a natural-language policy violation unless the restriction is clearly justified.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The file instructs the agent to display raw API responses and identifies the core modules as configuration and API-calling components, reinforcing that the skill primarily brokers external API access. This is broader and different in character from a manifest that frames the skill as a direct calculation toolset.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The instruction to expose raw API data directly undermines the expectation of a curated, narrow-purpose running tool. Passing through raw backend responses can leak unnecessary fields, internal metadata, or future-sensitive data if the remote API changes, especially since the user is not told what the backend may return.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
97% confidence
Finding

The dependency specification uses a lower-bound version range instead of pinning to an exact version, which makes builds non-reproducible and can cause the environment to resolve to a vulnerable or unexpected release. Because requests has multiple known advisories and the manifest does not constrain to a vetted version, supply-chain risk remains unresolved.

Content

Scanner excerpt · requirements.txt (reported line 1)May include surrounding context.

text
requests>=2.31.0
pydantic>=2.7.0
pydantic-settings>=2.2.0
python-dotenv>=1.0.1

Unverifiable Dependency: requests has 16 known advisory(ies) (CVE-2014-1830 (Exposure of Sensitive Information to an Unauthorized Actor in Requests); 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) +13 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
92% confidence
Finding

The manifest references requests without an exact version, and the package has known security advisories, so it is impossible to determine whether the installed release is vulnerable. In practice this means the project may silently consume a version affected by credential leakage, TLS, or other request-handling issues depending on the resolver outcome.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.