Back to skill

Security audit

广告注入服务

Security checks for vulnerabilities and agentic risk

Overview

The skill appears to mix mismatched identities with persistent API-key storage and remote prompt/code forwarding that users may not expect.

Review carefully before installing. Only use this skill if you trust the publisher with the API key and any prompts or source code you provide, and assume the key may be stored in a local .env file and that content may be sent to a third-party service.

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
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (23)

Lp3

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding
The skill documentation instructs the model to read environment configuration, persist user-supplied API keys, and call remote services, but no explicit permissions are declared. This creates a hidden capability surface where the agent can access local state, write secrets, and make network requests without transparent consent boundaries, which is especially risky given the misleading skill identity.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The advertised purpose is an ad-injection risk demo, but the documented behavior is an API-key-gated remote tool wrapper with secret storage and generic text/code operations. This mismatch is dangerous because it can socially engineer users and reviewers into trusting or enabling capabilities they would not approve if accurately described.

Description-Behavior Mismatch

High
Confidence
99% confidence
Finding
The body of the skill describes a completely different API-key-based gaokao/education toolset rather than the declared advertisement-injection demo. Such deceptive documentation strongly suggests skill identity spoofing, making it easier to hide sensitive actions like credential capture, remote API calls, and broad tool invocation behind an innocuous or research-oriented label.

Intent-Code Divergence

Medium
Confidence
93% confidence
Finding
The documentation directs the model to act as a router that selects tools, extracts parameters, and invokes generic remote functions, which is inconsistent with a narrow ad-injection demo. This broad orchestration pattern increases the chance of unintended or unauthorized tool use, especially when tool purposes are undocumented and activation criteria are vague.

Intent-Code Divergence

Medium
Confidence
95% confidence
Finding
The configuration docstring identifies this code as a different skill ("小笨羊高考Skill配置") than the advertised ad-injection demo. This kind of identity mismatch is dangerous because it can conceal code reuse from an unrelated project, obscure the real purpose of credential handling, and reduce reviewers' ability to detect hidden or unintended behavior.

Context-Inappropriate Capability

Medium
Confidence
92% confidence
Finding
This file manages and persists API credentials even though the declared skill is an ad-injection demo, which is an unusual capability for the stated purpose. In the context of a potentially adversarial skill, unrelated secret collection and storage increases the risk of covert data access, misuse of external services, or hidden coupling to third-party infrastructure.

Description-Behavior Mismatch

Medium
Confidence
91% confidence
Finding
The file exposes broad LLM helper functions such as generic completion, code analysis, and tips that are not constrained to the stated purpose of demonstrating ad injection. In a skill whose declared function is ad-injection middleware, these extra capabilities expand the attack surface and enable unintended use as a general-purpose proxy to remote model services.

Context-Inappropriate Capability

Medium
Confidence
93% confidence
Finding
The analyze_code function sends arbitrary source code to an external API despite the skill being described as an ad-injection demonstration service. This mismatch is dangerous because users or hosting agents may provide sensitive proprietary code without realizing the skill can exfiltrate it to a third-party endpoint.

Vague Triggers

Medium
Confidence
91% confidence
Finding
The tool selection table provides no meaningful mapping from user intent to tool choice and leaves the tools effectively unconstrained. Ambiguous trigger conditions can cause the model to invoke powerful remote functions inappropriately, expanding the attack surface and making abuse or accidental data disclosure more likely.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The skill mandates asking the user for an API key and saving it persistently, but does not provide adequate warning about storage, transmission, retention, or trust boundaries. Collecting and persisting secrets without clear risk disclosure and scoped consent can lead to credential theft, reuse exposure, or compromise through local file access and logs.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The code writes the API key directly into a local .env file without any user-facing warning, confirmation, or safeguards. Persisting secrets silently can expose credentials to other local users, accidental source control commits, backups, or later exfiltration by other components that read the same file.

Missing User Warnings

Medium
Confidence
89% confidence
Finding
User-provided prompts are forwarded to an external API with no visible warning, consent flow, or documentation in this module. In an LLM skill context, prompts often contain sensitive business data, credentials, or personal information, so silent transmission creates a real privacy and data-governance risk.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The analyze_code path transmits source code to an external API without any visible warning that the code leaves the local environment. This is especially dangerous because source code commonly contains secrets, proprietary logic, and customer data, and the skill’s ad-injection framing makes such transmission less expected by users.

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
89% confidence
Finding
The code manually reads the .env file and forcefully extracts XBY_APIKEY outside the normal settings framework. This bypasses standard configuration handling, expands the code path that accesses credentials, and in this skill context suggests unnecessary direct secret handling for functionality unrelated to the advertised demo.

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
89% confidence
Finding
Creating a Path to .env for direct credential access is part of bespoke secret-reading logic rather than ordinary configuration use. In context, this increases risk because the skill already appears mismatched to its stated purpose and is directly handling API credentials in a way that could facilitate later misuse or unintended disclosure.

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
95% confidence
Finding
This function explicitly saves an API key into .env, creating durable secret storage in a plaintext project file. Plaintext local persistence increases the chance of credential leakage through source control, logs, backups, shared workspaces, or later malicious reads by other components.

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 set_api_key flow is designed to persist credentials to .env as part of normal operation, not just accept them transiently. In the context of an ad-injection demo with unrelated external-service configuration, this broadens the attack surface by making secret retention a first-class feature without a clearly justified need.

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
97% confidence
Finding
The dependency is specified with a lower bound only, so future installs may resolve to different versions over time. This weakens build reproducibility and can unintentionally pull in vulnerable or incompatible releases, which is a real supply-chain risk even though it is not immediately exploitable by itself.

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
97% confidence
Finding
Using an unpinned pydantic version allows dependency resolution to drift across environments and over time. That can introduce vulnerable releases or breaking behavior without code changes, making the package set less trustworthy and harder to audit.

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
97% confidence
Finding
An unpinned pydantic-settings dependency creates a supply-chain exposure because installs are not deterministic. If an upstream release is compromised or contains a security regression, deployments may begin using it automatically.

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
97% confidence
Finding
The python-dotenv dependency is also unpinned, which permits uncontrolled version drift and undermines reproducibility. In a security-sensitive service, this increases the chance of silently inheriting vulnerable dependency behavior.

Known Vulnerable Dependency: requests==2.31.0 — 5 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) +2 more

Medium
Category
Supply Chain
Confidence
99% confidence
Finding
The finding indicates use of requests 2.31.0, which has multiple published advisories, including credential leakage via malicious URLs and improper verification behavior in some session flows. If this service makes outbound HTTP requests using attacker-influenced URLs or session state, those flaws could expose secrets or weaken transport security; the ad-injection/MCP context increases concern because such services commonly fetch remote content or relay external data.

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
91% confidence
Finding
The specified python-dotenv version is associated with an advisory involving symlink following in set_key, which can enable arbitrary file overwrite in affected usage patterns. This is only exploitable if the application calls the vulnerable functionality on attacker-influenced paths, so the direct risk from requirements alone is limited but still real enough to warrant remediation.

Static analysis

No suspicious patterns detected.