Back to skill

Security audit

CDK最佳实践服务

Security checks for vulnerabilities and agentic risk

Overview

This skill advertises AWS CDK guidance but actively depends on an unrelated Xiaobenyang API key and service, including saving that key locally.

Install only if you intentionally want a Xiaobenyang-hosted API wrapper for CDK-related answers and are comfortable giving it an XBY API key. Do not provide AWS credentials or sensitive code unless you understand what will be sent to the third-party API, and remove any saved XBY_APIKEY from .env if you no longer want the skill to reuse it.

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

Lp3

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding
The skill describes capabilities to read environment variables, read/write local files, and make network calls, yet no explicit permissions model is declared. This creates a transparency and governance gap: users and hosting platforms may not realize the skill can persist secrets locally and exfiltrate data to external services.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding
The documented purpose says the skill provides CDK guidance, but the file also instructs collection and persistence of an external API key, outbound transmission to a third-party API, and deprecated utility behaviors beyond simple guidance. This mismatch weakens informed consent and can mislead users into providing sensitive credentials or code artifacts under a narrower trust assumption.

Description-Behavior Mismatch

High
Confidence
95% confidence
Finding
The skill contains gaokao-style API-key and workflow text unrelated to the stated CDK purpose, indicating likely copy-paste contamination or documentation drift. In security terms, contradictory instructions are dangerous because they can cause the agent to request secrets for the wrong service and route user data to an unrelated external system.

Intent-Code Divergence

High
Confidence
98% confidence
Finding
The workflow example calls a school-search function even though the skill claims to be for CDK guidance. This contradiction strongly suggests the skill may invoke the wrong backend or expose user inputs to an unrelated API, increasing the risk of data leakage and unauthorized processing.

Description-Behavior Mismatch

High
Confidence
97% confidence
Finding
The project structure references an unrelated 'xiaobenyang_gaokao_skill' implementation instead of a CDK guidance service. This is a strong indicator of service confusion that may result in secrets, prompts, or user data being handled by the wrong codebase or external provider.

Description-Behavior Mismatch

High
Confidence
95% confidence
Finding
The module implements persistent API key storage by writing credentials into a local .env file, which materially exceeds the stated purpose of a read-only AWS CDK best-practices advisory skill. Persisting secrets on disk increases exposure to accidental commit, local disclosure, backup leakage, and reuse by other processes without clear user consent.

Context-Inappropriate Capability

Medium
Confidence
90% confidence
Finding
This code adds local credential storage capability that is not justified by the advertised advisory-only AWS CDK use case. Unnecessary secret-handling logic expands the attack surface and creates avoidable risk of credential disclosure through filesystem access, developer tooling, or source control mistakes.

Intent-Code Divergence

Medium
Confidence
84% confidence
Finding
The configuration class is labeled for an unrelated '小笨羊高考' skill while the package claims to be an AWS CDK best-practices service. This mismatch is a supply-chain red flag because it suggests code reuse from another project, undeclared functionality, or poor provenance, all of which reduce trust and can conceal unauthorized behavior such as unrelated credential collection.

Description-Behavior Mismatch

Medium
Confidence
85% confidence
Finding
The skill is presented as a CDK best-practices/advice service, but it also exposes a schema-generation capability that operates on arbitrary local Lambda source files and writes output to a caller-specified path. That materially expands the skill’s operational scope from advisory guidance into file-processing/code-transformation, increasing the risk of misuse, unauthorized file access patterns, or unsafe invocation paths through the downstream API.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The skill instructs the agent to ask for an API key and save it locally without any warning about persistence, masking, encryption, scope, or retention. This is dangerous because users may disclose a sensitive credential without understanding it will be written to disk and reused later.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The instruction to directly display raw API response data to the user omits any filtering or sensitivity review. Raw responses can contain secrets, internal identifiers, debug fields, or unexpected content from third-party services, leading to inadvertent disclosure.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The function writes an API key into .env without any user-facing warning or explicit consent regarding credential persistence. Users may reasonably assume the key is used transiently, so silent persistence can lead to unintended long-term storage, accidental commits, and broader local exposure.

Ssd 3

Medium
Confidence
95% confidence
Finding
The skill explicitly creates a workflow to collect, store, and reuse a user-provided API key, which creates a data retention and secret lifecycle risk. In the context of an agent skill, natural-language collection of credentials is especially risky because users may not distinguish between transient input and persistent storage.

Ssd 3

Medium
Confidence
90% confidence
Finding
Directly formatting and displaying raw tool output increases the chance that sensitive or irrelevant third-party data is exposed to the user. Because this skill already involves external APIs and ambiguous backend wiring, the context makes unsanitized output more dangerous, not less.

Credential Access

High
Category
Privilege Escalation
Content
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")
Confidence
90% confidence
Finding
The code forcibly parses .env to extract XBY_APIKEY outside the normal settings mechanism, specifically targeting a credential from a differently named namespace than the declared env_prefix. In the context of an AWS CDK advisory skill, this targeted secret-reading behavior is unnecessary and suspicious because it reaches into local credential storage for an unrelated service identifier.

Credential Access

High
Category
Privilege Escalation
Content
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():
Confidence
90% confidence
Finding
Opening and reading the .env file to locate XBY_APIKEY constitutes explicit credential access logic beyond normal advisory-skill needs. Because the skill context does not justify local secret discovery for another service namespace, this behavior increases the risk of unauthorized credential collection and misuse.

Credential Access

High
Category
Privilege Escalation
Content
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()
Confidence
94% confidence
Finding
The function is explicitly designed to save an API key to .env, creating durable local credential storage. In this skill context, that is more dangerous because the advertised purpose is guidance about AWS CDK best practices, not authentication management, so secret persistence appears unnecessary and enlarges the chance of credential leakage.

Credential Access

High
Category
Privilege Escalation
Content
def set_api_key(api_key: str) -> bool:
    """设置API key并持久化到.env"""
    if not api_key or not api_key.strip():
        return False
    api_key = api_key.strip()
Confidence
94% confidence
Finding
The public set_api_key routine persists the credential to .env by design, making secret storage part of the skill's normal workflow. This is risky because it normalizes plaintext credential persistence for a tool whose stated mission does not require local secret retention, increasing exposure through source control, local compromise, and unintended reuse.

Unpinned Dependencies

Low
Category
Supply Chain
Content
requests>=2.31.0
pydantic>=2.7.0
pydantic-settings>=2.2.0
python-dotenv>=1.0.1
Confidence
95% confidence
Finding
The dependency is specified with a lower bound only, which allows future installs to resolve to different versions over time. This weakens build reproducibility and can unintentionally introduce breaking changes or newly vulnerable releases into the skill's runtime.

Unpinned Dependencies

Low
Category
Supply Chain
Content
requests>=2.31.0
pydantic>=2.7.0
pydantic-settings>=2.2.0
python-dotenv>=1.0.1
Confidence
95% confidence
Finding
Using an unpinned version for pydantic makes dependency resolution non-deterministic across environments and deployments. That increases supply-chain risk because a later release could introduce incompatible behavior or a security issue without any code change in this project.

Unpinned Dependencies

Low
Category
Supply Chain
Content
requests>=2.31.0
pydantic>=2.7.0
pydantic-settings>=2.2.0
python-dotenv>=1.0.1
Confidence
95% confidence
Finding
The package pydantic-settings is not pinned, so installations may pull newer versions unpredictably. In an infrastructure-guidance skill, dependency drift can affect reliability and may expose the environment to newly introduced vulnerable package versions.

Unpinned Dependencies

Low
Category
Supply Chain
Content
requests>=2.31.0
pydantic>=2.7.0
pydantic-settings>=2.2.0
python-dotenv>=1.0.1
Confidence
95% confidence
Finding
A lower-bound-only requirement for python-dotenv permits uncontrolled upgrades during installation. This is especially relevant here because the same file also indicates a known vulnerable baseline version, showing that loose constraints can leave deployments on unsafe or inconsistent versions.

Known Vulnerable Dependency: requests==2.31.0 — 3 advisory(ies): 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); CVE-2026-25645 (Requests has Insecure Temp File Reuse in its extract_zipped_paths() utility func)

Low
Category
Supply Chain
Confidence
90% confidence
Finding
The requirements allow requests 2.31.0, and the finding identifies published advisories affecting that version. Even though the dependency is declared as >=2.31.0 rather than exactly pinned, environments may still install 2.31.0, leaving the skill exposed to issues such as credential leakage or weakened request verification depending on how requests is used.

Known Vulnerable Dependency: python-dotenv==1.0.1 — 1 advisory(ies): CVE-2026-28684 (python-dotenv: Symlink following in set_key allows arbitrary file overwrite via )

Low
Category
Supply Chain
Confidence
87% confidence
Finding
The dependency specification permits installation of python-dotenv 1.0.1, which is flagged with an advisory involving symlink-following during set_key operations that could enable arbitrary file overwrite in relevant usage patterns. In a developer-oriented skill that may read or manage environment configuration, this is more concerning than in a purely static library because .env handling is a plausible feature area.

Static analysis

No suspicious patterns detected.