Back to skill

Security audit

火车时刻查询服务

Security checks for vulnerabilities and agentic risk

Overview

The skill is presented as a Caltrain timetable helper, but its artifacts show unrelated API-key handling and generic remote API calls that need human review before install.

Do not install this as a simple Caltrain timetable skill unless the publisher explains why it needs an XBY API key, what xiaobenyang.com receives, which remote tools are allowed, and where the API key is stored. Prefer a version that uses clearly scoped transit endpoints and platform-managed secret storage.

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

Lp3

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding
The skill documentation directs the agent to read environment/config state, write an API key to local storage, and make outbound network calls, yet no permissions are declared. This creates a transparency and consent gap: users and hosting platforms cannot accurately assess that the skill handles secrets, performs persistence, and contacts a remote service.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The declared purpose is a Caltrain/GTFS timetable skill, but the behavior includes collecting an unrelated XBY_APIKEY, persisting it locally, and using a generic remote API flow to xiaobenyang.com. That mismatch is dangerous because it can mislead users into disclosing credentials and authorizing networked behavior that is not reasonably necessary for a local transit lookup tool.

Description-Behavior Mismatch

High
Confidence
98% confidence
Finding
A skill presented as GTFS-based Caltrain lookup should not unexpectedly require an external XBY_APIKEY and off-platform API workflow without a clear, transit-specific justification. This raises the risk of credential harvesting or deceptive data exfiltration because users are induced to provide a secret unrelated to the advertised functionality.

Intent-Code Divergence

Medium
Confidence
87% confidence
Finding
The documentation says the code is merely an API caller while the exposed tool semantics imply local, purpose-built Caltrain/GTFS queries. This inconsistency obscures what actually happens with user inputs and whether requests are sent to a third party, increasing the chance of misleading users about data handling.

Description-Behavior Mismatch

High
Confidence
95% confidence
Finding
The implementation materially diverges from the declared Caltrain GTFS timetable purpose by acting as a generic client for an unrelated external MCP API with caller-controlled tool selection. This creates a hidden capability channel: users and reviewers may believe the skill only performs timetable queries, while it can actually invoke arbitrary upstream functions and transmit arbitrary data off-platform.

Context-Inappropriate Capability

High
Confidence
97% confidence
Finding
The call_tool method permits arbitrary remote function invocation via user- or caller-supplied mcp_id, tool_name, and params, with no validation or allowlist. In the context of a train timetable skill, this is over-privileged and can be abused to access unintended upstream capabilities, exfiltrate sensitive input, or perform actions unrelated to the declared service.

Description-Behavior Mismatch

High
Confidence
98% confidence
Finding
The file’s behavior is materially inconsistent with the advertised Caltrain timetable skill: it manages credentials for an unrelated 'XBY/Gaokao' service, including reading and persisting an API key. This kind of scope mismatch is dangerous because it can enable covert credential collection or unauthorized outbound service access under the guise of a benign transit tool.

Intent-Code Divergence

Medium
Confidence
92% confidence
Finding
The class docstring explicitly identifies the code as configuration for a different '小笨羊高考' skill, directly contradicting the claimed train-schedule purpose. While a docstring alone is not exploitable, in context it strongly indicates code repurposing or deceptive packaging that can hide unrelated credential flows and increase supply-chain risk.

Missing User Warnings

Medium
Confidence
97% confidence
Finding
The skill instructs the agent to ask the user for an API key and save it via configuration without warning about storage location, retention, exposure risk, or alternatives. Collecting and persisting sensitive credentials without transparent handling guidance can lead to accidental disclosure, reuse across contexts, or compromise of the user's external account.

Missing User Warnings

Medium
Confidence
82% confidence
Finding
The code serializes and sends arbitrary params directly to an external API without filtering, minimization, or any visible disclosure/consent boundary in this component. That increases privacy and data-governance risk because user-provided content or internal data may be transmitted to a third party beyond what a timetable query service reasonably requires.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The function persists a supplied API key directly into a local .env file without any explicit user-facing consent, warning, or secure storage controls. Persisting secrets in plaintext increases the chance of accidental disclosure through source control, backups, shared workspaces, or local file compromise.

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
90% confidence
Finding
The code forcibly parses the .env file for a hard-coded XBY_APIKEY outside the declared pydantic env_prefix, bypassing the normal configuration model and introducing hidden credential-reading behavior for an unrelated service. In the context of a train timetable skill, this undisclosed secret access is suspicious and increases the risk of covert credential collection.

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
90% confidence
Finding
Opening and reading the entire .env file to search for XBY_APIKEY gives this skill access to all co-located secrets in that file, even though its declared purpose is unrelated to XBY services. This broad secret access is unnecessary for a train timetable feature and raises the risk of over-collection and hidden credential use.

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 designed to write an API key into .env, creating plaintext at-rest secret storage in the application directory. That exposes credentials to accidental commit, local disclosure, and reuse by unrelated code in the same environment.

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 function persists the provided secret by design, again storing credentials for an unrelated XBY service inside a skill claiming to provide train schedules. This hidden cross-service credential management increases the likelihood of unauthorized secret retention and user deception.

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
97% confidence
Finding
The dependency is specified with a lower-bound version only, which allows future installs to resolve to different versions over time. This weakens build reproducibility and can unintentionally introduce vulnerable or incompatible 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
97% confidence
Finding
Using an unpinned pydantic version means deployments may pull different package releases depending on install time. This creates supply-chain and stability risk because a newly published upstream version could contain a regression or security issue.

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
97% confidence
Finding
An unpinned pydantic-settings dependency permits non-deterministic dependency resolution across environments. That increases the chance of consuming an unexpected package release with insecure behavior or breaking changes.

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
97% confidence
Finding
Specifying python-dotenv with only a minimum version allows installation of any newer release, making builds non-reproducible. This expands the attack surface for supply-chain issues and unexpected vulnerable versions.

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
90% confidence
Finding
The requirement permits installation of requests 2.31.0, a version with known security advisories. In a transit schedule skill that likely makes outbound HTTP requests, a vulnerable HTTP client is more relevant because malformed URLs, redirect handling, session reuse, or credential lookup behavior may be reachable through normal application flows.

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
84% confidence
Finding
The dependency range includes python-dotenv 1.0.1, which is reported with a symlink-following arbitrary file overwrite issue in set_key. This is somewhat less dangerous in the stated skill context unless the application exposes .env modification functionality or runs local tooling that edits dotenv files in attacker-influenced paths, but it remains a real dependency risk.

Static analysis

No suspicious patterns detected.