Back to skill

Security audit

日期时间格式化服务

Security checks for vulnerabilities and agentic risk

Overview

The skill advertises date/time formatting but requires a third-party API key, sends requests to an external API, and stores the key in plaintext, which is more authority than the task needs.

Review this skill carefully before installing. It is not just a local date/time formatter: it asks for a Xiaobenyang API key, saves it to a plaintext .env file, and sends authenticated requests to an external service. Use only a low-privilege, revocable key if you proceed, and avoid installing if you expected offline date/time formatting.

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)

other

Warning
Location
scripts/call_api.py:50
Finding

Unnecessary External API Access and Credential Transmission for Local Date Formatting

Content
View full analysis
HttpResult: """调用小笨羊MCP工具""" url = f"{settings.base_url}/api" mcp_id = mcp_id or settings.mcp_id api_key = get_api_key() if not api_key: raise UpstreamError("API密钥未设置,请先调用 set_api_key()") headers = { "XBY-APIKEY": api_key, "func": tool_name, "mcpid": mcp_id, "Content-Type": "application/json", } # data = {k: str(v) if v is not None else "" for k, v in params.items()} t0 = time.time() try: resp = self._session.post( url=url, headers=headers, data=json.dumps(params), timeout=settings.timeout_seconds, ) ``` The corresponding tool invocation is: ```python arguments = { "format": format } return call_api("1777419075044355", "get_datetime", arguments) ``` ### Technical Analysis The Skill's stated capability is formatting the current date and time. This operation can be performed entirely locally using standard date/time libraries, but the implementation requires a third-party API key and sends that credential in the `XBY-APIKEY` HTTP header to `https://mcp.xiaobenyang.com/api`. Although the external request is documented and HTTPS is used, requiring remote access for a local formatting operation violates data-minimization and least-capability principles. It unnecessarily expands the trust boundary to include the remote service, DNS resolution, certificate authorities, network infrastructure, and the remote operator. The transmitted data includes the API credential, selected MCP identifier, tool name, requested format, and request timing m ...[truncated 1189 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/config.py:43
Finding

API Key Persisted in a Plaintext Environment File Without Enforced Permissions

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 API credential is written directly to `.env` as plaintext. The code does not explicitly create the file with owner-only permissions or correct the permissions of an existing file. Consequently, protection depends on the process umask and any preexisting file mode. The code also uses a non-atomic read-modify-write sequence. While the primary security issue is plaintext secret persistence, non-atomic replacement can additionally produce inconsistent file contents during concurrent access. Environment files are frequently included in backups, copied during troubleshooting, exposed to local processes, or accidentally committed to source control. No `.gitignore` was present in the audited directory structure to establish repository-level protection for `.env`. ### Attack Path 1. The user supplies an API key as required by the Skill instructions. 2. `set_api_key()` calls `save_api_key_to_env()`. 3. The function writes `XBY_APIKEY=` to `.env` in the cur ...[truncated 810 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Note
Location
requirements.txt:1
Finding

Dependencies Use Open-Ended Version Constraints Without Integrity Pinning

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 a lower-bound-only constraint. A future installation may therefore resolve to versions that did not exist and were not reviewed when the Skill was audited. No lockfile or package hashes are present in the supplied project structure. This configuration makes installations non-reproducible and increases exposure to future compromised, malicious, or unexpectedly incompatible releases. The package names shown are established packages rather than apparent typosquatting attempts, and the audit did not establish that any currently available version is malicious. The risk arises from accepting unreviewed future versions without integrity verification. ### Attack Path 1. The project is installed at a later date using `requirements.txt`. 2. The package resolver selects the latest versions satisfying each lower bound. 3. If a selected release has been compromised or contains malicious installation or import-time behavior, it is downloaded into the Skill environment. 4. The package's code executes with the permissions of the process performing installation or running the Skill. 5. The resulting access is bounded by that process's operating-system privileges. This exploitation path requires a compromised or malicious dependency release, package-index account, distribution artifact, or equivalent supply-chain event; none was confirmed during this source audit. ### Impact Assessment The current files do not demonstrate immediate compromise. Under the prerequisite supply-chain event, a malicious dependency could execute code with the installer or Skill process's privileges, potentially accessing files, environment variables, API credentials, and netw ...[truncated 192 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 (33)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The documentation indicates credential management, persistence to .env, and reading local configuration despite claiming to be a simple Claude desktop datetime MCP service. That discrepancy materially changes the trust model by introducing secret handling and local state mutation unrelated to the stated purpose.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The documentation indicates credential management, persistence to .env, and reading local configuration despite claiming to be a simple Claude desktop datetime MCP service. That discrepancy materially changes the trust model by introducing secret handling and local state mutation unrelated to the stated purpose.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

Requiring users to provide an external API key for a datetime-formatting feature is unjustified and indicates hidden or unrelated external service usage. Collecting credentials under a misleading pretext increases the risk of unnecessary secret exposure and could facilitate credential harvesting or misuse.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

Collecting and persisting an API key is not justified by the declared task of formatting dates and times, which can be done entirely offline. Unnecessary credential handling expands the attack surface and exposes users to secret theft, retention, or accidental disclosure without functional need.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The workflow references unrelated school-search style tooling and generic API-routing behavior rather than a focused datetime formatter. This suggests the skill may be repurposed boilerplate or an obfuscated wrapper for broader remote actions, which makes misuse and user deception more likely.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
95% confidence
Finding

Adding outbound HTTP access and remote tool-calling capability is not justified by a service whose declared role is only generating formatted date/time strings. In a desktop agent environment, unnecessary network access increases attack surface, enables covert data transfer to an upstream service, and undermines the principle of least privilege.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

This file implements a generic remote API invocation client that can call arbitrary upstream tools via caller-controlled mcp_id, tool_name, and params, which materially exceeds the stated purpose of a date/time formatting service. In an agent skill context, this mismatch is dangerous because it introduces hidden network egress and remote capability expansion that could be abused for unintended actions, data exfiltration, or serving as a proxy to other systems.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
95% confidence
Finding

Configuring .env as a credential source is a credential-access behavior that is unexpected for a date/time formatter. In this context, the skill is positioned to consume secrets from local storage despite lacking a clear functional need, which materially increases risk and suspicion.

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

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The configuration introduces remote service settings and API credential handling even though the declared skill is only for date/time formatting. This capability mismatch is dangerous because it expands the attack surface, enables unexpected outbound service dependency, and may facilitate hidden data exfiltration or unauthorized remote interactions under a misleading skill identity.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The code explicitly reads API keys from .env and the process environment, then persists and reuses them, which is unnecessary for a local date/time formatting utility. Storing and managing credentials in a mismatched skill creates credential exposure risk, makes secret theft easier for any local compromise, and suggests functionality beyond the stated purpose.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
98% confidence
Finding

The code forcibly reads the .env file and extracts a specific API key, which is direct credential access behavior. In a skill whose stated purpose is date/time formatting, this is disproportionate and creates unnecessary secret-handling risk, including unauthorized retention and later misuse.

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

Opening and reading the .env file directly is an explicit secret access operation. Given the mismatch between claimed purpose and implemented capabilities, this behavior is dangerous because it can harvest locally stored credentials without a convincing need tied to the advertised functionality.

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

Reading the XBY_APIKEY process environment variable is also credential-access behavior. In the current skill context, this enables the code to ingest sensitive runtime secrets that are unrelated to simple formatting tasks, increasing the chance of secret misuse or exfiltration if other code paths are added later.

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

This function exists specifically to save API keys into .env, combining credential handling with plaintext persistence. That is dangerous because it normalizes insecure secret storage and gives a low-risk utility unnecessary authority over local credentials.

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

The skill declares itself as a simple datetime formatter, yet the documentation indicates capabilities consistent with environment access, file reads/writes, and network usage without any explicit tool scope restrictions. In an agent setting, missing scope declarations reduce transparency and can allow broader-than-expected access, which is especially concerning because the stated functionality does not require these privileges.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill instructs the agent to ask for and store a user-provided API key without warning the user that the credential will be persisted. This creates a secret-handling risk because users may disclose sensitive credentials without informed consent or understanding of retention and exposure implications.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The instruction to solicit an API key conversationally and persist it creates a natural-language secret collection workflow, increasing the chance that highly sensitive credentials are captured, logged, or mishandled. In a skill whose stated purpose does not require secrets, this data collection is especially unjustified and risky.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The document claims to generate datetime strings but also states that the code merely calls an API and returns raw upstream data. This inconsistency is dangerous because it hides data provenance and may cause users to believe output is locally generated when it is actually obtained from an external service.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
83% confidence
Finding

The documented output formats include locale-specific Japanese date/time formats such as date_jp, datetime_jp, and time_jp, and ISO examples fixed to +0900, but the skill does not state that these are optional or user-selected. This can violate language/locale policy when a skill imposes a locale-specific format without opt-in or documented regional justification.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

Directly displaying raw API responses can leak sensitive or irrelevant upstream fields, including tokens, identifiers, internal error details, or metadata not intended for end users. Because the skill already involves undocumented remote calls and credential use, unfiltered output increases the chance of accidental exposure.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This file includes a Chinese-only class docstring and later returns Chinese-only error and status messages, indicating the skill is designed to communicate in a fixed language. The policy allows locale constraints only when users are given a choice or the regional limitation is explicitly documented and justified, which is not present here.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
99% confidence
Finding

The class docstring references an unrelated gaokao skill, which contradicts the manifest's date/time formatting identity and is a strong trust-integrity issue. This inconsistency raises suspicion that code was repurposed from a different project without proper review, increasing the likelihood of hidden, irrelevant, or unsafe functionality.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

This function writes arbitrary API key material into a local .env file, giving the skill persistent local file modification ability that is not justified by the advertised functionality. Such writes can leave secrets in plaintext on disk, affect other tooling that trusts .env, and create opportunities for tampering or unintended credential reuse.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

Persisting an API key to .env without explicit user warning or consent is unsafe because the secret is stored in plaintext and may be unintentionally exposed through backups, repository commits, local reads, or other tools. The absence of disclosure is especially problematic in a skill that does not obviously need credentials at all.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
96% confidence
Finding

The dependency specifier requests>=2.31.0 is unpinned, so builds may resolve to different versions over time. This weakens supply-chain integrity and makes it harder to ensure the deployed version is not affected by known vulnerabilities or breaking changes.

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