Back to skill

Security audit

认知增强服务

Security checks for vulnerabilities and agentic risk

Overview

The skill appears to provide reasoning tools, but it under-discloses persistent API key storage, external data transmission, and some inconsistent project identity signals.

Review this skill before installing. Only provide an API key if you are comfortable with it being stored in a local .env file, and avoid sending sensitive claims, private documents, business data, or credentials through its reasoning tools unless the upstream service and retention policy are acceptable.

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

Lp3

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding
The skill declares no permissions while its documented behavior requires access to environment variables, local file read/write, and outbound network calls. This creates a transparency and trust problem: users and hosting platforms cannot accurately assess what sensitive operations the skill may perform, including credential handling and exfiltration paths.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
The documented purpose says this is a cognitive-enhancement/MCP-server skill, but the behavior described includes reading and writing API keys, modifying .env, and sending requests to an external upstream service as a client. That mismatch is dangerous because it can mislead users and reviewers about the real trust boundary, causing them to provide secrets to a component that is not what it claims to be.

Intent-Code Divergence

Medium
Confidence
85% confidence
Finding
The project structure and naming reference a gaokao/school-query implementation while the skill claims to provide cognition/argumentation tooling. Such inconsistent identity and functionality strongly suggest code/documentation reuse without proper review, which increases the risk of hidden or unintended behaviors, wrong endpoints, and mishandling of user inputs or credentials.

Description-Behavior Mismatch

Medium
Confidence
87% confidence
Finding
This module goes beyond passive configuration loading and adds local credential persistence by writing API secrets into a project .env file. In an agent skill context, silent secret storage increases the risk of credential exposure through source control, backups, shared workspaces, or later prompt/tool access to local files.

Context-Inappropriate Capability

Medium
Confidence
86% confidence
Finding
The code modifies both the local .env file and process environment, creating credential storage and mutation capabilities not clearly justified by a cognitive-enhancement skill. That broadens the trust boundary: any caller that can reach this function can cause secret persistence on the host, which is dangerous in shared or semi-trusted agent environments.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The skill instructs the agent to collect a user API key and persist it via set_api_key() without any warning about storage location, retention, masking, or access controls. This is dangerous because users may unknowingly disclose long-lived credentials that get written to disk or logs, increasing the chance of credential theft or reuse.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
Persisting an API key to .env without any visible warning, confirmation, or scope explanation can cause users or calling code to store secrets on disk unintentionally. In agent environments, this increases the chance of accidental long-term secret retention and later disclosure via repository commits, logs, or file-reading tools.

Missing User Warnings

Low
Confidence
93% confidence
Finding
The function packages user-supplied argument content and sends it to an external API via call_api without any disclosure, consent mechanism, or local minimization visible in this file. Because the tool is explicitly designed for reasoning over potentially sensitive user claims, premises, and conclusions, this creates a real data-exposure/privacy risk even if it appears to be normal product behavior rather than malicious exfiltration.

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
84% confidence
Finding
This code explicitly reads the local .env file and extracts a specific API key, creating direct secret-access behavior in application code rather than relying on standard configuration loading alone. In an agent skill, local file secret access is more sensitive because tools may run in shared developer, CI, or hosted environments where plaintext secrets on disk are easier to expose.

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
84% confidence
Finding
The existence check is part of a code path that reads plaintext secrets from a local .env file, which confirms intentional local credential access. In this skill context, that is more dangerous than ordinary config access because the component also supports later persistence, making credential lifecycle handling broader and easier to misuse.

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
89% confidence
Finding
This function is explicitly designed to persist an API key to a plaintext .env file, creating durable secret storage on local disk. Plaintext credential persistence is risky in agent ecosystems because local files may be synced, committed, inspected by other tools, or left behind on multi-user systems.

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
88% confidence
Finding
This function advertises setting and persisting an API key to .env, normalizing insecure plaintext secret storage as part of routine operation. In the skill's stated cognitive-enhancement context, persistent credential handling is not clearly necessary and expands the attack surface for secret leakage.

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
The dependency is specified with a lower bound only, so builds may resolve to different versions over time. This weakens reproducibility and can unintentionally introduce vulnerable or breaking upstream releases into the skill's environment.

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 an unpinned version for pydantic means the installed package may vary across environments and over time. That increases supply-chain and stability risk because future releases could contain security issues or incompatible behavior.

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
95% confidence
Finding
A minimum-only version constraint for pydantic-settings allows uncontrolled upgrades during installation. This can expose the service to newly introduced vulnerabilities or unexpected runtime changes without explicit review.

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
The python-dotenv package is not pinned exactly, so dependency resolution is non-deterministic. In a service-oriented skill, that increases operational and supply-chain risk because future installs may silently pull in unsafe or incompatible versions.

Known Vulnerable Dependency: requests==2.31.0 — 5 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) +2 more

Medium
Category
Supply Chain
Confidence
98% confidence
Finding
The requirements permit requests>=2.31.0, and the finding identifies requests 2.31.0 as a version with multiple published advisories. In an MCP-style cognitive enhancement service that likely performs outbound HTTP requests, flaws in requests can directly affect network-facing behavior such as credential handling, TLS/session verification, or unsafe file handling in utility paths.

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
93% confidence
Finding
The dependency specification allows installation of python-dotenv 1.0.1, which is flagged with an advisory related to symlink following and arbitrary file overwrite in set_key. If this skill uses dotenv file manipulation in writable directories, that could be abused to overwrite unintended files, though the impact depends on how the library is used.

Static analysis

No suspicious patterns detected.