Back to skill

Security audit

QAnon帖子分析服务

Security checks for vulnerabilities and agentic risk

Overview

This skill claims to provide QAnon post analysis, but it has conflicting Gaokao/XiaoBenYang identifiers and stores the user's API key in a plaintext local file.

Review this package before installing. Only use it if you trust the XiaoBenYang backend and are comfortable with a dedicated, low-privilege API key being stored in a local `.env` file; otherwise require the publisher to fix the QAnon/Gaokao identity mismatch, use secure or explicit opt-in secret storage, add output sanitization guidance, and pin dependencies.

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

API Key Persisted in a Plaintext File Without 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 function stores the API key directly in a `.env` file in the current working directory. The credential is written in plaintext, and the implementation neither creates the file with restrictive permissions nor verifies or corrects the permissions of an existing file. The effective permissions therefore depend on the process umask and any pre-existing `.env` file mode. In a shared environment, the resulting file may be readable by other local users or processes. Working-directory storage also increases the chance that the file will be copied into backups, build artifacts, archives, or source-control commits. The same credential is placed in the process environment, which can expose it to child processes and to process-inspection mechanisms permitted by the host operating system. ### Attack Path 1. The user provides an API key as required by the Skill. 2. `set_api_key()` calls `save_api_key_to_env()`. 3. The function writes `XBY_APIKEY=` ...[truncated 997 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Note
Location
requirements.txt:1
Finding

Unbounded Dependency Versions Permit Unreviewed Future Releases

Content
View full analysis
=2.31.0 pydantic>=2.7.0 pydantic-settings>=2.2.0 python-dotenv>=1.0.1 ``` ### Technical Analysis All dependencies use minimum-version constraints without upper bounds, exact pins, hashes, or a lockfile. Each installation can therefore resolve to a different set of packages, including future releases that were not reviewed with this project. The listed package names are established dependencies, and the audit found no evidence of typosquatting or a presently malicious version. The risk arises from allowing an installer to select arbitrary future versions and from lacking integrity hashes. A compromised upstream release, compromised package-distribution account, or unexpectedly incompatible update could consequently enter the runtime without a source change in this project. ### Attack Path 1. An administrator or automated deployment installs the project dependencies. 2. The package resolver selects the newest versions satisfying the `>=` constraints. 3. A selected release is compromised, has a malicious dependency, or contains an exploitable regression. 4. The package is downloaded without verification against a project-approved artifact hash. 5. Its code executes during installation, import, or normal Skill operation. 6. The dependency receives the same operating-system permissions, environment access, filesystem access, and network access as the Skill process. ### Impact Assessment A malicious dependency could execute code with the privileges of the installing or running process. Depending on that process's permissions, this could expose the API key, modify accessible files, issue network requests, or compromise data available to the Skill. No current malicious dependency was established by the static audit. The finding concer ...[truncated 134 chars]
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • 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
Findings (31)

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

The content strongly indicates the implementation is tied to 'xiaobenyang'/'gaokao' infrastructure rather than the claimed QAnon post dataset service. That inconsistency can mask exfiltration or misrouting of user queries and credentials to an unrelated third-party service, especially because the skill asks for an API key and persists it locally.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The content strongly indicates the implementation is tied to 'xiaobenyang'/'gaokao' infrastructure rather than the claimed QAnon post dataset service. That inconsistency can mask exfiltration or misrouting of user queries and credentials to an unrelated third-party service, especially because the skill asks for an API key and persists it locally.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The file’s behavior and identifiers clearly do not match the declared QAnon analysis service: it uses a different service name/prefix, a different base URL, and implements local API-key persistence. This kind of mismatched configuration is dangerous because it can redirect credentials or traffic to an unintended backend and indicates possible supply-chain confusion, code reuse from another product, 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 docstring explicitly says this is a Gaokao-related skill configuration, which directly conflicts with the claimed QAnon analysis service. Such contradiction is a serious trust and integrity issue because it suggests the skill may be misrepresented, increasing the likelihood of misrouting data, mishandling credentials, or hidden dependency on another service.

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

The code forcibly reads XBY_APIKEY from .env during initialization, bypassing more standard scoped configuration patterns and tightly coupling secret retrieval to local plaintext storage. In the context of a misdeclared skill, this increases concern that credentials are being sourced for an unintended service and expands the attack surface for secret exposure.

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

This function is explicitly designed to save an API key into a local .env file, creating durable plaintext secret storage. If the host is shared, backed up, or the repository is mishandled, the credential can be exposed and reused against the remote service.

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

The skill advertises no explicit tool scope or permissions boundaries even though its documented behavior includes environment access, local file reads/writes, and network use. That creates an overbroad capability surface where an agent may handle secrets, modify local configuration, and contact remote services without transparent restriction or user review.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill instructs the model to solicit an API key from the user and persist it, but gives no warning about storage method, retention, masking, or risks of entering credentials into chat. This creates a credential-harvesting and insecure secret-storage pattern that could expose the user's API key to logs, local files, or unintended components.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

Embedding a natural-language workflow that tells the model to ask for a credential and save it normalizes secret collection as part of routine conversation. In an adversarial or confused-skill context, this can be exploited to phish users for credentials and persist them insecurely, especially since the surrounding document already shows identity inconsistencies.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The workflow example instructs use of a school-query function unrelated to the declared toolset, showing that the instructions may be copied from a different skill. This increases the chance of incorrect tool routing, unintended data disclosure, or invocation of capabilities outside the expected domain, which is especially risky in an agentic setting.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The instruction to directly reorganize and display raw API responses treats remote output as inherently safe. Because upstream content is untrusted, this can leak sensitive data, surface malicious text, or cause downstream prompt-injection risks if later reused by the agent.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The client exposes a generic upstream MCP invocation primitive by accepting arbitrary mcp_id, tool_name, and params and forwarding them directly to the remote /api endpoint. That exceeds the declared purpose of QAnon dataset access and can enable capability expansion, letting callers invoke unrelated upstream tools or privileged operations if the provided API key has broader scope.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The function forwards user-controlled tool_name and params directly into request headers and body without enforcing that they correspond to the documented research-only dataset access workflow. In the context of a skill advertised for searching and analyzing a specific dataset, this creates an unintended proxy to arbitrary upstream tools, which can bypass local policy boundaries and broaden attack surface substantially.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

This code persists the API key into a local .env file even though the stated skill is a research/data-access service where silent credential storage is not strictly necessary. Persistent plaintext storage increases the chance of credential leakage through source control, backups, shared workspaces, or local compromise.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The function writes a supplied API key directly into .env without any user-facing warning, consent flow, or indication that the secret will be stored persistently. Users may assume the key is used transiently, leading to unintentional secret retention and later exposure via filesystem access, commits, or logs.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

The skill tells the model to directly display reorganized raw API response data without any guidance for redaction, content filtering, or schema validation. If the upstream service returns sensitive fields, prompt-injection text, or unexpected data, that content could be exposed directly to the user or propagated into later agent behavior.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

L264-L271 将项目结构写成 xiaobenyang_gaokao_skill/,并配合前文学校查询示例,明显与该文件开头声明的“QAnon帖子分析服务”相冲突。这种文档级冲突会误导维护者和代理,把技能来源、用途和应调用的模块理解成另一类服务。

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
94% confidence
Finding

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

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

The manifest does not pin requests, so it is impossible to determine from this file whether the installed version avoids known requests advisories. In practice this means a deployment could resolve to a vulnerable release depending on when and how dependencies are installed.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
94% confidence
Finding

Using an unpinned version for pydantic means installations are not deterministic and may pick up newly published versions without review. This creates supply-chain risk and makes it harder to verify whether deployed environments are affected by known advisories.

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

Because pydantic is not pinned, the project cannot demonstrate that deployed instances are using a non-vulnerable version relative to known advisories. This uncertainty is a supply-chain weakness and complicates patch verification and incident response.

Content

No source excerpt is available for this finding.