Back to skill

Security audit

农历日历服务

Security checks for vulnerabilities and agentic risk

Overview

The skill is not clearly malicious, but it needs review because it stores an API key in plaintext and sends user calendar and birth information to a third-party API despite presenting itself as a local lunar calendar tool.

Install only if you are comfortable giving this skill a XiaoBenYang API key, having that key saved in a local .env file, and sending requests including birth date/time to mcp.xiaobenyang.com. Prefer using a throwaway or low-privilege API key, avoid entering sensitive personal birth data, and remove or rotate the key if the workspace may be shared or committed to source control.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/config.py:43
Finding

API Key Persisted in a Plaintext Environment 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 stores the user-provided API key directly in a plaintext `.env` file. The file is created or overwritten with `Path.write_text()` without explicitly enforcing owner-only permissions. Its resulting permissions therefore depend on the process environment and operating-system umask. The implementation also does not verify the permissions of an existing `.env` file, use an operating-system credential store, or offer session-only credential handling. The Skill instructions make persistence part of the normal API-key setup workflow. Although the API key is not deliberately logged by this code, plaintext persistence expands the number of locations from which it can be recovered. The file may be exposed to other local processes or users where filesystem permissions permit access, included in backups or deployment artifacts, or committed to source control accidentally. ### Attack Path 1. A user supplies an API key as required by the Skill workflow. 2. The ...[truncated 1086 chars]
Remediation
View remediation

other

Warning
Location
scripts/call_api.py:49
Finding

Birth Information Is Transmitted to a Third-Party API Without Clear Privacy Disclosure

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 BaZi tool places birth date and birth time into those parameters: ```python def bazi_calculate( birth_date: str, birth_time: str ) -> Dict[str, Any]: """ Calculate BaZi (Eight Characters) for fortune telling / 计算生辰八字用于算命 Args: birth_date: Birth date in YYYY-MM-DD format / 出生日期,格式YYYY-MM-DD birth_time: Birth time in HH:MM format / 出生时间,格式HH:MM Returns: Detailed BaZi calculation result / 详细的八字计算结果 Args: birth_date: null birth_time: null Returns: null """ arguments = { "birth_date": birth_date, "birth_time": birth_time } return call_api("1777419068792835", "bazi_calculate", arguments) ``` The Wu Xing tool performs the same disclosure: ```python def wuxing_analyze( birth_date: str, birth_time: str ) -> Dict[str, Any]: """ Analyze ...[truncated 3042 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 (35)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The documented behavior includes reading and writing .env configuration, storing API keys, and modifying environment variables, but these sensitive configuration-management capabilities are not reflected in the declared purpose of a lunar calendar utility. Hidden secret-handling and config mutation expand the trust boundary and can expose user credentials or alter runtime behavior in ways a user would not reasonably expect from this type of skill.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The documented behavior includes reading and writing .env configuration, storing API keys, and modifying environment variables, but these sensitive configuration-management capabilities are not reflected in the declared purpose of a lunar calendar utility. Hidden secret-handling and config mutation expand the trust boundary and can expose user credentials or alter runtime behavior in ways a user would not reasonably expect from this type of skill.

Content

No source excerpt is available for this finding.

Ssd 3

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill explicitly instructs the model to request, save, and continue using a user-provided API key in plain language. In the context of an agent skill, this is more dangerous because the agent becomes part of the secret-handling path, increasing exposure risk through chat logs, prompt history, local config files, and downstream tool access.

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

The code forcibly reads .env manually to extract a specific API key, bypassing normal configuration abstraction and explicitly targeting a credential. In the context of a skill that claims to be a calendar utility, this focused secret access is more suspicious because it collects and normalizes reusable credentials for an unrelated external service.

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

Checking for and reading a local .env file to harvest a specific API key is credential-handling behavior that exceeds the expected needs of a local calendar feature. This can expose sensitive values through broader file access patterns and makes the skill more dangerous because the manifest gives little reason for users to expect secret collection.

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

Credential Access

High
Category
Privilege Escalation
Confidence
95% confidence
Finding

This function is explicitly designed to persist an API key into a .env file, creating durable local credential storage. In the context of a purported lunar calendar service, that capability is unjustified and increases the risk of credential leakage through repository inclusion, backups, local compromise, or accidental file sharing.

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

The skill declares no explicit tool scope or permission boundaries even though its documented behavior implies environment access, local file read/write, and outbound network use. Missing scope declarations increase the chance that a host or reviewer underestimates the skill's capabilities, enabling over-privileged execution and weakening user consent and policy enforcement.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
79% confidence
Finding

The skill name and description present the capability exclusively as a Chinese traditional calendar service, and the operational guidance is written to serve that locale without any opt-in or language choice. The policy requires flagging natural-language locale constraints when a skill forces a specific language or locale without user choice or an explicitly justified regional limitation.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The documentation mixes a lunar-calendar identity with unrelated gaokao/school-search project references and a third-party API-key workflow. Such inconsistencies are a supply-chain and trust risk because they suggest copied or repurposed code, making it harder to verify what the skill actually does and increasing the chance of unintended or undisclosed behaviors.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill instructs the model to collect a user's API key and persist it locally without clearly warning that the secret will be stored in configuration. Collecting secrets through conversational flow and silently persisting them creates a meaningful risk of accidental disclosure, unauthorized reuse, or insecure local storage.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill claims to be a simple router for calendar-related tools, yet its examples and metadata reference unrelated school-search behavior and mismatched components. This contradiction undermines transparency and makes review difficult, which can conceal unsafe data flows or capabilities behind misleading examples.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

Directly presenting raw API response data to the user is unsafe because raw payloads may contain unexpected sensitive fields, internal identifiers, error details, or maliciously formatted content returned by the upstream service. Given this skill already depends on an external API, passing raw output through without validation or filtering increases the risk of data leakage and unsafe content rendering.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill is presented as a local lunar calendar service, but this code forwards requests and user-supplied parameters to an external XiaoBenYang MCP API. That creates a supply-chain and data-exfiltration risk because users and operators may reasonably expect local-only processing, while sensitive query content and metadata are actually sent to a third party.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The code loads an API key and performs authenticated outbound network calls to a third-party service, which is not obviously required for a lunar calendar utility advertised as Python/lunar-python based. This increases risk by exposing user inputs to an external provider and introducing dependency on a remote authenticated service that could misuse data or behave unexpectedly.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The configuration introduces a remote service endpoint, MCP identifier, and API key handling even though the skill is described as a local lunar calendar service. This mismatch expands the trust boundary and can enable unexpected outbound communication or credential use that users would not reasonably expect from the manifest.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill persists an API key into a local .env file, which is functionality unrelated to a normal calendar computation service and broadens its capabilities to secret management. Persisting credentials creates a long-lived sensitive artifact that may be exposed through source control, backups, permissive file access, or later tooling behavior.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

Persistent API key storage is unnecessary for the stated calendar-service purpose and increases the attack surface by retaining reusable credentials on disk. If the host environment is shared, backed up, or monitored, the stored key can be recovered and abused to access external services.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The code saves a sensitive API key to disk without any warning, confirmation, or explanation to the user. Silent persistence of credentials is risky because users may assume the value is transient while it actually remains available to other local processes, operators, or future accidental disclosure paths.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill description says it is a Python/lunar-python calendar server, but every advertised capability is actually proxied to an external API. This is a security-relevant integrity and transparency issue because users and downstream systems may trust the skill as local-only while sensitive inputs and business logic are handled off-box by an undisclosed service.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The bazi_calculate function sends birth date and birth time to an external API, which are personal data elements that can be sensitive in context. Without visible disclosure, consent, minimization, or assurance about remote handling, this creates a privacy and data-exfiltration risk inconsistent with a seemingly local calendar tool.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The code exposes a fortune_daily capability that is not described in the stated feature set, creating a mismatch between declared and actual behavior. Hidden or undeclared capabilities reduce reviewability and can bypass user or platform expectations about what the skill is allowed to do.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The wuxing_analyze function also transmits birth date and birth time to an external API, again exposing personal data without visible warning in this file. In this skill context, users would reasonably expect astrology/calendar calculations to run locally based on the description, making the undisclosed transmission more dangerous.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
94% confidence
Finding

The dependency is specified with a lower-bound constraint only, which allows future installs to resolve to different versions over time. This undermines reproducibility and can unintentionally introduce vulnerable or breaking releases, especially for a network-facing library like requests.

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