Back to skill

Security audit

React组件库文档服务

Security checks for vulnerabilities and agentic risk

Overview

The skill appears to provide Composer Kit documentation lookups, but it requires and persistently stores a third-party API key for an inconsistently documented backend.

Review this skill before installing. Only use it if you trust the XiaoBenYang service and are comfortable sending documentation queries plus an XBY API key to that backend. Treat the saved .env key as a secret, keep it out of source control and shared workspaces, and prefer a version that uses clearer disclosure, scoped credentials, restrictive file permissions, and pinned 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:45
Finding

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

Content
View full analysis

Vulnerability Details

File Location: scripts/config.py:45-63
Vulnerability Type: Plaintext storage of sensitive credentials
Risk Level: Medium

Vulnerable Code

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

The persistence behavior is also explicitly required by SKILL.md:17-19:

text
- When XBY_APIKEY is absent from .env, the Skill must ask the user for an API key
- After receiving the key, call scripts.config.set_api_key(api_key) to save it

Technical Analysis

The application writes the user-supplied API key directly into a plaintext .env file. The implementation does not use an operating-system credential store, encrypt the value, obtain explicit consent for persistent storage, or enforce restrictive file permissions such as mode 0600.

Path.write_text() creates a new file according to the process umask and preserves the permissions of an existing file. Consequently, the confidentiality of the key depends on external runtime configuration that this Skill neither verifies nor controls. The same key is also copied into the process environment, where it may be visible to sufficiently privileged local processes or inherited by child processes.

This is not evidence that the Skill deliber ...[truncated 1517 chars]

Remediation
View remediation

Remediation Suggestions

  1. Prefer session-only credential handling or an operating-system credential manager instead of storing the key in the project directory.
  2. Obtain explicit user consent before persisting the credential and clearly disclose the destination and retention period.
  3. If file persistence is unavoidable, create the credential file atomically with mode 0600 and verify or correct permissions on existing files.
  4. Store credentials in a user-specific configuration directory rather than the repository or working directory.
  5. Add .env to .gitignore and deployment artifact exclusion rules.
  6. Avoid copying the key into the process environment unless required, and prevent unnecessary inheritance by child processes.
  7. Never include the key in logs, exception messages, telemetry, or API response objects.
  8. Provide key rotation and revocation guidance in case the file is exposed.

T08 · Insecure Dependencies

Note
Location
requirements.txt:1
Finding

Unbounded Dependency Versions Permit Unreviewed Package Updates

Content
View full analysis

Vulnerability Details

File Location: requirements.txt:1-4
Vulnerability Type: Non-reproducible and insufficiently constrained dependencies
Risk Level: Low

Vulnerable Code

text
requests>=2.31.0
pydantic>=2.7.0
pydantic-settings>=2.2.0
python-dotenv>=1.0.1

Technical Analysis

Every dependency uses an open-ended lower-bound constraint. A future installation may therefore resolve to package versions that did not exist when the Skill was reviewed. The project includes no lock file and no integrity hashes to bind installations to known artifacts.

This does not establish that any listed dependency is currently malicious or vulnerable. The risk is that builds are not reproducible and can silently incorporate a future compromised, incompatible, or newly vulnerable release. Because Python dependencies execute within the application's process, a compromised package could access the same files, environment variables, network connectivity, and API key available to the Skill.

Attack Path

  1. An operator installs dependencies from requirements.txt.
  2. The package resolver selects the newest available versions satisfying the open-ended >= constraints.
  3. A selected version contains a supply-chain compromise or security regression introduced after the project's review.
  4. The dependency executes during installation, import, or normal application operation.
  5. Malicious dependency code acts with the privileges of the installing or running user and may read the locally persisted API key or alter API requests and responses.

This path depends on a compromised or vulnerable future dependency release; no such release was identified from the supplied project files.

Impact Assessment

The maximum impact of a compromised dependency is code execution with the privileges of the user running or installing the Skill. That could permit access to project files, the plaintext .env credential, proces ...[truncated 270 chars]

Remediation
View remediation

Remediation Suggestions

  1. Pin dependencies to reviewed versions using exact constraints.
  2. Generate and commit a reproducible lock file through a tool such as pip-tools, Poetry, or uv.
  3. Use artifact hashes with hash-checking mode where supported.
  4. Review transitive dependencies as part of the lock and update process.
  5. Automate vulnerability and provenance scanning in continuous integration.
  6. Apply dependency upgrades through reviewed pull requests with compatibility and security tests rather than resolving unrestricted versions during deployment.
  7. Install packages only from an explicitly trusted package index over authenticated TLS.
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 (30)

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

A second description-behavior mismatch is present: the skill claims to provide React component documentation but also instructs the model to read and persist XBY_APIKEY in .env and references a backend associated with xiaobenyang/gaokao-style infrastructure. Secret collection and local persistence are materially different from a passive documentation skill and create a risk of credential harvesting, data leakage, or unauthorized backend interaction under misleading branding.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

A second description-behavior mismatch is present: the skill claims to provide React component documentation but also instructs the model to read and persist XBY_APIKEY in .env and references a backend associated with xiaobenyang/gaokao-style infrastructure. Secret collection and local persistence are materially different from a passive documentation skill and create a risk of credential harvesting, data leakage, or unauthorized backend interaction under misleading branding.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The API-key workflow and external service references are inconsistent with a React component documentation service and suggest the skill may redirect users to an unrelated backend. This is dangerous because the skill explicitly instructs collection of a user-supplied key and persistence of that secret, creating an opportunity for credential misuse or for a deceptive service to obtain trusted access under a misleading pretext.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The workflow examples and project structure mention gaokao-style tooling and a different project name, which strongly indicates copy-pasted or repurposed instructions unrelated to the stated Composer Kit purpose. In security terms, this inconsistency undermines trust boundaries and suggests the skill may invoke unexpected backends or functions, making secret handling and remote requests significantly more suspicious in context.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

This file implements a generic client for an external '小笨羊MCP' API, which is materially inconsistent with the stated purpose of a local React component-library documentation service. In practice, this introduces an undeclared external dependency and creates a covert data egress path for prompts/parameters and API credentials to a third-party upstream, expanding trust boundaries without clear justification.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
94% confidence
Finding

The call_tool method accepts caller-controlled mcp_id, tool_name, and params and forwards them directly to an external API via custom headers and JSON body. For a documentation service, this is overpowered functionality that can be abused to invoke arbitrary remote tools, potentially causing unauthorized actions, data exfiltration, or pivoting through the skill into external systems.

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

The code manually reads the entire .env file and extracts XBY_APIKEY, bypassing the normal settings abstraction and increasing the chance of mishandling secrets. In the context of a mismatched skill, forced secret loading for an unrelated service increases suspicion and broadens the risk of unintended credential exposure or use.

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

Opening and reading .env directly exposes all local configuration contents to this module, even though only one key is needed. That expands the blast radius if the code is modified, logged, or reused incorrectly, and is more concerning because the declared skill purpose does not align with the credential being accessed.

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

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest describes a server for providing Composer Kit React component documentation and examples, but this file implements persistent API key management for an unrelated XBY/Gaokao service, including writing credentials to a local .env file and mutating process environment state. That credential-storage behavior is not an obvious implementation detail of a documentation-serving skill and indicates the code belongs to a different purpose than the manifest claims.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
95% confidence
Finding

This function explicitly writes the API key into .env on disk, creating a durable plaintext secret that may be exposed through source-control mistakes, backups, local file disclosure, workspace sharing, or other tooling. Because the module appears misaligned with the stated skill purpose, this persistence behavior is more dangerous: users may not expect a documentation service to store unrelated credentials locally.

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

The skill declares no explicit tool scope or permission boundaries despite documentation indicating access to environment variables, local file read/write, and networked API calls. In an agent setting, missing scope declarations increase the chance that the model can be induced to use broader capabilities than users expect, especially when secrets are read from or written to .env and external requests are made.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill’s user-facing instructions and operational requirements are entirely written in Chinese, with no indication that users may choose another language or that the locale restriction is required for a region-specific compliance reason. This creates a natural-language policy concern because the skill effectively imposes a specific language without user opt-in.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This code reads an API key and sends both authentication headers and user-supplied params to an external HTTP endpoint. While internal logging exists for success and error cases, there is no user-facing prompt, warning comment/docstring about data transmission, or other disclosure in this file to inform users that their data will be sent upstream.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The class docstring says this is '小笨羊高考Skill配置', and later comments refer to forcibly reading and persisting 'XBY_APIKEY', which contradicts the manifest's claim that the skill is a React component library documentation service for Composer Kit on Celo. This is active intent-level divergence in the file's own documentation, not merely missing detail.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This function persists a sensitive API key to a local .env file and also exports it into the process environment without any consent flow, storage warning, or permission hardening. If the working directory is shared, backed up, committed, or readable by other local users/processes, the credential can be exposed and abused.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
98% confidence
Finding

The dependency specification uses a lower-bound only constraint (requests>=2.31.0) rather than pinning to an exact version or constrained range. This makes builds non-reproducible and can cause the environment to resolve to unexpectedly vulnerable or breaking future releases, which weakens supply-chain security even though the file itself does not prove exploitation.

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

requests has multiple known advisories, and because the manifest does not pin a specific version, there is no way to determine whether deployed instances are affected. In a documentation service that likely makes outbound HTTP requests, this uncertainty is more relevant because network-facing libraries are commonly exposed to attacker-controlled inputs.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
98% confidence
Finding

pydantic>=2.7.0 is unpinned, so different installations may pull different versions over time. That increases supply-chain risk and makes it impossible to verify from this manifest alone whether deployed environments are using a safe, tested release.

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

pydantic has published advisories, but the manifest only specifies a minimum version, so the actual installed release cannot be validated from this file. Since validation libraries may process untrusted input, unresolved version ambiguity can leave the service exposed to parser or denial-of-service issues.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
97% confidence
Finding

pydantic-settings>=2.2.0 allows future versions to be installed without review, which undermines reproducibility and may silently introduce vulnerable or incompatible releases. In a service that may process configuration and secrets, uncontrolled dependency resolution increases operational and security risk.

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

pydantic-settings has at least one advisory, and the lack of a pinned version prevents verification that the installed build is unaffected. Because settings libraries may read configuration and secrets from the filesystem, uncertainty around the exact version can matter if file-handling flaws are present.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
97% confidence
Finding

python-dotenv>=1.0.1 is not pinned, so installs may resolve to different versions depending on time and environment. Because this package often interacts with local environment files and configuration, unreviewed upgrades can expose the application to newly introduced or unfixed security issues.

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