Back to skill

Security audit

文献搜索工具

Security checks for vulnerabilities and agentic risk

Overview

The skill appears purpose-aligned for literature search, but it needs review because it persists a third-party API key in a local plaintext .env file without clear storage controls or opt-out.

Review this skill before installing. It is not showing destructive behavior or hidden exfiltration, but using it means giving a XiaoBenYang API key to the agent and allowing the skill to store that key in a local plaintext .env file. Prefer a disposable or narrowly scoped key, keep .env out of source control and backups, rotate the key if exposed, and avoid entering sensitive unpublished research queries unless you are comfortable sending them to the external API service.

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

API Key Persisted in a Plaintext Environment File Without Enforced Access Controls

Content
View full analysis
` in the workspace `.env` file. 4. No restrictive permissions or ownership checks are applied. 5. A local process or user with workspace access, or a system that collects or publishes workspace files, reads the `.env` file. 6. The expos ...[truncated 877 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 (28)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The documented purpose is literature search, but the skill also instructs the agent to collect and persist an API key via local configuration for an external service. This behavior mismatch can mislead users and reviewers about the true security-sensitive actions performed, reducing informed consent around secret handling and privileged configuration changes.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
90% confidence
Finding

The documented purpose is literature search, but the skill also instructs the agent to collect and persist an API key via local configuration for an external service. This behavior mismatch can mislead users and reviewers about the true security-sensitive actions performed, reducing informed consent around secret handling and privileged configuration changes.

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

This code explicitly opens and parses the .env file to extract an API key, creating an additional credential-reading path outside the settings framework. While likely intended for convenience, duplicative manual secret parsing expands the secret exposure surface and can normalize direct credential handling inside application 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
84% confidence
Finding

The call to read_text loads the entire .env file contents into memory for manual parsing, unnecessarily broadening access to all secrets in that file rather than only the needed key. In a skill context, this is more concerning because the advertised functionality is literature search, not local credential file inspection or secret management.

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

This function is dedicated to writing an API key into a local .env file, which materially increases the risk of plaintext secret persistence, accidental disclosure, and misuse by downstream tools or users with filesystem access. In the context of a literature-search skill, persistent credential storage is ancillary functionality and therefore less expected, making the behavior more sensitive.

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

The skill declares no explicit tool scope or allowed-tools restrictions despite describing capabilities that touch environment variables, local file writes, and network access. In an agent setting, missing capability boundaries increases the chance of over-privileged execution, unintended data access, or misuse of sensitive operations such as persisting secrets.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill instructs the agent to ask the user for an API key and persist it via configuration, but does not clearly warn about storage location, retention, access controls, or the risks of writing secrets into a local .env file. This is dangerous because users may unknowingly disclose long-lived credentials that could later be exposed through logs, file access, backups, or other tools in the agent environment.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

L037 的说明要求调用 scripts.tools.search_schools(...),但整份技能文档声明的实际工具均为文献搜索相关函数,如 search_literature、get_article_details 等。这不是单纯遗漏,而是把高考/学校查询函数写进了文献搜索技能的必遵工作流,主动误导调用方对技能真实能力的理解。

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The code persists an API key to a local .env file and mutates runtime credentials through helper functions, which goes beyond passive configuration loading and increases secret-handling risk. Storing credentials in plaintext without explicit user consent or storage hardening can expose the key to other local users, backups, logs, or accidental source control inclusion.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The function silently writes the supplied API key into a plaintext .env file and updates the process environment without any user-facing warning, confirmation, or indication of persistence. This can cause users or integrating agents to unintentionally store sensitive credentials on disk where they may be recovered later.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

Natural-language policy violations apply to all file types, including code docstrings. Here, the user-facing documentation and operational guidance are presented in Chinese only, with no indication that the user can choose another language or that the locale restriction is intentional and justified.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The wrappers forward user-supplied keywords, identifiers, and journal names to an external API via call_api, but the tool text does not clearly disclose this outbound data transmission or any privacy implications. In an agent setting, users may reasonably assume local processing, so sensitive research topics, unpublished identifiers, or query intent could be unintentionally shared with a third-party service.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest describes a '专业文献搜索工具' and enumerates search, detail retrieval, references, relation analysis, journal quality evaluation, and export. However, this function's docstring and API call implement '获取文献全文工具' and explicitly return full article content, which is materially broader than metadata/detail retrieval and changes the skill from search/analysis into content acquisition.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

SQP-3 适用于所有文件中的自然语言策略问题。该技能名称、描述和全部操作说明均仅以中文给出,且没有提供语言选项、用户偏好协商或说明这是面向特定中文场景的区域性工具,因此存在强制特定语言/locale 的风险。

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

L348 将项目结构标为 xiaobenyang_gaokao_skill/,这与当前“文献搜索工具”的用途明显不一致。该类内联文档会让集成者误以为该技能属于高考/院校查询项目,属于文档意图与当前技能定位的直接冲突。

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
98% confidence
Finding

The dependency is specified with a lower bound only, which allows future installs to resolve to different versions over time. This weakens reproducibility and can unintentionally introduce vulnerable or incompatible releases into the environment.

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

The manifest does not pin requests, and the package has multiple published advisories across versions. Because the resolved installed version is unknown, consumers may inadvertently install an affected release, especially in fresh or rebuilt environments.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
98% confidence
Finding

Using an unpinned pydantic version means builds are not deterministic and may pull in a later release with security or stability issues. In security-sensitive tooling, this increases supply-chain risk even if no immediate exploit is present in the manifest itself.

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

Pydantic has known advisories in some versions, and this requirement does not constrain installs to a verified safe release. That makes the actual security posture unverifiable and may expose deployments to denial-of-service or parsing-related flaws depending on the resolved version.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
97% confidence
Finding

The unpinned pydantic-settings requirement permits uncontrolled version drift during installation. That can expose deployments to newly introduced vulnerabilities or breaking behavior without any code change in the skill itself.

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

Because pydantic-settings is not pinned, there is no assurance that installations avoid versions affected by known advisories. This creates avoidable uncertainty in a component that may process configuration and secrets-related inputs.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
97% confidence
Finding

A minimum-only version for python-dotenv allows the package manager to install any newer release, including versions later found vulnerable. This is a common supply-chain hygiene issue that reduces reproducibility and assurance.

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

The unpinned python-dotenv dependency leaves open the possibility of installing versions impacted by known issues. Since dotenv-related libraries can interact with configuration files and local paths, unresolved version drift can increase operational risk.

Content

No source excerpt is available for this finding.