Back to skill

Security audit

文献搜索工具

Security checks for vulnerabilities and agentic risk

Overview

This is a disclosed API-backed literature search skill, but users should understand that it stores the service API key in a local .env file.

Before installing, be comfortable with sending literature queries and your XBY_APIKEY to XiaoBenYang's API service. Treat the generated .env file as sensitive, keep it out of version control and shared folders, and rotate the API key if it may have been exposed. The publisher should fix the stray gaokao/search_schools documentation and pin reviewed dependency versions.

Vulnerability Patterns
  • 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
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (14)

Lp3

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding
The skill advertises capabilities that require environment access, file read/write, and network use, yet no permissions are declared. This creates a transparency and consent gap: the agent may read local configuration, persist secrets to disk, and call remote services without the permission model making those operations explicit.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding
The documented purpose is a literature search tool, but the behavior includes local secret collection and persistence to .env, generic remote tool invocation, and references to an unrelated gaokao skill. This mismatch is dangerous because users may consent to a benign research workflow while the skill performs broader local and network actions than reasonably expected, increasing the chance of secret mishandling or abuse.

Intent-Code Divergence

Medium
Confidence
88% confidence
Finding
The workflow example instructs the model to call an unrelated school-search function instead of a literature-search function. In an agent setting, inaccurate operational guidance can misroute user requests to the wrong tool domain, producing unintended network actions or data handling that the user did not request.

Missing User Warnings

Medium
Confidence
92% confidence
Finding
代码会在没有任何用户可见确认或警告的情况下,将 API key 持久化到项目目录中的 .env,并同步写入进程环境变量。若运行目录被共享、纳入版本控制、被其他本地进程读取,或部署环境日志/备份覆盖该文件,凭据可能被意外泄露。

Credential Access

High
Category
Privilege Escalation
Content
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")
Confidence
88% confidence
Finding
model_post_init 中强制手动读取 .env 中的 XBY_APIKEY,绕过了更标准的配置加载边界,并增加了对本地明文凭据文件的依赖。该做法会鼓励在工作目录长期保存明文密钥,使凭据更容易因文件泄露、误提交或共享目录访问而暴露。

Credential Access

High
Category
Privilege Escalation
Content
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():
Confidence
88% confidence
Finding
代码显式检查并读取工作目录中的 .env 文件,这意味着凭据会以明文形式长期存在于本地文件系统。对于与文献搜索相关的技能,这种额外的本地凭据处理并非必要最小化设计,会增加被误提交、备份泄露或本地低权限读取的风险。

Credential Access

High
Category
Privilege Escalation
Content
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()
Confidence
95% confidence
Finding
save_api_key_to_env 明确将 API key 持久化到 .env,属于明文凭据落盘。明文存储在项目目录下的秘密容易被误上传到代码仓库、被其他本地用户读取、进入备份或被调试工具收集,导致远程服务凭据泄露。

Credential Access

High
Category
Privilege Escalation
Content
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()
Confidence
94% confidence
Finding
set_api_key 的语义就是‘设置并持久化到 .env’,这会把用户提供的敏感认证信息默认保存到本地明文文件中。对于一个文献搜索工具,这种默认持久化并非完成核心功能所必需,因此技能上下文使其显得更不必要,也更值得警惕。

Unpinned Dependencies

Low
Category
Supply Chain
Content
requests>=2.31.0
pydantic>=2.7.0
pydantic-settings>=2.2.0
python-dotenv>=1.0.1
Confidence
97% confidence
Finding
The dependency is specified with a lower-bound range (`requests>=2.31.0`) rather than a pinned or tightly constrained version, which makes builds non-reproducible and can silently pull in unexpected versions over time. In a security-sensitive tool that performs network-based literature search, this increases supply-chain risk and complicates auditing, though by itself it is usually a low-severity hygiene issue rather than an immediately exploitable flaw.

Unpinned Dependencies

Low
Category
Supply Chain
Content
requests>=2.31.0
pydantic>=2.7.0
pydantic-settings>=2.2.0
python-dotenv>=1.0.1
Confidence
96% confidence
Finding
Using `pydantic>=2.7.0` allows any newer version to be installed, which can introduce unreviewed changes, dependency confusion in CI/CD, or security regressions without code changes in the project itself. This is a genuine supply-chain hardening issue, but the direct exploitability depends on the package ecosystem and deployment practices.

Unpinned Dependencies

Low
Category
Supply Chain
Content
requests>=2.31.0
pydantic>=2.7.0
pydantic-settings>=2.2.0
python-dotenv>=1.0.1
Confidence
96% confidence
Finding
`pydantic-settings>=2.2.0` is unpinned, so future installs may resolve to materially different versions than the developer tested. That creates avoidable supply-chain and reproducibility risk, especially for a tool likely to rely on environment-based configuration and secrets handling.

Unpinned Dependencies

Low
Category
Supply Chain
Content
requests>=2.31.0
pydantic>=2.7.0
pydantic-settings>=2.2.0
python-dotenv>=1.0.1
Confidence
96% confidence
Finding
`python-dotenv>=1.0.1` is not pinned, so deployments may consume later versions that have not been validated with this skill. For a tool that may load configuration from environment files, uncontrolled dependency drift can affect both reliability and security posture.

Known Vulnerable Dependency: requests==2.31.0 — 3 advisory(ies): 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); CVE-2026-25645 (Requests has Insecure Temp File Reuse in its extract_zipped_paths() utility func)

Low
Category
Supply Chain
Confidence
91% confidence
Finding
The requirement permits installation of `requests` 2.31.0, which is identified as affected by multiple advisories, including credential leakage via malicious URLs and request verification issues in some session flows. Because this skill is a literature search tool that likely makes outbound HTTP requests to external data sources, a vulnerable HTTP client is more relevant than in an offline-only tool, increasing the practical risk if hostile endpoints or crafted URLs are encountered.

Known Vulnerable Dependency: python-dotenv==1.0.1 — 1 advisory(ies): CVE-2026-28684 (python-dotenv: Symlink following in set_key allows arbitrary file overwrite via )

Low
Category
Supply Chain
Confidence
85% confidence
Finding
The requirement permits installation of `python-dotenv` 1.0.1, which is flagged for a symlink-following issue in `set_key` that could enable arbitrary file overwrite in affected usage patterns. This is a real dependency risk, but its practical impact depends on whether the skill actually calls `set_key` on attacker-influenced paths; in a literature-search tool this is less central than the HTTP client risk, though still worth remediating.

Static analysis

No suspicious patterns detected.