Back to skill

Security audit

AWS架构图生成工具

Security checks for vulnerabilities and agentic risk

Overview

The skill is presented as an AWS diagram tool, but it routes work through a XiaoBenYang remote API, stores an API key in plaintext, and sends more local metadata than the purpose clearly requires.

Review before installing. This skill requires a XiaoBenYang API key, writes it to a local .env file, and sends diagram requests plus your workspace path to an external service. Only use it in a workspace where that metadata is acceptable to disclose, avoid committing .env, and prefer a version that removes the Gaokao/service mismatch and uses safer secret storage.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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 Plaintext Without Enforced Restrictive Permissions

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 persists the user-supplied API key as plaintext in `.env` within the current working directory. It uses `Path.write_text()` without explicitly enforcing restrictive file permissions. The resulting permissions therefore depend on the existing file mode or process umask. The implementation also does not verify whether `.env` is a symbolic link, does not ensure that the file is excluded from version control, and stores the key in a location that may be scanned, synchronized, backed up, or committed with the project. Although plaintext environment files are common during development, automatically persisting a credential without file-permission hardening creates an avoidable disclosure risk. ### Attack Path 1. The Skill asks the user to provide an API key. 2. The agent calls `scripts.config.set_api_key()`. 3. `save_api_key_to_env()` writes the key as `XBY_APIKEY=` into `.env`. 4. If the workspace permissions, process umask, existing file mode, backup tooling, or source-control practices are insecu ...[truncated 842 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Note
Location
scripts/tools.py:71
Finding

Unnecessary Disclosure of the User's Local Workspace Path to an External API

Content
View full analysis
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 (34)

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

The skill claims local AWS diagram generation but also instructs the agent to manage and persist an API key, read local configuration, and use service endpoints tied to an unrelated '小笨羊高考' service. This strongly suggests either copied-in unrelated logic or concealed external service use, both of which create a material risk of credential misuse, data leakage, and deceptive operation.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill claims local AWS diagram generation but also instructs the agent to manage and persist an API key, read local configuration, and use service endpoints tied to an unrelated '小笨羊高考' service. This strongly suggests either copied-in unrelated logic or concealed external service use, both of which create a material risk of credential misuse, data leakage, and deceptive operation.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The workflow says the agent must obtain an API key, call API-oriented code, and return raw remote data, yet the documented tools are local diagram/code/example helpers. This contradiction is dangerous because it obscures actual data flows and can hide exfiltration or unauthorized third-party processing behind an innocent-looking local utility.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The docstring identifies the file as configuration for a different skill, directly conflicting with the published manifest. Such identity mismatch is a strong indicator of copied or repurposed code and is dangerous because it can conceal unauthorized behavior, mislead reviewers, and mask data flows to unexpected infrastructure.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The configuration clearly targets an unrelated service ('小笨羊高考') with a separate base URL, MCP ID, and API key flow, which materially contradicts the advertised AWS architecture diagram purpose. In a security review, this kind of service mismatch is dangerous because it can route user data or credentials to an unexpected third-party endpoint and indicates possible supply-chain contamination or repurposed code with hidden trust boundaries.

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

This code explicitly reads .env and extracts XBY_APIKEY for an unrelated service, despite the skill presenting itself as an AWS diagram tool. In context, this is dangerous because it performs credential collection outside user expectations and could facilitate exfiltration or misuse of a secret tied to undisclosed backend services.

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

The explicit opening and reading of .env as part of a hidden API key retrieval path increases concern because it targets a secret for an undisclosed service, not the advertised AWS functionality. Skill context makes this more dangerous: users of an architecture-diagram tool would not reasonably expect unrelated secret harvesting behavior.

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

This function is dedicated to writing an API key into .env, creating durable local storage for a secret associated with an unrelated service. In the context of a skill that should only generate AWS architecture diagrams, persistent collection of undisclosed third-party credentials is highly suspicious and can lead to secret leakage or unauthorized backend access.

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 declares broad behavior involving environment variables, file persistence, and remote/API interactions but does not define an explicit tool scope or allowed-tools boundary. In an agent setting, missing scope restrictions increases the chance that the skill can access or induce use of more capabilities than users expect, especially given the contradictory instructions around API-key storage and external calls.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest description limits the skill to generating AWS architecture diagrams, but the body of the skill explicitly supports sequence, flow, class, Kubernetes, on-premises, and custom diagrams. This is a semantic mismatch in declared purpose rather than an implementation detail, because the documented behavior broadens the skill beyond AWS architecture generation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The markdown imposes key workflow requirements entirely in Chinese, including mandatory user interaction about API keys, without stating that the skill can operate in other languages or based on user preference. This can violate language/locale policy because it effectively forces a specific language experience without opt-in.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill explicitly instructs the agent to ask the user for an API key in natural language and persist it via configuration, likely into a .env file. Collecting and storing secrets through conversational flow is dangerous because it normalizes secret disclosure to the agent, risks plaintext local storage, and may allow later unintended reuse or leakage.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
99% confidence
Finding

The workflow instructs callers to use keyword arguments with an example invoking scripts.tools.search_schools(...), but no such school-search tool is documented anywhere in this skill. This is not merely incomplete documentation; it directly points users to a different capability than the skill actually defines.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

Instructing the agent to display raw API JSON directly to the user creates a risk of exposing sensitive fields, internal metadata, tokens, or unexpected upstream content without filtering. The danger is amplified by the fact that the rest of the skill inconsistently describes local tooling, so reviewers cannot rely on the documented trust boundary.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

Directly presenting raw API response data can expose sensitive returned content, including identifiers, debug details, or confidential payload elements that the user did not need to see. In a skill already showing contradictory external-service behavior, this increases the chance of accidental secret or data disclosure.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The project structure and comments describe a different Gaokao/API-client skill, which undermines trust in what code will actually run and what external services are involved. This kind of identity mismatch can conceal unexpected network access, credential handling, or data processing under an unrelated label.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

This code sends params to a remote /api endpoint and includes an API key in request headers, which is a network operation involving user/system data and credentials. Although the code logs success and errors for developers, there is no user-facing prompt, warning, or explanatory comment/docstring disclosing that data will be transmitted externally.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The code persists an API key for an unrelated service into a local .env file even though the skill's stated function does not justify collecting or storing such a credential. This creates unnecessary secret retention and increases the risk of accidental disclosure through workspace sharing, source control mistakes, logs, backups, or later code execution in the same environment.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

Persisting a supplied API key to .env without an explicit user-facing warning or consent creates a credential-handling weakness. Users may assume the key is transient, while in reality it is written to disk where it may be exposed to other tools, shells, snapshots, or accidental commits.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
97% confidence
Finding

The dependency is specified with a lower bound only (requests>=2.31.0), which allows future installs to resolve to different versions over time. This weakens reproducibility and makes it impossible to verify whether the installed version includes known fixes or introduces new vulnerable behavior.

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

requests has multiple known advisories, and because the manifest does not pin a specific version, there is no way to confirm that installations avoid affected releases. This is especially relevant in a Codespaces-based tool that may fetch packages dynamically during setup, increasing exposure to vulnerable dependency resolution.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
97% confidence
Finding

pydantic>=2.7.0 is unpinned, so builds may pull different versions depending on install time and resolver behavior. This creates supply-chain uncertainty and prevents reliable assessment of whether a deployed version is 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

Static analysis

No suspicious patterns detected.