Back to skill

Security audit

JSON对比工具

Security checks for vulnerabilities and agentic risk

Overview

This skill appears to be an API-backed JSON comparison tool, but it stores an API key in a local .env file and uses broader remote-call plumbing than a simple JSON diff tool would normally need.

Install only if you are comfortable giving this publisher a Xiaobenyang API key, having that key saved in a plaintext .env file, and sending JSON comparison inputs to the remote mcp.xiaobenyang.com service. Avoid using it in repositories where .env might be committed, and prefer a local JSON diff tool if you do not specifically need this API-backed 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
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (19)

Lp3

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding
The skill declares no permissions while its documented behavior includes reading environment variables, writing local configuration files, and making network requests. This undermines least-privilege expectations and can cause users or orchestration layers to grant trust to a skill whose effective capabilities are broader than disclosed.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
The skill is presented as a JSON diff utility, but the documentation reveals additional behaviors: external API invocation, API-key collection, local secret persistence, and generic MCP tool execution. This mismatch can mislead users and agents into exposing secrets or approving networked actions they would not expect from a simple comparison tool.

Description-Behavior Mismatch

High
Confidence
98% confidence
Finding
The documentation claims to provide JSON diffing, but the workflow and examples describe an API-backed gaokao/school-search service with mandatory API-key handling. This inconsistency is dangerous because it suggests the skill may be repurposed, mislabeled, or copied from another project, making its real behavior harder to audit and increasing the chance of deceptive data collection.

Intent-Code Divergence

Medium
Confidence
94% confidence
Finding
The documentation says the code only calls APIs, but it also instructs the model to save a user-provided API key locally via configuration mutation. Persisting secrets locally is a materially different and more sensitive behavior than simple API usage, especially when not prominently disclosed as a storage action.

Description-Behavior Mismatch

Medium
Confidence
95% confidence
Finding
The skill is ներկայացված as a JSON comparison tool, but this file implements a generic remote MCP invocation client that can call arbitrary upstream tools via attacker-controlled tool_name, mcp_id, and params. This capability mismatch is dangerous because it expands the operational scope far beyond the declared purpose, enabling hidden remote actions and making review, consent, and policy enforcement harder in an AI-agent context.

Context-Inappropriate Capability

Medium
Confidence
97% confidence
Finding
The client can invoke arbitrary upstream MCP tools by setting the func header from tool_name and passing unbounded JSON params directly to the remote API. In an agent environment, this creates a confused-deputy/capability-exposure risk: any workflow that can reach this wrapper may trigger unintended remote actions under the stored API key, far beyond JSON comparison.

Description-Behavior Mismatch

High
Confidence
96% confidence
Finding
The file implements configuration and credential handling for an unrelated 'gaokao' service, including a remote base URL, MCP ID, and API key persistence, despite the skill being described as a JSON comparison tool. This mismatch increases the likelihood of hidden or unnecessary network-capable functionality and secret handling that users would not reasonably expect from the advertised skill.

Context-Inappropriate Capability

High
Confidence
95% confidence
Finding
The code reads, stores, and updates an API key in both .env and process environment state even though credential management is not a core requirement for a local JSON diff tool. In this context, unnecessary secret collection and persistence enlarge the attack surface and can facilitate credential misuse or exfiltration by other parts of the skill.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The function silently persists a supplied API key to a local .env file without any warning, confirmation, or discussion of storage risks. Plaintext secret storage in workspace files can expose credentials through source control mistakes, local file disclosure, backups, or other tools reading the repository.

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 to extract a specific API key outside the normal settings framework, creating bespoke credential-access logic that is unnecessary for a JSON diff tool. In this context, custom secret-reading code increases suspicion and broadens opportunities for mishandling credentials.

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
Checking for and reading a local .env file as part of custom credential extraction contributes to unauthorized or unexpected secret handling in a skill that should not need credentials for its stated purpose. The danger is contextual: users may install a JSON tool without expecting local secret files to be inspected.

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
This function is explicitly dedicated to saving an API key into a plaintext .env file, which is a sensitive-secret persistence mechanism not justified by the stated JSON comparison functionality. Plaintext local storage can lead to accidental disclosure through repository commits, file sharing, or compromised local environments.

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
92% confidence
Finding
The helper advertises setting and persisting an API key to .env as a first-class capability, reinforcing that this skill is designed to manage credentials unrelated to its declared purpose. In a JSON comparison tool, such hidden credential workflows are unexpectedly invasive and increase the risk of secret exposure.

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
94% confidence
Finding
The dependency is specified with a lower bound only, so installs may resolve to different versions over time. This weakens reproducibility and can unintentionally introduce vulnerable or breaking releases through normal dependency resolution or supply-chain compromise.

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
94% confidence
Finding
Using an unpinned version for pydantic makes builds non-reproducible and allows future package releases to be pulled in automatically. In a security-sensitive agent environment, this increases supply-chain risk and makes it harder to guarantee reviewed 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
94% confidence
Finding
A minimum-version-only specifier permits later versions to be installed without review, creating reproducibility and supply-chain integrity issues. While not immediately exploitable by itself, it can enable vulnerable or malicious dependency versions to enter deployments.

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
94% confidence
Finding
python-dotenv is not pinned, so deployments may resolve different versions at different times. This increases the chance of unintentionally consuming a vulnerable release and complicates incident response and reproducibility.

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
97% confidence
Finding
The requirement allows requests 2.31.0, and static analysis identifies that version as having multiple known advisories. Because this skill is an MCP/AI tool likely to process external inputs and potentially make HTTP requests, a vulnerable HTTP client library is more relevant than in an offline-only utility.

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
89% confidence
Finding
The allowed version range includes python-dotenv 1.0.1, which is reported as vulnerable to symlink-following behavior in set_key that could enable arbitrary file overwrite in certain usage patterns. The impact is lower here because a JSON comparison tool may not exercise dotenv file mutation paths, but the vulnerable version is still unnecessarily permitted.

Static analysis

No suspicious patterns detected.