Back to skill

Security audit

OSRS玩家数据服务

Security checks for vulnerabilities and agentic risk

Overview

The skill appears intended to provide OSRS stats through a third-party API, but it persistently stores API keys in plaintext and contains copied Gaokao references that make its scope and provenance unclear.

Review this before installing if you are comfortable giving a xiaobenyang API key to a local skill that sends requests to its API and saves the key in a plaintext .env file. Prefer using a disposable or limited-scope key, avoid committing the skill directory, and rotate/delete the key if you uninstall it.

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

API Key Persisted in a Plaintext Environment 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 `save_api_key_to_env` function stores the user-supplied API key directly in a plaintext `.env` file. The write operation does not explicitly create or enforce restrictive file permissions. Consequently, the effective permissions depend on the process umask and, when the file already exists, its existing permission mode. The project also does not contain a `.gitignore` file in the audited directory structure. This creates an additional risk that the generated `.env` file could be included in a source-control commit, project archive, backup, diagnostic bundle, or other copied artifact. The same key is placed into the process environment through `os.environ["XBY_APIKEY"]`. Although this is necessary for the current configuration design, environment variables may be visible to privileged local processes and can be inherited by child processes. ### Attack Path 1. The Skill instructs a user to provide an `XBY_APIKEY`. 2. `set_api_key` passes the credentia ...[truncated 1143 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Note
Location
requirements.txt:1
Finding

Third-Party Dependencies Are Not Reproducibly Pinned or Integrity-Verified

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 is specified using only a minimum version. An installation performed at a later date may therefore resolve to a substantially newer release than the version originally reviewed or tested. The file also contains no package hashes or lock metadata to verify artifact integrity. This does not establish that any listed package is malicious. The package names correspond to commonly used dependencies, and the audit found no evidence of a typosquatted or attacker-controlled package. The security concern is that builds are not reproducible and automatically trust future releases selected by the package index and resolver. A compromised upstream account, malicious future release, incompatible major version, or compromised package-distribution path could introduce unreviewed code into the Skill environment. ### Attack Path 1. An operator installs the project dependencies from `requirements.txt`. 2. The resolver selects the newest versions satisfying the lower bounds. 3. A selected release may not be the version previously reviewed or tested. 4. If an upstream release or distribution artifact has been compromised, its code is installed into the Skill environment. 5. Dependency code executes when imported or otherwise used by the project, with the permissions of the process running the Skill. This exploitation path is conditional on an upstream or distribution compromise; no such compromise was confirmed during this source audit. ### Impact Assessment Dependency code executes with the same operating-system privileges and network access as the Skill process. Under a successful supply-chain compromise, impact could include r ...[truncated 279 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 (24)

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

The skill claims to be an OSRS data service, yet the implementation details described include local .env manipulation, API-key persistence, and configuration of unrelated base URLs/MCP IDs. This kind of description-behavior mismatch can conceal credential collection and redirection to non-obvious third-party services, which materially raises the security risk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill claims to be an OSRS data service, yet the implementation details described include local .env manipulation, API-key persistence, and configuration of unrelated base URLs/MCP IDs. This kind of description-behavior mismatch can conceal credential collection and redirection to non-obvious third-party services, which materially raises the security risk.

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 refers to an unrelated 'Gaokao' skill while the manifest claims this is an OSRS player data service. Such context mismatch is a strong indicator of copied or repurposed code, making the hidden credential logic more suspicious and increasing the risk that the skill performs functions outside its stated purpose.

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

This code explicitly opens and parses the .env file to extract a specific API key outside the normal settings mechanism. Direct credential parsing increases secret exposure paths, bypasses safer configuration conventions, and is suspicious in a skill whose stated function should not require local secret harvesting logic.

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

The existence check on .env is part of a custom credential access flow that enables the application to inspect local secret storage directly. In context, this contributes to unnecessary secret-handling behavior inconsistent with the advertised OSRS stats functionality and supports potential exposure of local credentials.

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

This function is explicitly designed to save an API key into a .env file, which creates plaintext at-rest secret storage and a durable artifact that can be leaked or reused. Because the skill is presented as a player statistics service, this capability is not only unnecessary on its face but also materially increases the chance of credential 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
84% confidence
Finding

The skill appears to rely on environment access, file reads/writes, and network calls, but it does not declare any explicit tool scope or permissions boundary. This makes the effective capability set opaque to users and the hosting agent, increasing the chance of unintended credential access, local file modification, or outbound data transmission without clear review.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The skill description and operating instructions are entirely in Chinese, including mandatory workflow directions, with no indication that users may choose another language or that the locale restriction is intentional for a China-specific audience. Under the policy, forcing a specific language without user opt-in is a natural-language policy issue.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill instructs the agent to ask the user for an API key and persist it via configuration without clearly warning about storage, retention, destination, or access controls. That is dangerous because users may provide sensitive credentials without informed consent, and persistent storage increases the blast radius if local files or logs are later exposed.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

该技能整体宣称提供 OSRS 玩家数据,但此处示例调用却是 search_schools(...),明显属于另一类“高考/学校搜索”技能。类似地,项目结构中目录名 xiaobenyang_gaokao_skill/ 也与 OSRS 服务不符,说明文档从其他项目复制而来并与实际意图冲突。

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This module includes logic to persist, retrieve, and globally manage an API credential even though the declared skill purpose is only OSRS player statistics/rankings. Secret persistence to local files expands the attack surface by leaving credentials on disk and introducing unnecessary secret-handling behavior not justified by the manifest, which is especially suspicious given the mismatched service metadata in the file.

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 the API key directly into a local .env file, creating plaintext secret storage on disk. This is dangerous because .env files are commonly exposed through accidental commits, backups, local compromise, or permissive file access, and this capability is not aligned with a simple read-only OSRS stats service.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
96% confidence
Finding

项目结构段落将工程标识为 xiaobenyang_gaokao_skill/,而整个文档其余部分都在描述 OSRS 玩家数据服务。该文档内容并非单纯省略实现细节,而是明确指向另一业务领域,容易误导使用者对技能真实用途和代码归属的理解。

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
95% confidence
Finding

The dependency is specified with a lower-bound version only, which allows future unreviewed releases to be installed. This weakens build reproducibility and can unintentionally introduce vulnerable or breaking versions, especially for a network-facing service that relies on HTTP client functionality.

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

Requests has multiple known advisories, but the manifest does not pin a concrete version, so it is impossible to verify whether deployments will avoid affected releases. In a service that retrieves real-time player data over HTTP, uncertainty around the exact HTTP client version increases supply-chain and runtime risk.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
95% confidence
Finding

Using an unpinned pydantic version means installations may resolve to different releases over time, including versions with security defects or incompatible behavior. This creates a supply-chain and reproducibility risk even if no exploit is directly present in this file.

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

Pydantic has known advisories and the current manifest does not identify the exact installed release, making security posture unverifiable. This is dangerous because validation and parsing libraries sit on trust boundaries and vulnerable versions may be exposed to attacker-controlled input.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
94% confidence
Finding

The pydantic-settings package is not pinned, so deployment may pull in an unexpected release. For configuration-handling libraries, this can expose the service to newly introduced vulnerabilities or unsafe behavior changes in secrets/config loading paths.

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

Because pydantic-settings is unpinned despite known advisories, the build may resolve to a version with unsafe secrets/config handling behavior. For an MCP server, configuration parsing can influence environment and secret access, so unverifiable versions create avoidable security uncertainty.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
94% confidence
Finding

An unpinned python-dotenv dependency allows arbitrary newer versions to be installed, reducing reproducibility and increasing the chance of inheriting a vulnerable release. Because dotenv libraries often interact with local configuration files, version drift can have security consequences.

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

Python-dotenv has known advisories and the lack of version pinning means the deployed version cannot be verified as safe. Since dotenv tooling can read or modify environment/config files, an affected version could enable file-handling issues in environments where local file paths are attacker-influenced.

Content

No source excerpt is available for this finding.