Back to skill

Security audit

日期时间格式化服务

Security checks for vulnerabilities and agentic risk

Overview

This skill is presented as a simple date/time formatter but requires a remote API key, stores it locally, and sends requests to an external service for work that should not need that authority.

Install only if you intentionally trust xiaobenyang.com, understand that a plaintext XBY_APIKEY may be stored in .env, and are comfortable sending date/time format requests to that remote service. For a simple formatter, prefer a local skill that does not ask for an API key or write secrets to disk.

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

Lp3

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding
The skill declares itself as a simple date/time formatter, yet its documented capabilities include reading environment variables, writing files, and making network calls without corresponding declared permissions. This creates a transparency and consent problem: users may invoke a seemingly harmless local utility while it can access credentials and communicate externally.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
The documented behavior does not match the stated purpose: instead of locally formatting timestamps, the skill sends requests to an external service, passes an API key, and persists credentials. This mismatch is dangerous because users are likely to trust the skill with low scrutiny based on its benign description, enabling covert data egress and unnecessary credential handling.

Intent-Code Divergence

High
Confidence
98% confidence
Finding
Requiring an API key and remote service usage for date/time formatting is unjustified and indicates the skill is performing materially different actions than advertised. In this context, the credential workflow is especially risky because it conditions users to surrender secrets to a trivial utility that should not need them at all.

Description-Behavior Mismatch

High
Confidence
98% confidence
Finding
The manifest presents a local formatting service, while the body defines a credential-collection and API-backed workflow. This is a deceptive trust-boundary shift: users think they are using a local utility, but the skill actually introduces remote communications and secret handling.

Context-Inappropriate Capability

High
Confidence
99% confidence
Finding
Collecting and storing an API key for a date/time formatting function is unnecessary and expands the attack surface with no legitimate need. If mishandled, the key can be exposed through logs, files, or unintended reuse, and users may be socially engineered into disclosing credentials under false pretenses.

Context-Inappropriate Capability

Medium
Confidence
87% confidence
Finding
The documented inclusion of an external API client in a skill whose advertised purpose is local date/time formatting indicates unnecessary network dependence and hidden complexity. While this alone is less severe than explicit credential collection, it still suggests avoidable data exposure and misrepresentation of functionality.

Intent-Code Divergence

Medium
Confidence
85% confidence
Finding
References to unrelated school-search behavior indicate the skill may be copied, repurposed, or improperly assembled, which undermines trust in the documented workflow. In security terms, this raises the risk that hidden or unintended functionality exists beyond the declared date/time use case.

Intent-Code Divergence

Medium
Confidence
92% confidence
Finding
Gaokao-related project naming and structure contradict the skill's date/time identity and suggest that the package may actually belong to a different service. This inconsistency increases the likelihood of hidden remote behaviors, incorrect routing, or accidental exposure of unrelated capabilities.

Description-Behavior Mismatch

High
Confidence
97% confidence
Finding
The skill metadata describes a date/time formatting service, but this file implements a generic authenticated HTTP client that can invoke arbitrary upstream MCP tools via attacker-controlled mcp_id, tool_name, and params. This capability materially exceeds the declared purpose and creates a hidden network-proxy / remote-action surface, which is dangerous because users may grant trust to a benign-seeming local formatting skill while it can actually send data to an external service and trigger unrelated operations.

Context-Inappropriate Capability

High
Confidence
98% confidence
Finding
For a date/time formatting skill, outbound POST requests to a generic '/api' endpoint with dynamic headers and function selection are unjustified and effectively give the skill proxy-like capability to relay requests to an external MCP service. In context, this is more dangerous because the declared functionality does not need network access at all, so the hidden remote-call path could be used for data exfiltration, invoking unexpected upstream tools, or expanding the skill's permissions beyond user expectations.

Description-Behavior Mismatch

High
Confidence
98% confidence
Finding
This code persists and manages an external API credential even though the advertised skill purpose is only date/time formatting, which should not require remote authentication at all. The mismatch between declared functionality and credential-handling behavior is a strong indicator of overprivileged or deceptive implementation and creates unnecessary secret exposure risk via local storage and process environment.

Context-Inappropriate Capability

High
Confidence
99% confidence
Finding
The skill implements reading, overriding, and persisting an API key for functionality that should be purely local. In this context, credential handling is unjustified and expands the attack surface by exposing secrets to local files, inherited environments, and any later code path that might use or exfiltrate them.

Intent-Code Divergence

Medium
Confidence
88% confidence
Finding
The Settings docstring references a completely different skill, indicating code reuse or copy-paste from an unrelated project. In security-sensitive configuration code, this inconsistency is dangerous because it undermines trust, suggests hidden functionality, and makes it easier for unauthorized credential-handling behavior to slip in unnoticed.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The function writes the API key to a .env file without any disclosure, consent flow, or warning to the user that the credential will be stored on disk. Silent persistence increases the chance of accidental exposure through backups, source control mistakes, local compromise, or later unintended reuse.

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
95% confidence
Finding
The code explicitly forces reading XBY_APIKEY from .env outside the normal settings mechanism, adding custom credential access logic for a skill that should not need secrets. In this context, manual secret retrieval is suspicious and increases the risk of unauthorized use of stored credentials.

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
95% confidence
Finding
This line reads the .env file contents directly, enabling bespoke parsing of credentials rather than relying on constrained configuration loading. Direct secret-file access is especially concerning given the mismatch between the skill's claimed local function and its credential behavior.

Credential Access

High
Category
Privilege Escalation
Content
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
Confidence
96% confidence
Finding
This line accesses XBY_APIKEY from the process environment, providing another path for obtaining a credential unrelated to date/time formatting. Multiple secret-ingestion paths make auditing harder and increase the chance that a credential will be consumed unexpectedly by hidden or later-added network functionality.

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
97% confidence
Finding
This function is dedicated to saving an API key into .env, creating durable local secret storage for a skill that should not require any credential at all. Persistent plaintext storage significantly raises exposure risk if the file is copied, committed, or read by other local processes or users.

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
97% confidence
Finding
This function exposes a public entry point to set and persist an API key, operationalizing secret collection and storage for functionality that does not justify it. In context, this makes the skill materially more dangerous because it normalizes credential onboarding that can support hidden remote service interactions.

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
94% confidence
Finding
The dependency is specified with a lower bound only, which allows future installs to resolve to different versions over time. This weakens build reproducibility and can unexpectedly introduce vulnerable or incompatible releases into the 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
94% confidence
Finding
Using an unpinned version range for pydantic means installations are not deterministic and may pull in newer releases with security or behavioral changes. While not an exploit by itself, it increases supply-chain risk and makes auditing harder.

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
94% confidence
Finding
An unpinned pydantic-settings dependency permits uncontrolled version drift across environments. This can introduce vulnerable transitive dependencies or breaking changes without any code modification in the skill itself.

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
94% confidence
Finding
The python-dotenv requirement is not fully pinned, so deployments may resolve to different versions depending on installation time and index state. That increases supply-chain uncertainty and can expose the project to newly introduced vulnerable releases.

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
89% confidence
Finding
The file permits installation of requests 2.31.0 or later, and the scanner identifies 2.31.0 as affected by published advisories. In this date/time formatting service, the risk is somewhat reduced because the dependency list alone does not prove the vulnerable code paths are exercised, but allowing a known vulnerable baseline is still a real supply-chain weakness.

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
78% confidence
Finding
The requirement allows python-dotenv 1.0.1, which the scanner flags as vulnerable to a symlink-related arbitrary file overwrite issue. The skill description suggests a simple date/time service, so this package may not even be used in a dangerous way, but including a known vulnerable version in allowed resolutions still creates avoidable risk.

Static analysis

No suspicious patterns detected.