Back to skill

Security audit

图标集成服务

Security checks for vulnerabilities and agentic risk

Overview

The skill appears intended for icon lookup, but it has mismatched documentation/code and stores a user API key in a plaintext .env file while sending requests to an external service.

Review this before installing. Only provide an API key you are comfortable storing in a local plaintext .env file, avoid using it inside a source-controlled project directory, and consider rotating the key if it may have already been exposed. The publisher should clean up the gaokao/school-search remnants, clearly document the XiaoBenYang API relationship, restrict the generic API caller to the icon tools, and replace plaintext key persistence with a safer credential mechanism.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/config.py:42
Finding

API Key Persisted in a Plaintext Working-Directory File

Content
View full analysis

Vulnerability Details

File Location: scripts/config.py, lines 42–62
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
    except Exception as e:
        print(f"保存API key失败: {e}")
        return False

Technical Analysis

The function stores a user-supplied API key as plaintext in .env. The path is relative to the process's current working directory rather than a dedicated, access-controlled configuration directory. The implementation does not explicitly create the file with restrictive permissions or verify the permissions of an existing file.

Consequently, the credential can be placed in an unrelated project directory, included accidentally in version control, exposed through backups, or made readable to other local users depending on the process umask and existing file permissions. Assigning the key to os.environ also makes it available to code running in the same process and potentially to subsequently spawned child processes.

Attack Path

  1. A user supplies an API key as required by the Skill workflow.
  2. set_api_key() invokes save_api_key_to_env().
  3. The function resolves `Path(".env") ...[truncated 870 chars]
Remediation
View remediation

Remediation Suggestions

  • Prefer session-only credential handling or an operating-system credential manager instead of plaintext persistence.
  • Obtain explicit user consent before storing the key persistently.
  • If file storage is required, use a deterministic, Skill-specific user configuration directory rather than the current working directory.
  • Create the credential file atomically with owner-only permissions such as 0600, and reject or repair files with broader permissions.
  • Add .env to source-control ignore rules and document that credential files must not be committed, copied into artifacts, or included in logs.
  • Avoid placing the key in the process environment unless required. Ensure that child processes do not inherit it unnecessarily.
  • Support credential rotation and advise users to revoke any key that may already have been exposed.
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 (26)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill claims to be a TypeScript Hugeicons MCP server, but the content describes Python configuration management, .env secret persistence, and a different service domain. Such inconsistencies can conceal unexpected data flows and secret handling, making it easier for a user or orchestrator to expose credentials under false assumptions about what the skill does.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill claims to be a TypeScript Hugeicons MCP server, but the content describes Python configuration management, .env secret persistence, and a different service domain. Such inconsistencies can conceal unexpected data flows and secret handling, making it easier for a user or orchestrator to expose credentials under false assumptions about what the skill does.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The workflow and project structure reference an unrelated gaokao/school-search skill inside a supposed icon integration service. This strongly suggests copy-paste contamination or repurposed instructions, which can misroute user input, secrets, and tool calls to the wrong backend or workflow.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The documentation explicitly instructs calling a school-search function that is not part of the listed icon toolset. This contradiction can cause the agent to invoke unintended functions or fail open into broader tool selection behavior, especially in environments where similarly named tools exist.

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 refers to a different skill ('小笨羊高考Skill配置') than the declared icon integration service, indicating copied or repurposed code. Such identity mismatch is a supply-chain and trust concern because it suggests the package may contain code from another project with unrelated behavior, making hidden credential-handling logic harder to justify or review.

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

The model_post_init method forcefully reads the .env file and manually extracts XBY_APIKEY, bypassing normal typed configuration boundaries and expanding explicit secret-handling behavior. This unnecessary direct parsing of local secret files increases the code's access to credentials and makes secret processing less transparent and harder to audit.

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

Creating a Path to .env and reading it directly is part of custom credential access logic aimed at extracting API keys from local storage. In the context of an icon service, this is more dangerous because the capability is unrelated to the stated purpose and needlessly broadens the code's interaction with sensitive local secrets.

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

This function is explicitly designed to persist an API key into a local .env file, creating plaintext at-rest storage of a credential. If the host is shared, backed up, inspected by other tools, or the file is accidentally committed, the credential can be stolen and reused, leading to unauthorized API use or broader account compromise.

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 capabilities that imply environment access, file read/write, and network use, but it does not define an explicit tool scope such as permissions or allowed-tools. In a skill that also instructs collecting and persisting an API key, missing scope boundaries increases the chance of overbroad tool access, unintended secret handling, or misuse of runtime capabilities.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file implements a generic outbound proxy client that can invoke arbitrary XiaoBenYang MCP tools by accepting caller-controlled mcp_id, tool_name, and params, which is broader than the stated Hugeicons-only icon integration purpose. In an agent skill context, this expands the skill's effective capability surface and can enable unintended external actions or data transmission through a third-party API, especially since there is no allowlist or scope restriction tied to icon-related operations.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The code forwards arbitrary params directly to an external API using json.dumps(params) with no validation, minimization, or user-consent boundary, so any data supplied by upstream callers may be exfiltrated to a third-party service. In a skill environment, this is more dangerous because tool inputs can include sensitive prompts, tokens, file contents, or user data, and the code provides no disclosure or safeguards limiting what can be transmitted.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The module provides functionality to persist an API key into a local .env file and expose it through process environment state. Storing secrets in plaintext on disk increases the chance of credential disclosure through source control inclusion, local compromise, backups, or accidental sharing, especially when this persistence behavior is built into the skill code rather than delegated to a secret store.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill is described as an icon integration/search service, but this code includes credential persistence behavior unrelated to simple icon lookup. That mismatch increases suspicion because it expands the skill's capability to collect and retain secrets locally without a clear functional need, creating unnecessary credential handling risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The save_api_key_to_env and set_api_key paths write a supplied API key to disk automatically without any explicit user-facing warning or consent flow. Silent persistence of secrets can surprise users and cause long-lived exposure if the file is later read by other tools, committed to repositories, or accessed by other local users/processes.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

This markdown file contains user-facing operational requirements primarily in Chinese, including mandatory setup and workflow instructions, while also embedding English tool descriptions. The skill does not state that users can choose their preferred language or that the Chinese-only guidance is intentional for a specific locale, which can violate language/locale policy expectations.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
97% confidence
Finding

The dependency uses a lower-bound specifier (requests>=2.31.0) instead of pinning an exact version, which makes builds non-reproducible and allows future installations to resolve to unexpected releases. In a supply-chain context this increases exposure to newly introduced bugs or malicious package compromise, and it also makes it impossible to verify whether known advisories affect the installed version.

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

The manifest references requests without an exact version while the package has multiple known advisories across its history. Because the dependency is not pinned, auditors cannot determine from this file alone whether deployments are safe or affected, which is a real supply-chain assurance gap even though it does not prove a specific CVE is present.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
97% confidence
Finding

pydantic>=2.7.0 is not version-pinned, so deployments may install different releases over time. This weakens reproducibility and supply-chain assurance, and it prevents confident assessment of whether the runtime version includes or avoids known security issues.

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

pydantic has known advisories in some versions, but the requirement only sets a minimum version. This means the actual installed version cannot be verified from the manifest, leaving uncertainty about exposure and weakening secure dependency governance.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
96% confidence
Finding

pydantic-settings>=2.2.0 permits any newer version to be installed, creating uncertainty about the actual dependency in production. That can introduce vulnerable or breaking releases without code changes, which is a common dependency-management security weakness.

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

Because pydantic-settings is not pinned, the manifest cannot demonstrate whether the deployed version is vulnerable or patched relative to known advisories. This is a verifiable dependency-management weakness that complicates risk assessment and patch control.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
96% confidence
Finding

python-dotenv>=1.0.1 is unpinned, so environments may resolve to different package versions with different security properties. This increases supply-chain risk and makes incident response and vulnerability verification harder.

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

Unverifiable Dependency: python-dotenv has 2 known advisory(ies) (CVE-2026-28684 (python-dotenv: Symlink following in set_key allows arbitrary file overwrite via ); CVE-2026-28684 (python-dotenv reads key-value pairs from a .env file and can set them as environ)), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
89% confidence
Finding

python-dotenv is specified with only a minimum version despite known advisories in some releases, so the manifest does not allow validation of whether installations are affected. This creates avoidable uncertainty and increases supply-chain and maintenance risk.

Content

No source excerpt is available for this finding.