Back to skill

Security audit

图标数据服务

Security checks for vulnerabilities and agentic risk

Overview

This skill may provide icon lookups, but its code and credential handling are mismatched and under-disclosed enough that users should review it before installing.

Install only if you trust the XiaoBenYang service and are comfortable storing its API key in a local plaintext .env file. Prefer using a dedicated, low-privilege key, check that the API origin cannot be overridden in your environment, and remove or rotate the key if the workspace may be shared or committed.

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

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/config.py:43
Finding

API Key Persisted in a Plaintext Working-Directory File

Content
View full analysis

Vulnerability Details

File Location: scripts/config.py:43-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

Technical Analysis

The API key is written directly into a plaintext .env file under the process's current working directory. The implementation does not explicitly create the file with restrictive permissions, verify existing ownership or permissions, reject symbolic links, or ensure that the destination is outside a source-controlled project.

Consequently, the credential may inherit permissions affected by the process umask or an existing file's permissions. The relative path also makes the storage destination dependent on the directory from which the Skill is invoked. This can result in exposure through local file access, source-control commits, workspace backups, build artifacts, or an attacker-prepared symbolic link.

Attack Path

  1. An attacker gains read access to the project workspace, backup, artifact, or generated .env file.
  2. Alternatively, where the attacker can prepare the working directory, the attacker places a symbolic link named .env pointing to a file that the Skill process ...[truncated 888 chars]
Remediation
View remediation

Remediation Suggestions

  • Prefer an operating-system credential manager or secret-management service instead of persistent plaintext storage.
  • If file storage is unavoidable, place the credential in a dedicated per-user configuration directory rather than the current working directory.
  • Create the credential file atomically with permissions restricted to the owning user, such as mode 0600 on POSIX systems.
  • Verify that the destination is a regular file owned by the expected user and reject symbolic links before reading or writing.
  • Use an atomic temporary-file-and-rename operation to avoid partial writes and race conditions.
  • Add .env to .gitignore and relevant artifact-exclusion rules, while documenting that it must never be committed or shared.
  • Avoid printing, logging, or including the credential in exceptions.
  • Provide key rotation and revocation guidance for users whose .env file may have been exposed.

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/config.py:8
Finding

Environment-Configurable API Origin Can Receive Authentication Credentials

Content
View full analysis

Vulnerability Details

File Location: scripts/config.py:8-22, scripts/call_api.py:48-66
Vulnerability Type: Credential forwarding to a configurable remote origin
Risk Level: Medium

Vulnerable Code

python
class Settings(BaseSettings):
    """小笨羊高考Skill配置"""
    
    model_config = SettingsConfigDict(
        env_prefix="XBY_GAOKAO_",
        env_file=".env",
        env_file_encoding="utf-8",
        extra="ignore",
    )

    # API配置
    base_url: str = "https://mcp.xiaobenyang.com"
    mcp_id: str = "1820705335657482"
    api_key: str = ""
python
url = f"{settings.base_url}/api"
mcp_id = mcp_id or settings.mcp_id

api_key = get_api_key()
if not api_key:
    raise UpstreamError("API密钥未设置,请先调用 set_api_key()")

headers = {
    "XBY-APIKEY": api_key,
    "func": tool_name,
    "mcpid": mcp_id,
    "Content-Type": "application/json",
}

t0 = time.time()
try:
    resp = self._session.post(
        url=url,
        headers=headers,
        data=json.dumps(params),
        timeout=settings.timeout_seconds,
    )

Technical Analysis

Settings permits fields to be populated through values using the XBY_GAOKAO_ environment prefix. Therefore, the API origin can be overridden through configuration such as XBY_GAOKAO_BASE_URL.

call_tool() then constructs a request from that configurable origin and unconditionally attaches the user's XBY-APIKEY header. There is no HTTPS scheme enforcement, hostname allowlist, certificate pinning, or validation that the resolved destination is the intended XiaoBenYang service.

This forms a credential-exfiltration path when an attacker can influence the Skill's environment or configuration. It may also allow plaintext transmission if the configured URL uses HTTP because the session explicitly supports both HTTP and HTTPS adapters.

Attack Path

  1. An attacker gains the ability to influence the ...[truncated 1176 chars]
Remediation
View remediation

Remediation Suggestions

  • Make the production API origin a constant if users do not need to configure it.
  • Otherwise, parse the URL and enforce an exact allowlist of approved schemes, hosts, and ports before attaching credentials.
  • Require HTTPS and reject HTTP, non-network schemes, embedded user information, unexpected ports, and malformed URLs.
  • Attach XBY-APIKEY only when the validated destination exactly matches the trusted XiaoBenYang API origin.
  • Separate development endpoint configuration from production builds and require explicit opt-in for test endpoints.
  • Consider certificate or public-key pinning where the deployment and certificate-rotation model permits it.
  • Sanitize inherited environment variables in launchers and deployment configurations.
  • Add tests proving that hostile origins, redirects to other origins, and HTTP endpoints cannot receive authentication headers.
  • Review redirect behavior and disable redirects or strip credentials whenever a redirect changes origin.

T08 · Insecure Dependencies

Note
Location
requirements.txt:1
Finding

Unbounded Dependency Constraints Reduce Build Integrity

Content
View full analysis

Vulnerability Details

File Location: requirements.txt:1-4
Vulnerability Type: Unpinned third-party 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 a minimum-only version constraint. A future installation can therefore select releases that were not present during the audit and have not been reviewed with this project. The absence of exact versions and package hashes also prevents deterministic verification of the artifacts installed by the package manager.

The reviewed files do not establish that any currently selected dependency is malicious or known to be vulnerable. The confirmed weakness is the lack of reproducibility and integrity controls, which increases exposure to future compromised releases, newly introduced vulnerabilities, or incompatible changes.

Attack Path

  1. A future version of an allowed package is compromised, maliciously published, or contains a security vulnerability.
  2. A user or automated deployment installs the project without a reviewed lock file or constraints file.
  3. The package resolver selects the affected release because it satisfies the minimum-only constraint.
  4. The affected package executes during installation or is imported at runtime.
  5. Malicious or vulnerable behavior runs with the privileges of the installing or executing process.

This path is conditional on a compromised or vulnerable allowed release, a package-index compromise, or an equivalent supply-chain event; no such package was identified in the reviewed project.

Impact Assessment

Potential impact depends on the behavior of the selected dependency and the privileges of the installation or runtime environment. In a worst-case supply-chain compromise, dependency code could read project data and credentials, make network requests, alter files a ...[truncated 227 chars]

Remediation
View remediation

Remediation Suggestions

  • Pin dependencies to exact, reviewed versions in a lock file or generated constraints file.
  • Use hash verification, such as pip's --require-hashes, to ensure that downloaded artifacts match approved distributions.
  • Generate pinned dependencies through a controlled tool such as pip-tools, while retaining a separate human-maintained file for direct dependency declarations if desired.
  • Review and test dependency updates before merging them.
  • Run automated vulnerability and provenance scanning against both direct and transitive dependencies.
  • Install packages only from explicitly approved indexes over HTTPS.
  • Use isolated, least-privileged build environments and avoid installing project dependencies as an administrative user.
  • Maintain a regular update process so exact pinning does not leave known vulnerabilities unresolved.
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)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The skill advertises Iconify browsing and search features, yet the content references unrelated config persistence, xiaobenyang.com, and gaokao-oriented project naming. Such deception or severe inconsistency increases the likelihood that users will supply credentials to an unrelated service or that reviewers will miss hidden behavior outside the declared scope.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill advertises Iconify browsing and search features, yet the content references unrelated config persistence, xiaobenyang.com, and gaokao-oriented project naming. Such deception or severe inconsistency increases the likelihood that users will supply credentials to an unrelated service or that reviewers will miss hidden behavior outside the declared scope.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The file implements a generic client for a different upstream service (“小笨羊MCP API”) rather than a narrowly scoped Iconify icon data service as declared. This capability mismatch is dangerous because it can conceal arbitrary remote tool invocation behind misleading metadata, causing users or reviewers to grant trust and API access to functionality outside the advertised scope.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

call_tool accepts attacker-controlled mcp_id, tool_name, and params and forwards them directly to a generic remote API with no local allowlist or scope restriction. In the context of a skill advertised as an icon data service, this creates an unauthorized general-purpose remote execution/proxy channel that could be abused to invoke unrelated or sensitive upstream tools using the user's API key.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The file’s behavior materially conflicts with the advertised Iconify-style icon service: it is wired to a different third-party service ('小笨羊高考') and includes code to read and persist an API key. This kind of scope mismatch is dangerous because users may provide credentials under false assumptions, enabling unintended credential collection or use outside the declared skill purpose.

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

This code manually reads the .env file to extract XBY_APIKEY, bypassing normal settings abstraction and directly accessing locally stored credentials for an unrelated service. In the context of a purported icon service, this increases suspicion and risk because it performs explicit secret harvesting behavior inconsistent with the advertised functionality.

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

The conditional check around local .env existence is part of a manual credential-reading path aimed at retrieving an API key from disk. While not malicious on its face, in this misleading skill context it contributes to unauthorized-seeming credential access behavior beyond what users would expect from an icon browsing tool.

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 explicitly designed to save an API key into a local .env file, creating plaintext at-rest secret storage. In a skill claiming to provide icon data, that is especially dangerous because it normalizes credential capture and persistence for functionality that does not obviously require such secrets, increasing the chance of misuse or exfiltration after local 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
85% confidence
Finding

The skill declares no explicit tool scope or permissions while the surrounding implementation apparently has access to environment variables, local file read/write, and network. In an agent setting, undocumented capabilities increase the risk of over-privileged execution, surprise side effects, and unsafe handling of secrets such as the requested API key.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill instructs the agent to ask for a user API key and persist it locally, but it does not disclose storage duration, location, access controls, or risks of credential reuse. Persisting secrets without explicit consent and secure handling guidance can expose credentials through logs, local files, backups, or other tools with filesystem access.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The workflow example invokes an unrelated school-search function inside an icon-service skill. Even if partly a copy-paste error, this creates strong evidence that the skill may call unintended tools or route user requests into the wrong backend, undermining predictability and safe review.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The workflow and project documentation reference a different domain than the declared icon service, indicating the skill may be repurposed from another project without proper review. In security-sensitive agent ecosystems, this kind of documentation drift can conceal unintended tool access, data handling, or remote API behavior.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The class and function documentation explicitly describe calling the “小笨羊MCP” API, which contradicts the skill’s declared Iconify purpose. While documentation mismatch alone is not exploitation, here it reinforces that the code is intentionally built for a different service, increasing the likelihood of deceptive packaging and reducing the chance that operators understand the real data flows and permissions being granted.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This code reads a credential via get_api_key() and sends it as the XBY-APIKEY header in a network request. Although the code logs request outcomes, it does not provide any user-facing warning, confirmation, or explanatory comment/docstring that discloses credential transmission to an external service.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The comments and docstrings describe management of a '小笨羊高考' API key rather than an icon data service, reinforcing that the implementation serves a different purpose than the published metadata. This inconsistency undermines trust and can mislead users into entering sensitive credentials for an undisclosed backend, making the skill context more dangerous than a normal configuration mismatch.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill implements local persistence of an API key into a .env file even though the stated functionality is browsing/searching open-source icons, which typically does not justify credential storage. Persisting secrets unnecessarily expands the attack surface by leaving recoverable credentials on disk and increasing the chance of accidental leakage through backups, source control, or local compromise.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The code writes the API key to .env in plaintext without any explicit user-facing warning, confirmation, or disclosure of persistence behavior. Silent credential storage is risky because users may assume a transient session while the secret remains on disk and may later be exposed through file reads, backups, logs, or repository commits.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

The natural-language instructions throughout the skill are presented only in Chinese and include mandatory operational requirements, but there is no indication that users may choose another language or that the skill is intentionally limited to a Chinese-speaking context. Under the policy, forcing a specific language without opt-in can be a locale-policy issue.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
86% confidence
Finding

The documented package path names the project as a gaokao skill rather than an icon service, which is another signal of cross-domain repackaging. By itself this is lower severity, but in context it reinforces that users may be interacting with software other than what the skill claims to be.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
96% confidence
Finding

The dependency is specified with only a minimum version bound, so builds may resolve to different releases over time. This weakens reproducibility and can inadvertently introduce vulnerable or breaking versions into the skill's environment.

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 an exact version, it is not possible to verify whether installations will avoid affected releases. In an MCP server that likely makes outbound HTTP requests to an icon service, this uncertainty increases the chance of pulling a version with credential leakage or TLS-related flaws.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
96% confidence
Finding

Using an unpinned pydantic version means the installed package can vary by install time and resolver behavior. That creates supply-chain risk and makes it harder to verify whether the deployed version contains known security fixes.

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 known advisories, but the current requirement does not define an exact installed version. That makes it impossible to confirm whether deployments are protected from issues such as denial of service or parser edge-case vulnerabilities.

Content

No source excerpt is available for this finding.