Back to skill

Security audit

英国国家统计局服务

Security checks for vulnerabilities and agentic risk

Overview

The skill is advertised as keyless official ONS access, but it actually asks for and stores a xiaobenyang API key and sends requests to a xiaobenyang endpoint.

Install only if you intentionally trust xiaobenyang as the backend, are comfortable sending your queries and API key there, and accept that the key will be saved in a local .env file. Do not provide unrelated credentials; prefer a direct official ONS integration for keyless public statistics access.

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

Lp3

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding
The skill declares itself as a simple public-data ONS service, yet the documentation indicates capabilities involving environment access, file read/write, and network calls without any explicit permission disclosure. This creates a transparency and trust problem: users may authorize or provide secrets to a skill whose actual operational scope is broader than represented.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The skill claims to access the UK ONS Beta API without an API key, but the workflow instead requires collecting a third-party API key, persisting it, and apparently routing requests through a xiaobenyang-controlled endpoint. This is a strong deception signal because it misrepresents both the data source and the trust boundary, potentially tricking users into disclosing credentials to an unrelated service.

Intent-Code Divergence

High
Confidence
96% confidence
Finding
The documentation for an ONS data service contains unrelated xiaobenyang API-key instructions and even a school-search example, indicating copy-pasted or intentionally misleading operational guidance. Such inconsistencies are dangerous because they obscure what backend is actually contacted and increase the likelihood of credential harvesting or unauthorized third-party routing.

Intent-Code Divergence

High
Confidence
99% confidence
Finding
The file simultaneously states that no API key is needed and that an API key is mandatory. This contradiction is not a harmless doc bug in a security-sensitive context because it can be used to induce users to provide credentials they would not expect to share for public ONS data access.

Description-Behavior Mismatch

High
Confidence
97% confidence
Finding
The manifest markets the skill as a public ONS data access server, but the implementation details indicate use of an unrelated third-party API/key service. This breaks the user's expected trust model and can expose user queries or credentials to an undisclosed intermediary.

Description-Behavior Mismatch

High
Confidence
98% confidence
Finding
The implementation is for a different upstream service ('小笨羊MCP API') than the declared ONS Beta API skill. This is dangerous because users and operators may believe data is coming from a public statistics source while the skill actually sends requests to an unrelated backend, enabling covert data exfiltration, unauthorized third-party access, or deceptive behavior under a trusted label.

Description-Behavior Mismatch

High
Confidence
97% confidence
Finding
The manifest claims no API key is required, but the code refuses to operate without one and transmits it in a custom header to the upstream service. This mismatch is dangerous because it can trick users into supplying secrets to a skill that was represented as keyless and public, increasing the risk of credential harvesting or unauthorized use of third-party infrastructure.

Intent-Code Divergence

Medium
Confidence
92% confidence
Finding
The docstring explicitly states the client calls '小笨羊MCP API' tools, directly contradicting the stated ONS purpose. In context, this corroborates that the skill is misrepresented, which is dangerous because deceptive service identity undermines user consent and can mask unsafe external communications.

Description-Behavior Mismatch

High
Confidence
98% confidence
Finding
The skill metadata claims the service accesses the ONS Beta API without an API key, but this code is wired to require, read, and persist a third-party key named XBY_APIKEY for mcp.xiaobenyang.com. That mismatch is dangerous because it indicates the skill may proxy requests through an unrelated service and collect credentials beyond its declared purpose, expanding trust and exfiltration risk.

Context-Inappropriate Capability

Medium
Confidence
95% confidence
Finding
This skill adds local .env persistence for an API key even though its advertised role is simple statistical data retrieval. Persisting credentials to disk broadens the attack surface because other local processes, users, backups, or accidental commits can expose the key, and this behavior is not necessary for the stated function.

Intent-Code Divergence

High
Confidence
90% confidence
Finding
The Settings class docstring identifies the code as configuration for a different skill ('小笨羊高考') rather than the declared ONS service. Such cross-project inconsistency is a strong trust signal problem: it suggests code reuse from an unrelated system and increases the likelihood that hidden endpoints, credentials, or behaviors do not match the published description.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The function silently writes the supplied API key into a local .env file and mirrors it into the process environment, but there is no user-facing warning, consent, or guidance about persistence. This is dangerous because users may unknowingly leave long-lived credentials on disk where they can be leaked through filesystem access, backups, logs, or source control.

Ssd 3

Medium
Confidence
95% confidence
Finding
The skill explicitly instructs the agent to ask the user for an API key and save it, but it does not define safe handling boundaries such as minimization, masking, retention limits, or storage protections. In context, this is more dangerous because the key is for an unrelated third-party service rather than the advertised public ONS API, increasing the chance of unnecessary secret collection.

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
93% confidence
Finding
This code explicitly and forcibly reads XBY_APIKEY from a local .env file during initialization, despite the skill being presented as not requiring an API key. In context, that makes the credential access suspicious because it is hidden, unnecessary for the advertised ONS use case, and tied to an unrelated third-party service.

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
93% confidence
Finding
The existence check on .env is part of a manual credential-loading routine aimed at extracting XBY_APIKEY from local storage. In this skill context, that behavior exceeds what users would expect from a read-only public statistics client and increases the risk of unauthorized secret use.

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 is specifically dedicated to saving an API key into a local .env file. Given the mismatch between the declared ONS public-data purpose and the actual third-party key management, this is dangerous because it creates durable local secret storage for an undeclared service dependency.

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 routine persists the provided secret to .env as part of normal operation, embedding credential storage into the public API of the skill. That makes secret retention a first-class feature of a tool that claims no API key is needed, increasing the chance of misuse, leakage, and user deception.

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
96% confidence
Finding
The dependency is specified with a minimum version only, so installations may resolve to different versions over time, reducing build reproducibility and potentially pulling in newly introduced vulnerable or incompatible releases. In a security-sensitive integration that fetches remote data, this weakens supply-chain control even if it is not directly 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
95% confidence
Finding
Using an unpinned pydantic version allows non-deterministic installs and can introduce unexpected security or behavior changes when the environment is rebuilt. While not an exploit on its own, it increases supply-chain risk and operational uncertainty.

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
An unpinned pydantic-settings dependency permits future package releases to be installed automatically, which can introduce vulnerable code or breaking changes without review. This is a common supply-chain hygiene weakness rather than evidence of malicious behavior.

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
Leaving python-dotenv unpinned makes deployments non-reproducible and can unintentionally consume a later vulnerable release or incompatible change. Because dotenv libraries often influence configuration loading, controlling exact versions is prudent for security and stability.

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
90% confidence
Finding
The requirement floor includes requests 2.31.0, a version with published advisories, so environments may legally install a known vulnerable release. In an MCP server that accesses remote HTTP resources, flaws in the HTTP client can become materially relevant, especially for credential handling, TLS/session behavior, or unsafe helper utilities if used by the application or its transitive code paths.

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
79% confidence
Finding
The allowed version range includes python-dotenv 1.0.1, which has a published advisory involving symlink following in set_key and possible arbitrary file overwrite in affected usage. The actual exploitability depends on whether the skill calls the vulnerable functionality, but allowing installation of a known vulnerable version is still a real dependency risk.

Static analysis

No suspicious patterns detected.