Back to skill

Security audit

时间协议服务

Security checks for vulnerabilities and agentic risk

Overview

The skill claims to provide time and timezone utilities, but it requires a XiaoBenYang API key, stores it in a local .env file, and contains mismatched Gaokao-related service metadata.

Review this before installing. Only use it if you trust the XiaoBenYang service and are comfortable storing XBY_APIKEY in a local plaintext .env file. Prefer running it in an isolated directory under an unprivileged account, and rotate or revoke the API key if it may have been exposed. The package should be cleaned up to remove Gaokao remnants and should narrow credential and network behavior to the declared time tools.

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:43
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 persists a user-supplied API key in a plaintext `.env` file. It does not explicitly enforce restrictive permissions, perform an atomic write, reject symbolic links, or resolve the file to a dedicated protected configuration directory. For a newly created file, effective permissions depend on the process umask. For an existing file, potentially permissive permissions remain unchanged. Because `Path(".env")` is relative to the current working directory rather than the project or user configuration directory, the secret may also be written into an unintended directory, including a source repository. If an attacker can prepare the current working directory, a symbolic-link attack may redirect the write to another file writable by the victim. The replacement operation would then overwrite any existing `XBY_APIKEY=` line or append the secret to the targeted file. ### Attack Path 1. A user invokes the Skill without a configured API key. 2. The Skill requ ...[truncated 1388 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Note
Location
requirements.txt:1
Finding

Dependencies Are Not Pinned or Integrity-Verified

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. Consequently, a fresh installation may select any later release, including future major versions, rather than the versions reviewed and tested with this project. The dependency file also contains no package hashes or lock-file-based integrity information. The listed package names appear legitimate, and the audit found no evidence that they are currently malicious. The risk arises from non-reproducible resolution: a compromised upstream release, compromised package-distribution account, unexpected transitive dependency, or incompatible future version could be installed automatically. ### Attack Path 1. A deployment or user creates a new environment and installs `requirements.txt`. 2. The package resolver selects the newest versions satisfying the lower bounds. 3. An upstream package or transitive dependency has been compromised, or a newly released version contains exploitable or incompatible behavior. 4. The affected package is installed and its code executes during installation, import, or normal Skill operation. 5. Malicious code would run with the same operating-system privileges and filesystem/network access as the process installing or invoking the Skill. This is a supply-chain hardening issue rather than evidence of an active compromise in the audited package. ### Impact Assessment If a resolved dependency were compromised, the impact could include arbitrary code execution under the installer or Skill process account, theft of the API key and other accessible environment secrets, modification of user-accessible files, and unauthorized network access. The attainable pr ...[truncated 195 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
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (29)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The documentation indicates configuration management beyond the stated time service, including reading and writing .env, setting XBY_APIKEY, and references to unrelated gaokao-oriented defaults and service metadata. Such hidden or unrelated behavior strongly suggests the skill may be repurposed from another project, increasing the risk of unintended secret handling, wrong API endpoints, or misleading execution paths.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The documentation indicates configuration management beyond the stated time service, including reading and writing .env, setting XBY_APIKEY, and references to unrelated gaokao-oriented defaults and service metadata. Such hidden or unrelated behavior strongly suggests the skill may be repurposed from another project, increasing the risk of unintended secret handling, wrong API endpoints, or misleading execution paths.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The example invocation and project structure reference gaokao/search-school functionality unrelated to the advertised time service. This inconsistency is a strong indicator of copy-paste residue or mispackaged code, which can conceal unexpected network calls, unrelated business logic, or secret-routing behavior under an innocuous label.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file exposes a generic upstream client that accepts arbitrary tool_name, mcp_id, and parameter payloads, which materially exceeds the declared scope of a simple time/timezone conversion service. In a skill ecosystem, this creates a capability mismatch that can be abused to invoke unintended remote tools or hidden functionality under the cover of a narrow manifest, undermining user and platform trust boundaries.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The file is materially inconsistent with the declared skill purpose: it configures a Gaokao-related external service, includes an MCP ID, base URL, default year, and API key handling unrelated to a time/timezone utility. In a skill that should only provide local time and timezone conversion, this kind of scope drift is dangerous because it can introduce unnecessary external connectivity and credential handling, increasing attack surface and suggesting possible repurposing or hidden functionality.

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

This routine explicitly reads the .env file to extract a specific API key outside the normal settings flow, reinforcing direct secret access logic in a skill that should not need such credentials. In the context of a time/timezone service, this makes the behavior more suspicious and increases the risk of unnecessary secret exposure and code paths that manipulate credentials.

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

The code checks for and reads a local .env file specifically to retrieve a secret, which is a form of direct credential access. While not automatically malicious, it is risky and unjustified in this skill context because a time service should not require local secret harvesting behavior.

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

This code stores and manages an external API credential even though a time/timezone skill should not normally require privileged third-party access. Unnecessary credential collection and persistence create clear credential exposure risk through local file leakage, accidental commits, log/debug access, or abuse by other components on the host.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
96% confidence
Finding

This function is dedicated to saving an API key into a local .env file, creating plaintext credential persistence on disk. In the context of a simple time/timezone skill, this is especially dangerous because it introduces unnecessary secret retention and raises the chance of credential leakage through filesystem access, backups, or accidental source-control inclusion.

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

The skill declares no explicit tool scope or permissions despite documented capabilities to read environment configuration, write API keys, and call external network services. This creates an over-privileged and opaque execution model where a seemingly simple time utility can access sensitive resources without clear disclosure or restriction.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

A time conversion skill should not normally require a third-party API key, yet the instructions mandate collecting a user secret and persisting it before any operation. This increases attack surface by introducing unnecessary credential collection and storage for a task that can be performed locally, making accidental leakage or misuse more likely.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The workflow explicitly states that code only calls an API for functionality that should be locally computable, creating unnecessary data egress and dependency on remote services. In context, this makes the skill more dangerous because a low-risk utility becomes a conduit for transmitting prompts, parameters, and possibly secrets to external infrastructure.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The code retrieves an external API key and performs authenticated outbound requests even though the declared skill purpose is narrow and could suggest low-risk local utility behavior to users or reviewers. This discrepancy increases the risk of undisclosed data transfer to a third party and expansion of effective privileges through a remote service not evident from the manifest.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The request sends arbitrary caller-supplied parameters plus an authentication credential to an external endpoint without any visible consent, disclosure, or field-level restriction in this component. In the context of a purported time service, this is risky because arbitrary payload forwarding can exfiltrate sensitive user-provided content to the upstream API and make review of actual data flows difficult.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The docstring identifies this as a Gaokao skill configuration, directly contradicting the stated time protocol service purpose. Such mismatches are a supply-chain and review risk because they can conceal transplanted or unintended functionality, making auditors and users misunderstand what the skill actually does.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The function silently persists the API key to a local .env file and environment variables without any user-facing warning, consent, or disclosure. This is dangerous because users may believe they are providing a transient secret when it is actually being written to disk, where it can be exposed via backups, version control mistakes, or local compromise.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

The skill documentation is primarily in Chinese, but the user-intent and tool descriptions are specified in English only, such as 'Get current time in a specific timezones' and 'Convert time between timezones'. This creates an implicit language constraint in the skill's natural-language interface without documenting user language choice or opt-in.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
96% confidence
Finding

The dependency is specified with a lower bound only, so builds may resolve to different versions over time, including vulnerable or untested releases. In a server-side skill, this weakens supply-chain integrity and makes security posture non-reproducible.

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

The manifest does not pin requests, and the package has multiple known advisories across versions, so the deployed environment could resolve to an affected release without visibility. While the file alone does not prove exploitation, the lack of version control makes the risk real and unverifiable.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
96% confidence
Finding

Using pydantic>=2.7.0 allows future versions to be installed implicitly, which can introduce breaking changes or vulnerable releases without review. This is a supply-chain risk because deployments are not deterministic.

Content

Scanner excerpt · requirements.txt (reported line 2)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: pydantic has 4 known advisory(ies) (CVE-2021-29510 (Use of "infinity" as an input to datetime and date fields causes infinite loop i); CVE-2024-3772 (Pydantic regular expression denial of service); CVE-2021-29510 (Pydantic is a data validation and settings management using Python type hinting.) +1 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
86% confidence
Finding

Because pydantic is not pinned, consumers may install a version impacted by known advisories, and there is no reliable way to verify safety from this manifest alone. For a service that may parse user-controlled inputs, vulnerable parser behavior could become relevant depending on usage.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
95% confidence
Finding

The unpinned pydantic-settings dependency permits uncontrolled upgrades, making it impossible to guarantee which code is deployed. That increases exposure to future vulnerable versions or incompatible behavior in configuration handling.

Content

Scanner excerpt · requirements.txt (reported line 3)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: pydantic-settings has 1 known advisory(ies) (CVE-2026-58203 (pydantic-settings: NestedSecretsSettingsSource follows symlinks outside secrets_)), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
85% confidence
Finding

The unpinned pydantic-settings dependency means an environment may install a version with known security issues, especially in settings and secrets-loading paths. This is particularly relevant for a server component that likely reads configuration from environment or files.

Content

No source excerpt is available for this finding.