Back to skill

Security audit

车牌识别

Security checks for vulnerabilities and agentic risk

Overview

This license-plate recognition skill appears purpose-aligned, but it persists API keys in a local plaintext .env file and sends vehicle images to an external API without strong storage or privacy controls.

Install only if you are comfortable giving this skill a Xiaobenyang API key and sending license-plate images or image URLs to that external service. Use a narrowly scoped key, avoid running it in a repository where .env may be committed or shared, and rotate the key if the workspace may have been exposed.

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 Explicit Access Controls

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 writes the API key directly into a plaintext `.env` file. It does not explicitly create the file with restrictive permissions, verify the permissions of an existing file, use an operating-system credential store, or perform an atomic protected write. The effective permissions therefore depend on the process umask and any permissions already assigned to `.env`. In a shared or improperly configured environment, another local account or process may be able to read the credential. The repository also contains no demonstrated `.gitignore` protection, creating an additional risk that the file could be committed or included in backups and build artifacts. This issue does not independently grant remote code execution or elevated operating-system privileges. Exploitation requires access to the generated file, a repository copy containing it, or an exposed backup. ### Attack Path 1. A user supplies a valid Xiaobenyang API key. 2. `set_api_key()` invokes `save_api_key_to_env()`. 3. The function stores the key as `XBY_APIKEY= ...[truncated 903 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Note
Location
requirements.txt:1
Finding

Unbounded and Unlocked Third-Party Dependency Versions

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 lower-bound-only version constraints. A future installation may consequently resolve to releases that did not exist and were not reviewed when the Skill was audited. No lock file or package hashes are present to ensure that installations resolve to a known dependency set and authentic artifacts. The listed package names and package source are not demonstrably malicious based on the reviewed files. The risk arises from unconstrained future resolution, compromised upstream releases, unexpected breaking changes, or different transitive dependency graphs across installations. ### Attack Path 1. The Skill is installed or rebuilt after newer dependency versions become available. 2. The package resolver selects versions above the stated minimums because no upper bounds, exact lock, or hashes constrain resolution. 3. A selected direct or transitive release contains malicious code, a newly introduced vulnerability, or behavior incompatible with the audited Skill. 4. Package code executes during installation, import, or normal Skill operation. 5. It operates with the permissions of the process installing or running the Skill. This is a supply-chain risk path rather than evidence that any dependency currently listed is malicious. ### Impact Assessment If a malicious or compromised release is selected, its Python code could potentially access files, environment variables, network resources, and API credentials available to the installer or Skill process. The precise impact would be bounded by that process's operating-system privileges and runtime isolation. More commonly, an incompatible future release could cause denial of se ...[truncated 116 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 (27)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill documentation indicates local reading and persistent writing of API keys via .env and environment variables, but this sensitive credential-management behavior is not reflected in the declared purpose. Silent local secret storage increases the risk of credential exposure, unintended persistence, and abuse by other processes or future executions that inherit the stored key.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill documentation indicates local reading and persistent writing of API keys via .env and environment variables, but this sensitive credential-management behavior is not reflected in the declared purpose. Silent local secret storage increases the risk of credential exposure, unintended persistence, and abuse by other processes or future executions that inherit the stored key.

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

The post-init hook forcefully reads XBY_APIKEY from a local .env file, creating direct secret-ingestion behavior in the skill. In this context, the skill is for plate recognition, so automatic local credential harvesting is broader than expected and increases the chance that unrelated secrets in the workspace are consumed or mishandled.

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

The explicit access to .env and subsequent parsing of API key material constitutes secret-access behavior beyond pure model configuration. While not exfiltration on its own, it materially increases exposure by pulling credentials from local storage into application state, where they may be reused, leaked, or persisted again.

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

This function is dedicated to writing API keys into a local .env file in plaintext, which creates a durable credential exposure point. If the workspace is shared, backed up, indexed, or accidentally committed, the key can be stolen and abused against the associated 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
89% confidence
Finding

The skill requires capabilities to read environment state, write configuration, and access the network, but it does not declare any explicit tool scope or permission boundaries. That makes the effective privilege set opaque to reviewers and users, increasing the risk of overbroad access and unauthorized file/network actions if the skill or its backing code is modified or misused.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

L037 的说明示例要求使用 scripts.tools.search_schools(...),但本技能声明的唯一用途是车牌识别,且后文实际列出的工具只有 plate_recognition 与 plate_recognition_for_data_base64。这不是单纯遗漏信息,而是文档直接指向了与技能意图无关的函数,容易误导代理按错误意图执行。

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This code includes natural-language docstrings and error/messages exclusively in Chinese, such as the client description and returned failure text. The policy forbids forcing a specific language or locale unless the user is given a choice or the constraint is clearly documented and justified.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill includes logic to set, persist, and retrieve an API key in a local .env file, which goes beyond simple plate-recognition behavior and introduces credential-handling risk. In an agent skill context, adding secret persistence broadens the trust boundary and can expose credentials to other local users, logs, backups, or unrelated tooling that reads workspace files.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This code can persist sensitive credentials locally in plaintext via .env updates, which is disproportionate to the stated plate-recognition purpose. Even if intended for convenience, plaintext local storage increases the chance of secret disclosure through source folders, backups, accidental commits, or multi-tenant host access.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The function silently writes the provided API key to .env and updates process environment state without any built-in confirmation, warning, or visibility to the user. That behavior can surprise users and cause sensitive tokens to be retained longer than intended, making later compromise or accidental exposure more likely.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This function sends a user-supplied image URL to an external API for plate recognition, which can expose personal or sensitive vehicle data to a third party without any disclosure, consent flow, or visible data-handling constraints in this file. Because license plates and associated images may be personal data, silent transmission creates privacy, compliance, and data-governance risk even if the code behavior is otherwise intended.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This function transmits raw base64-encoded image content directly to an external API, which increases privacy sensitivity because the full image payload is exported off-system. In the context of license plate recognition, the image may contain personal data beyond the plate itself, so undisclosed third-party transfer is a meaningful privacy and compliance concern.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

L091 将项目结构写为 xiaobenyang_gaokao_skill/,而当前技能名称与描述均为车牌识别。该文档内容与技能意图明显不一致,表明文档可能从其他项目复制而来,会干扰对技能真实职责和实现的理解。

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
94% confidence
Finding

The dependency specification for requests uses a lower bound only and does not pin an exact version. This makes builds non-reproducible and can result in installation of a vulnerable or breaking release depending on when and where the skill is deployed.

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

requests has multiple known advisories, and because the manifest does not pin a concrete version, there is no way to verify that deployed environments will avoid affected releases. In a networked skill, this uncertainty is more relevant because requests often handles outbound HTTP, redirects, authentication, and proxy behavior.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
93% confidence
Finding

The pydantic dependency is unpinned and may resolve to different versions across environments. That weakens supply-chain control and can expose the skill to vulnerable releases or unexpected behavior changes.

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

pydantic has known advisories, but the dependency declaration does not identify which exact release will be installed. That makes vulnerability status unverifiable and can allow affected versions into production without notice.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
92% confidence
Finding

pydantic-settings is declared with only a minimum version, so the actual installed package may vary over time. This increases supply-chain risk and makes it impossible to guarantee that deployments avoid vulnerable versions.

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

pydantic-settings has at least one known advisory and the lack of an exact version means the deployed package may or may not be vulnerable. This is a supply-chain hygiene issue that becomes more important if the skill reads secrets or configuration from the filesystem.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
92% confidence
Finding

python-dotenv is not pinned to a single version, creating non-reproducible installations and uncertainty about security posture. If a bad release is selected during installation, the skill could inherit known package vulnerabilities.

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

python-dotenv has known advisories, and without version pinning the build cannot demonstrate that it avoids affected releases. This is especially relevant if the skill writes or reads .env files in environments where symlink or file path manipulation is possible.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The file contains Chinese-only natural-language descriptions such as the class docstring and comments, indicating an implicit fixed language context. Under the policy, forcing a specific language without user opt-in can be a locale/language policy issue.

Content

No source excerpt is available for this finding.