Back to skill

Security audit

苹果开发者文档搜索服务

Security checks for vulnerabilities and agentic risk

Overview

The skill appears to provide Apple documentation lookup through a third-party XiaoBenYang MCP service, but its packaging and credential handling are under-disclosed and inconsistent.

Install only if you are comfortable sending Apple documentation queries and an XBY API key to XiaoBenYang's MCP service. Treat the saved .env key as a local secret, avoid committing or sharing it, and prefer a disposable or least-privilege API key until the publisher clarifies the Apple-vs-XiaoBenYang service boundary and improves secure storage.

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:42
Finding

API Key Persisted in a Plaintext File Without Explicit Permission Hardening

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 Skill requires the user to supply an API key and persists that credential directly in a `.env` file. The file is created or overwritten with `Path.write_text()` without explicitly setting restrictive permissions, verifying the target file type, rejecting symbolic links, or using an atomic secure-file creation procedure. The effective permissions therefore depend on the process environment and operating-system umask. In an environment with permissive defaults, another local account or process may be able to read the credential. Storing the key in the project working directory also increases the likelihood that it will be copied into backups, build contexts, archives, or version-control commits. The code additionally places the key in the process environment. This is common configuration behavior, but it can expose the credential to child processes or process-inspection mechanisms where permitted by the oper ...[truncated 1204 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Note
Location
requirements.txt:1
Finding

Unbounded and Unhashed Third-Party Dependency Specifications

Content
View full analysis
=2.31.0 pydantic>=2.7.0 pydantic-settings>=2.2.0 python-dotenv>=1.0.1 ``` ### Technical Analysis All dependencies use minimum-version constraints without upper bounds, exact pins, a lock file, or integrity hashes. Consequently, two installations performed at different times can resolve to different package versions. A future compromised, vulnerable, or incompatible release satisfying these constraints could be installed automatically without a corresponding review of this project. The absence of hashes also prevents the installer from verifying that downloaded artifacts match a previously reviewed set. The listed package names appear legitimate, and the audit found no evidence that the project intentionally references a typosquatted package or an unsafe package index. The risk arises from uncontrolled future dependency resolution rather than a currently confirmed malicious dependency. ### Attack Path 1. An operator installs the project dependencies using `requirements.txt`. 2. The package resolver selects the newest releases satisfying the `>=` constraints. 3. A selected release contains a security vulnerability, malicious modification, or incompatible behavior. 4. Package installation, import-time behavior, or runtime execution affects the Skill process. 5. The resulting impact depends on the permissions of the process and the behavior of the affected package. This exploitation path requires a vulnerable or compromised future dependency release, compromised package distribution infrastructure, or another supply-chain failure. ### Impact Assessment A malicious dependency executes with the same operating-system privileges as the process installing or running the Skill. Depending on those privileges, it could read accessible files a ...[truncated 282 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
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (27)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared purpose is Apple developer documentation search, but the referenced behavior and project structure point to an unrelated 'xiaobenyang gaokao' service, custom MCP endpoint, unrelated default settings, and credential handling for a third-party domain. This mismatch is a strong indicator of deceptive packaging: users may disclose secrets or invoke network actions under false assumptions about the destination and purpose.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The configuration code is clearly for a different service (XBY/高考) than the declared Apple developer documentation skill. This kind of manifest-to-code mismatch is dangerous because it can mislead reviewers and users about what backend is contacted, what credentials are collected, and what data flows occur, increasing the risk of covert exfiltration or unauthorized third-party 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
87% confidence
Finding

This logic forcibly reads the API key directly from .env, bypassing normal configuration abstraction and reinforcing hidden secret harvesting behavior inside a skill whose declared purpose does not match the code. In the context of the manifest mismatch, this increases the danger because the skill is explicitly collecting 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
87% confidence
Finding

Opening and reading .env directly is not inherently malicious, but in this skill it is part of a broader pattern of collecting credentials for an unrelated backend. That combination makes the behavior materially suspicious and raises the risk of unintended disclosure or misuse of locally stored secrets.

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

This function explicitly writes the provided API key into a plaintext .env file, creating durable local secret exposure. In the context of a skill whose implementation points to an unrelated remote service, this is more dangerous because it not only captures credentials but also persists them for future reuse or compromise.

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 permission boundaries even though it is documented as using environment access, file read/write, and network capabilities. In a skill that asks for credentials and persists them locally, missing scope declarations weakens reviewability and increases the chance of over-privileged execution or unintended access.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill instructs the agent to ask for an API key and save it, but does not warn the user that the credential will be persisted in local configuration. This undermines informed consent and can expose the secret to later sessions, other local processes, backups, or accidental disclosure.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The workflow requires soliciting a user-provided API key and then storing it for later use, which creates a direct secret-handling risk. In the context of the broader description mismatch and third-party endpoint references, requesting a credential is more dangerous because users may believe they are authenticating to Apple-related services when they are not.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
99% confidence
Finding

The examples and project structure visibly reference gaokao/school-search behavior rather than Apple developer documentation. Even if partially accidental, these inconsistencies can misroute model behavior and mislead users about what backend is actually being called, which is especially risky when the workflow includes credential collection.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The instruction to directly display raw tool output can leak sensitive data returned by the backend, including echoed credentials, internal identifiers, debugging fields, or user-specific content. This is particularly risky because the skill also handles API keys and communicates with a third-party service whose response schema may change unexpectedly.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The implementation sends requests to a generic third-party endpoint labeled as a '小笨羊MCP API' and does not enforce that the upstream is actually Apple's official developer documentation service described in the skill metadata. This creates a supply-chain and data trust problem: users and downstream agents may believe answers originate from Apple sources when the code can route queries and API keys to a different service entirely.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The code forwards arbitrary request parameters together with a live API key to an external service without any visible filtering, minimization, or consent boundary in this component. In an AI-tooling context, this can leak sensitive prompt contents, user data, or secrets to a non-obvious third party, especially because the skill presents itself as Apple documentation search rather than generic external relay.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The docstrings and comments describe a different product domain than the advertised skill, which is a strong integrity warning. While comments alone do not execute, this inconsistency materially increases the chance that maintainers and users misunderstand what secrets are being requested and what remote service is actually used.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The code persists an API key into a local .env file automatically, without any explicit consent, warning, or secure storage controls. This creates a realistic risk of credential leakage through local file exposure, backups, source control mistakes, shared workspaces, or later unintended disclosure by other tooling.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The skill is presented primarily in Chinese and gives mandatory workflow instructions in Chinese, while not stating that users may choose their preferred language. This can create an implicit language constraint or inconsistent locale experience without explicit opt-in.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
98% confidence
Finding

The dependency uses a lower-bound specifier (requests>=2.31.0) rather than pinning an exact version, which makes builds non-reproducible and can allow installation of unexpected future releases. In a network-facing documentation search service, dependency drift can introduce supply-chain risk or accidentally pull in a vulnerable or incompatible release.

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

requests has multiple known advisories, but the manifest does not pin a version, so it is impossible to verify whether the deployed package is affected. In a service that likely performs outbound HTTP queries to Apple developer resources, an affected requests version could expose network traffic, credentials, or TLS verification behavior depending on the resolved release.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
98% confidence
Finding

pydantic>=2.7.0 is unpinned, so installations may resolve to different versions over time. This weakens reproducibility and can expose the service to future vulnerable releases or breaking behavior in validation logic.

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 security advisories, but without an exact version there is no way to confirm whether the installed release is safe. Since this package influences parsing and validation, a vulnerable version could enable denial of service or unsafe input handling if the service processes attacker-controlled queries or metadata.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
98% confidence
Finding

pydantic-settings>=2.2.0 allows any newer version, creating uncertainty about what code is actually deployed. For a service that likely consumes environment-based configuration, dependency drift in settings handling can become a supply-chain or configuration-security issue.

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

pydantic-settings has at least one known advisory, and the lack of version pinning prevents verification that the deployed version is fixed. Given its role in loading application settings and possibly secrets, a vulnerable version could affect boundary enforcement around configuration sources.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
98% confidence
Finding

python-dotenv>=1.0.1 is not pinned, so future installs may pull in unreviewed versions. Because dotenv libraries interact with local configuration and secrets files, unexpected version changes can affect secret-loading behavior and increase operational risk.

Content

Scanner excerpt · requirements.txt (reported line 4)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: python-dotenv has 2 known advisory(ies) (CVE-2026-28684 (python-dotenv: Symlink following in set_key allows arbitrary file overwrite via ); CVE-2026-28684 (python-dotenv reads key-value pairs from a .env file and can set them as environ)), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
87% confidence
Finding

python-dotenv has known advisories, and because the manifest does not pin a version, the actual installed version cannot be validated. For a service that may load environment data from .env files, a vulnerable release could create risk around file handling or secret management if local files are writable or attacker-influenced.

Content

No source excerpt is available for this finding.