Back to skill

Security audit

WHOIS查询服务

Security checks for vulnerabilities and agentic risk

Overview

The skill appears to be a WHOIS lookup wrapper, but it proxies requests through an external XiaoBenYang API, stores a user API key in plaintext, and contains mismatched gaokao/education configuration artifacts.

Install only after reviewing whether you trust the XiaoBenYang API service with your domain queries and API key. Treat the key as a persistent secret written to the workspace .env file, and avoid using this skill in shared or source-controlled workspaces unless the publisher removes the gaokao remnants, documents the upstream data flow, and provides secure or opt-in credential storage.

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

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/config.py:36
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 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() if not save_api_key_to_env(api_key): ``` ### Technical Analysis The Skill requires users to provide an API key and passes it to `set_api_key()`. The key is then stored as plaintext in the workspace-level `.env` file and copied into the process environment. `Path.write_text()` does not explicitly enforce owner-only permissions. When creating the file, its effective permissions depend on the process umask and execution environment. When replacing an existing file, the function also does not verify that the file has safe ownership or permissions. Consequently, the credential may be readable by other local users, workspace-sharing services, backup systems, diagnostic collectors, or processes with access to the project directory. The code also performs no symlink check before re ...[truncated 1779 chars]
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • 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
Findings (30)

Tp2

High
Category
MCP Tool Poisoning
Confidence
85% confidence
Finding

Mixing characters from multiple Unicode scripts in a single identifier is a common technique to create visually ambiguous tool names.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The skill claims to be a WHOIS query server, but the documented behavior includes collecting and persisting API keys, reading local configuration, and references to unrelated gaokao/education settings. This inconsistency strongly suggests copy-paste drift or repurposed code, which can hide unintended capabilities and secret-handling behavior under an innocuous label.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill claims to be a WHOIS query server, but the documented behavior includes collecting and persisting API keys, reading local configuration, and references to unrelated gaokao/education settings. This inconsistency strongly suggests copy-paste drift or repurposed code, which can hide unintended capabilities and secret-handling behavior under an innocuous label.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The project structure and example invocation reference an unrelated gaokao skill and a school-search function, which is a strong sign of copied or mismatched documentation and possibly implementation. In security review, this raises concern that the packaged skill may expose unintended functions or route user data to unrelated services under a misleading domain-lookup facade.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The configuration module for a WHOIS lookup skill contains unrelated logic for a different 'XBY_GAOKAO' service, including handling and persistence of an API key. This mismatch strongly suggests hidden cross-skill credential collection or repurposed code that can cause users to supply and store credentials unrelated to the advertised functionality.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The class docstring labels the module as configuration for a different '小笨羊高考Skill', directly conflicting with the declared WHOIS service purpose. Such identity mismatch is a strong indicator of deceptive or transplanted functionality that may conceal unauthorized credential handling or off-purpose network 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
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 32)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
92% confidence
Finding

This code forcibly reads XBY_APIKEY from .env during initialization even though the advertised skill is a WHOIS service. In context, the explicit extraction of an unrelated credential from local storage looks like credential harvesting or hidden reuse of secrets across services.

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

This code prioritizes the value of XBY_APIKEY from the environment and assigns it into the skill's state, enabling use of an unrelated credential inside a WHOIS service. In this context, importing and normalizing another service's secret materially increases the risk of unauthorized credential use.

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

The function explicitly persists an API key to .env, creating durable local secret storage under application control. For a WHOIS query service, this behavior is unnecessary and can expose credentials through filesystem access, backups, or accidental inclusion in version control.

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

The skill declares no explicit tool scope or permission boundaries even though it appears to rely on environment access, local file reads/writes, and network access. In an agent setting, missing scope declarations increase the risk of overbroad execution and make it harder to enforce least privilege, especially because the skill also instructs persistence of secrets to local configuration.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill metadata and operating instructions are written as mandatory instructions in Chinese, including required user interactions such as asking for the API key. There is no indication that the skill can adapt to the user's preferred language or that Chinese is an optional or justified locale restriction.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The documentation says the skill is gated by an external API key and behaves like an API client, which conflicts with the claimed direct WHOIS protocol service. This is risky because users may believe they are performing standard protocol-based lookups while actually sending queries and credentials to a third-party service with different privacy, integrity, and availability properties.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill instructs the agent to collect a user API key via chat and persist it using local configuration. Secret collection through natural-language flow is dangerous because it can lead to accidental disclosure in conversation logs, insecure storage in .env files, reuse across contexts, and unauthorized access if the workspace or transcript is exposed.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The workflow says the code only calls an API, while the tool descriptions claim direct WHOIS protocol and IANA interactions. Contradictory operational claims undermine trust boundaries and can cause users or orchestrators to approve actions based on a false understanding of where data goes and what side effects occur.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The instruction to directly display raw API response data can expose sensitive or unnecessary information, including registrant details, email addresses, phone numbers, or other registration metadata returned by WHOIS or an upstream service. Presenting raw responses without filtering also increases the chance of disclosing provider-specific fields, tokens, or operational metadata not needed by the user.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The code writes an API key into a local .env file, creating persistent credential storage that is unnecessary for a WHOIS query service and may expose secrets to other local users, backups, or accidental source control inclusion. Because this behavior is outside the expected context of the skill, it increases the risk of covert credential retention.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The module silently stores a supplied API key to .env without a user-facing warning, consent flow, or disclosure of persistence. This can lead users to unknowingly leave long-lived credentials on disk, increasing exposure through local compromise, backups, or repository leakage.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
97% confidence
Finding

The dependency specification for requests is unpinned and allows installation of any future version above 2.31.0, which harms build reproducibility and can unintentionally introduce vulnerable or breaking releases. In a network-facing WHOIS service, dependency drift increases supply-chain risk because HTTP client behavior may change or a newly introduced vulnerable version could be pulled during deployment.

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

requests has multiple known advisories, and because the manifest does not pin an exact version, there is no assurance that deployed environments will avoid affected releases. For a WHOIS service that likely performs outbound network requests, use of a vulnerable HTTP client could expose credentials, request integrity, or transport behavior depending on the resolved version.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
96% confidence
Finding

The pydantic dependency is specified with a lower bound only, so installations are not reproducible and may resolve to versions with newly disclosed flaws or incompatible behavior. Because this package is commonly used for input parsing and validation, unexpected version changes can directly affect the safety and reliability of request handling.

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

pydantic has known advisories and the current manifest does not make the installed version verifiable, leaving open the possibility that an affected release is deployed. Because schema validation is often directly exposed to user-controlled input, a vulnerable parser version could enable denial of service or unsafe validation behavior.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
95% confidence
Finding

The pydantic-settings dependency is unpinned, so deployments may silently consume different releases over time. This creates a supply-chain and configuration-handling risk, especially because settings libraries often process environment variables, files, and secrets-related inputs.

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

pydantic-settings has at least one known advisory, and the lack of exact version pinning means the deployment may resolve to an affected release without visibility. In a service likely using environment-based configuration, flaws in settings resolution can impact secret handling or filesystem boundaries.

Content

No source excerpt is available for this finding.