Back to skill

Security audit

队列模拟服务

Security checks for vulnerabilities and agentic risk

Overview

This queue-simulation skill needs review because it collects and stores an API key in plaintext while parts of the package point to an unrelated Xiaobenyang/Gaokao backend.

Install only if you trust the Xiaobenyang service and are comfortable sending queue parameters to it. Use a low-privilege, revocable API key, avoid storing it in a shared or committed project directory, and review the package owner because the queue-simulation description does not fully align with the Gaokao/Xiaobenyang implementation details.

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 Project File

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 ``` ### Technical Analysis The function stores a user-supplied API key as plaintext in a predictable `.env` file in the process's current working directory. It uses `Path.write_text()` without explicitly creating the file with owner-only permissions or validating the permissions of an existing file. The project also does not include a `.gitignore` file demonstrating that `.env` is excluded from source control. Consequently, the credential may be exposed through local filesystem access, project archives, backups, logs from ancillary tooling, or accidental repository commits. The API client later uses this credential as the `XBY-APIKEY` authentication header. Disclosure therefore provides access equivalent to the authority assigned to the affected API key. ### Attack Path 1. A user provides an API key as instructed by the Skill. 2. `set_api_key()` invokes `save_api_key_to_env()`. 3. The function writes `XBY_APIKEY=` into `.env` without enforcing restrictive permissions. 4. Another local process or user with access to the project directory reads the file, or ...[truncated 875 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Note
Location
requirements.txt:1
Finding

Unbounded and Unverified Third-Party Dependency Resolution

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 declared with only a lower version bound. No upper bounds, exact pins, lock file, or package hashes are supplied. A later installation can therefore select dependency versions that were not reviewed as part of this audit. This does not demonstrate that any currently named package is malicious. However, it weakens supply-chain integrity and build reproducibility: a compromised, vulnerable, or behaviorally incompatible future release can be selected automatically. The absence of hashes also prevents the installer from verifying that resolved artifacts match specifically reviewed distributions. ### Attack Path 1. A future release of a declared package or one of its transitive dependencies is compromised, malicious, or newly vulnerable. 2. A user installs the project dependencies using `requirements.txt`. 3. Because the declarations accept any version at or above the stated minimum, the installer resolves the affected release automatically. 4. Because no hashes or lock file constrain the artifact, installation proceeds without verifying it against a reviewed package set. 5. Malicious package installation or import-time behavior executes with the privileges of the user or service performing the installation or running the Skill. This is a conditional supply-chain exploitation path; no malicious dependency was confirmed in the reviewed files. ### Impact Assessment If a resolved dependency is compromised, code can execute with the privileges of the installation or runtime account. Depending on that account's access, this may expose environment variables, API keys, project files, network resources, and other user-accessible data. The immediate con ...[truncated 155 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 (28)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The skill advertises broader M/M/c support and comprehensive local resources/tools/prompts, but the documented behavior only exposes M/M/1-oriented wrappers and says the code merely calls a remote API. Such overclaiming is security-relevant because reviewers and users cannot accurately assess where computation happens, what data leaves the environment, or whether the described capabilities actually exist.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill advertises broader M/M/c support and comprehensive local resources/tools/prompts, but the documented behavior only exposes M/M/1-oriented wrappers and says the code merely calls a remote API. Such overclaiming is security-relevant because reviewers and users cannot accurately assess where computation happens, what data leaves the environment, or whether the described capabilities actually exist.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The skill advertises broader M/M/c support and comprehensive local resources/tools/prompts, but the documented behavior only exposes M/M/1-oriented wrappers and says the code merely calls a remote API. Such overclaiming is security-relevant because reviewers and users cannot accurately assess where computation happens, what data leaves the environment, or whether the described capabilities actually exist.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The section introduces a queue simulation skill but immediately requires obtaining and storing an external API key for a third-party site. That is a deceptive integration pattern: it conditions core functionality on credential capture unrelated to the apparent purpose, which can trick users into surrendering secrets under false pretenses.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
95% confidence
Finding

The workflow states that the model is only a routing layer and that code simply calls APIs, which contradicts the surrounding presentation of simulation and analytical tool behavior. This inconsistency obscures trust boundaries and execution location, making it difficult to determine whether user inputs are processed locally or sent to an external service.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The project structure and return-value handling refer to a gaokao/Xiaobenyang API skill rather than queue simulation. This strongly indicates the skill may be wired to an unrelated backend, raising the risk that user inputs, outputs, and stored API keys are sent to the wrong service or exposed through raw response rendering.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The configuration code appears to belong to a different product ('小笨羊高考') and uses unrelated identifiers such as XBY_GAOKAO_ and xiaobenyang.com despite the skill being described as a queue-simulation service. This mismatch is a strong supply-chain red flag because it suggests code reuse from another service, increasing the risk of hidden data flows, unintended external dependencies, or deceptive packaging.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The class docstring explicitly identifies a different skill than the published queue-simulation service, which undermines trust in the package contents and provenance. While a docstring alone is not exploitable code, in context it corroborates that the module may be repurposed or mislabeled, a common indicator of unsafe or deceptive packaging.

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

The model_post_init method force-reads .env manually to extract XBY_APIKEY, bypassing normal configuration handling and tightly coupling the module to plaintext secret storage. In the context of a mislabeled skill, this direct secret-reading behavior is more suspicious because it unnecessarily searches local files for credentials unrelated to the declared queue-simulation purpose.

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

The explicit existence check and subsequent read of .env is part of custom credential collection logic that reaches into local plaintext configuration files for secrets. This is not automatically malicious, but it expands secret exposure and is especially concerning given the mismatch between the skill's stated purpose and the external service identifiers in the code.

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

This function is specifically designed to persist an API key to a plaintext .env file, creating a durable local credential artifact. That increases the chance of credential leakage via source control, filesystem disclosure, backups, or multi-user systems, and it is poorly justified for a queue-simulation skill.

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 declares no explicit tool/permission scope despite documentation indicating access to environment variables, file reads/writes, and networked API calls. Without least-privilege constraints, a host may grant broader capabilities than users expect, increasing the attack surface and making misuse of secrets or filesystem access harder to contain.

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 model to collect and save an API key but provides no warning about persistence, privacy, retention, or who can later access the stored secret. Users may disclose credentials without informed consent, and local persistence in .env expands the blast radius if the environment is later read or leaked.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill tells the model to ask for an API key and later display raw API data directly. In a natural-language tool chain, that creates a direct path for accidental secret disclosure, overexposure of sensitive upstream data, or reflection of credentials/tokens if they appear in responses or error messages.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The module persists an API key into a local .env file even though this behavior is not justified by the stated queue-simulation function. Storing secrets on disk increases exposure to accidental commits, insecure file permissions, local disclosure, and reuse by unrelated processes on the same host.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The save_api_key_to_env function silently writes the provided API key to .env and exports it into the process environment without any warning, confirmation, or disclosure to the user. This can cause users to unknowingly leave long-lived credentials on disk, where they may later be exposed through backups, logs, source control mistakes, or other local access.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The skill name and operational instructions are presented in Chinese throughout, with no indication that the user may choose another language. A forced language or locale without opt-in can violate language-choice policy unless the regional constraint is explicitly justified.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
96% 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 pull in vulnerable or breaking releases, especially for a network-facing library like requests.

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

Requests has multiple published advisories, but because the manifest does not pin a version, it is impossible to determine whether the installed release is affected. In a service context, an indirectly vulnerable HTTP client could expose credentials, weaken TLS validation behavior, or leak sensitive request data depending on the resolved version.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
95% confidence
Finding

Using pydantic>=2.7.0 permits installation of any later version, making builds non-reproducible and leaving uncertainty about whether a resolved version contains known security flaws. Because pydantic processes untrusted input in many applications, version drift can have security consequences.

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

Pydantic has known advisories, and without exact version pinning there is no reliable way to verify whether an affected version will be installed. Because it commonly validates external input, a vulnerable version could enable denial of service or unsafe parsing behavior in downstream code.

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 deployments may resolve to different versions with different security properties. This creates supply-chain uncertainty and makes it difficult to verify whether known issues affecting secrets-handling behavior are present.

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

The manifest does not fix the pydantic-settings version, so any advisory affecting that package cannot be ruled out for actual deployments. Given its role in loading configuration and secrets, a vulnerable version could contribute to path-handling or secret exposure issues if corresponding code paths exist.

Content

No source excerpt is available for this finding.