Back to skill

Security audit

科学计算工具

Security checks for vulnerabilities and agentic risk

Overview

The skill is presented as a scientific calculator but appears to rely on a remote API, persistent API-key storage, and external tool proxying that users would not reasonably expect.

Install only if you are comfortable giving this skill an API key, storing that key locally in .env, and sending calculator inputs to an external service. For ordinary scientific calculations, prefer a local-only calculator skill unless the publisher clearly explains the remote service, data handling, and credential retention.

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

Lp3

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding
The skill declares itself as a simple scientific calculator, yet its documented structure includes environment access, file read/write, and network/API usage without corresponding permission transparency. This broad capability set increases attack surface and can mislead users and hosts about what the skill actually does.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
The documented behavior materially differs from the stated purpose: instead of local scientific computation, the skill requires an external API key, makes outbound requests, and proxies raw remote responses. This mismatch undermines informed consent and can hide sensitive data flows or unexpected remote dependence behind an innocuous calculator description.

Description-Behavior Mismatch

High
Confidence
98% confidence
Finding
Requiring an external API key for basic calculator functions is inconsistent with the claimed purpose and introduces unnecessary credential collection. For a low-risk local utility, this creates unjustified exposure of user secrets to a third-party service and raises the possibility of credential misuse or phishing-like behavior.

Description-Behavior Mismatch

High
Confidence
97% confidence
Finding
The workflow explicitly states that the code's role is to call APIs and return results, contradicting the claim that this is a standalone scientific calculator. This is dangerous because users may unknowingly send inputs and potentially sensitive data to external infrastructure under a misleading local-tool framing.

Description-Behavior Mismatch

Medium
Confidence
94% confidence
Finding
The instruction to directly display raw API response data confirms that outputs originate from a remote service rather than local computation. Returning raw data also increases the risk of exposing unexpected metadata, error details, or untrusted content from the external API to end users.

Context-Inappropriate Capability

High
Confidence
98% confidence
Finding
Mandatory collection and storage of an API key is not justified for a scientific calculator and creates an unnecessary secret-handling burden. Persisting user credentials for such a trivial function increases the risk of secret leakage, unauthorized reuse, or abuse if the storage or downstream service is compromised.

Context-Inappropriate Capability

Medium
Confidence
90% confidence
Finding
The project structure documents API client and configuration modules for a tool presented as basic scientific computation, indicating unnecessary external dependency and secret management. This expands the attack surface and suggests the skill's real behavior is broader than users would reasonably expect from a calculator.

Intent-Code Divergence

High
Confidence
96% confidence
Finding
The documentation presents the listed functions as ordinary calculation utilities, while elsewhere admitting they merely call external APIs and surface raw data. This inconsistency can conceal data egress and trust boundary crossings, making the skill more dangerous because the context suggests harmless local math operations.

Description-Behavior Mismatch

High
Confidence
97% confidence
Finding
This file implements a generic HTTP client that sends calculator inputs to an external upstream MCP API, which is inconsistent with a local scientific calculator's stated purpose. That creates an unnecessary data egress path and expands the trust boundary: user-supplied inputs and metadata are transmitted off-box to a remote service that could log, modify, or misuse them.

Context-Inappropriate Capability

High
Confidence
98% confidence
Finding
The code performs authenticated remote tool invocation using an API key and caller-controlled tool name/parameters, even though a scientific calculator should not need privileged upstream execution. This can turn a simple calculator into a proxy for external capability use, with risks including unauthorized data transfer, hidden remote processing, and abuse of stored credentials.

Description-Behavior Mismatch

High
Confidence
96% confidence
Finding
The file’s behavior and identifiers are materially inconsistent with the declared scientific calculator skill: it is configured for a remote MCP/high-school exam service and manages API credentials. This kind of scope mismatch is dangerous because it can conceal undeclared networked functionality and secret handling in a skill users would reasonably expect to be local-only.

Context-Inappropriate Capability

Medium
Confidence
91% confidence
Finding
A scientific calculator normally does not need persistent API-key storage or remote service configuration, so these capabilities expand the attack surface beyond user expectations. Even if not overtly malicious, hidden credential persistence and remote connectivity can enable unauthorized data flow, misuse of secrets, or deceptive repurposing of the skill.

Intent-Code Divergence

Medium
Confidence
89% confidence
Finding
The in-code comment identifies the component as a '高考Skill' rather than a scientific calculator, reinforcing that the package may be mislabeled or repurposed. Identity mismatches are a supply-chain trust issue because they can hide unexpected capabilities and make reviewers or users misjudge the risk profile.

Description-Behavior Mismatch

Medium
Confidence
95% confidence
Finding
The skill is presented as a scientific calculator, but every operation is proxied to an external API rather than performed locally. This creates an undisclosed data-flow boundary and unnecessary dependence on a remote service, which can expose user inputs, enable tracking, or allow remote tampering with results if the API or transport is compromised.

Context-Inappropriate Capability

Medium
Confidence
93% confidence
Finding
This file embeds broad external API communication capability inside a tool that appears to be a local computation utility, without any explanation in the code shown. Hidden network access in a low-risk-appearing skill increases the chance that users or integrators will pass sensitive data under the assumption it stays local.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The skill instructs collection and storage of an API key but does not warn users that the credential is sensitive, may persist in configuration, or could be reused for future requests. Lack of disclosure weakens informed consent and increases the likelihood of users providing secrets they would not otherwise share.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The request sends user parameters and the API credential to a remote endpoint without any visible user-facing notice or consent mechanism in the code. In the context of a calculator skill, that is unexpected behavior and can cause privacy and trust issues because users may assume calculations happen locally while their inputs are actually transmitted externally.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The code persists the API key into a local .env file without any visible warning, consent flow, or safeguards. This is dangerous because users may assume a transient configuration while the secret is actually written to disk, increasing the chance of accidental disclosure through backups, source control, or local compromise.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
User-supplied values are repeatedly forwarded to an external API with no visible warning, consent, or privacy notice in this file. Even if the inputs are usually numeric, functions like math_sqrt and complex_sqrt accept strings, which could include unexpected sensitive content and will still be transmitted externally.

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
79% confidence
Finding
The code explicitly and forcibly reads .env to extract XBY_APIKEY outside the normal settings abstraction, which is more intrusive than standard configuration loading. In the context of a mislabeled scientific calculator skill, direct secret extraction increases suspicion and risk because it handles credentials beyond the apparent functional need.

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
79% confidence
Finding
Creating a direct Path to .env and reading it as free-form text is part of the same unnecessary manual credential-access flow. This bypasses stronger abstractions and makes secret handling easier to misuse or extend for undeclared purposes.

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
92% confidence
Finding
The function is explicitly dedicated to saving an API key into .env, creating credential persistence on disk. In a skill presented as a scientific calculator, this is a meaningful security concern because it stores sensitive material in a predictable plaintext location without clear necessity or disclosure.

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
90% confidence
Finding
This function’s documented purpose is to set and persist an API key to .env, reinforcing intentional credential storage behavior. Persistent secret handling is risky in general, and especially suspicious in a skill whose declared purpose does not obviously require remote authenticated access.

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 uses a minimum-version specifier instead of an exact pin, so installs may resolve to different versions over time. This weakens build reproducibility and can unintentionally introduce vulnerable or incompatible releases through the supply chain.

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 pydantic>=2.7.0 allows future unresolved versions to be installed, which reduces reproducibility and increases supply-chain risk. A later release could introduce security regressions or breaking behavior without any change to this repository.

Static analysis

No suspicious patterns detected.