Back to skill

Security audit

数学计算协议服务

Security checks for vulnerabilities and agentic risk

Overview

This math skill is a remote API wrapper that asks for and stores an API key, while its public description and many tool docs can make it look more local than it is.

Install only if you are comfortable sending math expressions, datasets, financial scenarios, and batch-operation contents to the xiaobenyang remote service and storing the API key in a local plaintext .env file. Avoid using it for confidential formulas or business data, use an isolated workspace, and revoke or rotate the API key after testing.

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

Lp3

Medium
Category
MCP Least Privilege
Confidence
97% confidence
Finding
The skill declares itself as a math service but its instructions reveal undeclared capabilities to read environment variables, write a local .env file, and make outbound network calls. Hidden privilege requirements reduce transparency and prevent proper user consent or sandboxing, which is dangerous even if the immediate purpose is only API-backed computation.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
This is a strong description-behavior mismatch: the skill presents itself as a local high-performance math server, but documentation shows it acts as a remote proxy that stores credentials and forwards requests to an external service. Users may disclose sensitive inputs under the assumption computations are local, when in fact data and secrets are sent off-platform.

Description-Behavior Mismatch

High
Confidence
98% confidence
Finding
Requiring an external API key for a purported math computation skill indicates the service is not self-contained and that user requests will be relayed to a third party. In this context, the mismatch is especially risky because users may submit proprietary formulas, financial data, or datasets without realizing they are being transmitted externally.

Intent-Code Divergence

Medium
Confidence
87% confidence
Finding
The workflow claims the code only routes API calls, yet the documentation advertises many local-library-backed tools and behavior that does not align with that claim. This inconsistency impairs security review and can conceal the true execution boundary, making it harder to assess where user data is processed and which dependencies are trusted.

Description-Behavior Mismatch

High
Confidence
99% confidence
Finding
The project structure and API-key source reference an unrelated xiaobenyang/gaokao service, which strongly suggests this skill is repurposed or misbranded. That increases the chance of accidental data disclosure to an unexpected backend and undermines trust in the origin, scope, and handling of user inputs and credentials.

Description-Behavior Mismatch

Medium
Confidence
95% confidence
Finding
该文件实现的是一个可向任意配置上游端点发送请求的通用 API 客户端,而不是受限于本地数学计算的专用逻辑。对一个宣称为“数学计算”的技能而言,这种能力扩大了信任边界:调用参数、工具名和 mcp_id 都可被转发到外部服务,形成与技能描述不一致的数据外传和能力扩张风险。

Context-Inappropriate Capability

Medium
Confidence
93% confidence
Finding
代码在 49–79 行直接构造并发送外部 HTTP 请求,具备独立的网络调用与请求转发能力,这超出了“数学计算”这一用途的直接必要范围。若上层允许用户影响 tool_name、params 或相关配置,技能可被当作通用网络代理/数据转发器使用,增加数据泄露与越权调用面。

Description-Behavior Mismatch

High
Confidence
99% confidence
Finding
该配置模块与宣称的“数学计算协议服务”明显不一致,实际包含面向“小笨羊高考”外部服务的 API 标识与凭据管理逻辑。这种能力扩大了技能的数据访问与外联边界,可能让一个看似数学工具的技能在部署环境中读取、存储并使用外部服务凭据,增加隐蔽数据访问与供应链风险。

Context-Inappropriate Capability

Medium
Confidence
94% confidence
Finding
代码提供了将 API key 持久化到 .env、同步到进程环境并更新全局配置的完整凭据管理能力,这超出了纯数学计算服务的直观必要范围。即使没有直接外传逻辑,这种设计也会在宿主环境中长期保留敏感凭据,扩大误用、泄露和后续代码滥用的可能性。

Intent-Code Divergence

High
Confidence
98% confidence
Finding
类文档字符串明确写着“⼩笨羊高考Skill配置”,与技能宣称的“数学计算协议服务”用途矛盾,表明代码可能被挪用、混入了无关业务,或存在伪装行为。在安全评估中,这种用途不一致会显著提高对隐藏功能、越权访问和供应链污染的怀疑。

Description-Behavior Mismatch

Medium
Confidence
95% confidence
Finding
The skill is presented as a local/high-performance math computation server, but every tool is a thin wrapper around call_api() to a remote service. This mismatch is security-relevant because users and downstream agents may make trust, privacy, latency, and availability assumptions that are false, causing sensitive formulas, financial inputs, or datasets to be transmitted off-box unexpectedly.

Intent-Code Divergence

Medium
Confidence
93% confidence
Finding
The docstrings repeatedly say functions 'evaluate', 'compute', or 'perform' calculations directly, but the implementation only serializes arguments and forwards them to another service. That deceptive abstraction can mislead users, reviewers, and calling agents about where code runs and where user-supplied data goes, increasing the risk of unauthorized disclosure and unsafe integration decisions.

Missing User Warnings

Medium
Confidence
97% confidence
Finding
此处会把 API key(XBY-APIKEY)和请求参数一起发送到外部 endpoint,但本文件中没有任何用户可见的告知、同意或数据最小化控制。对于可能承载用户输入的数学技能,这意味着用户提供的数据会被静默传输到第三方服务,带来隐私、合规和凭据滥用风险。

Missing User Warnings

Medium
Confidence
89% confidence
Finding
User-supplied expressions, variables, arrays, financial data, and other inputs are sent over the network via call_api() without any disclosure in this file that data leaves the local environment. In a math skill, users may submit sensitive proprietary models, financial scenarios, or internal datasets, so hidden data egress materially increases confidentiality risk even if the remote API is legitimate.

Ssd 3

Medium
Confidence
96% confidence
Finding
The skill explicitly instructs the agent to ask the user for an API key and persist it via configuration without any guidance on secrecy, scope, rotation, masking, or safer alternatives. Prompting for secrets inside the conversational flow and storing them locally increases the risk of accidental exposure in logs, transcripts, shared environments, or insecure local files.

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
model_post_init 中强制打开并读取 .env,专门提取 XBY_APIKEY,说明代码显式访问本地凭据文件。对于一个数学计算技能,这种主动凭据读取与其声明能力不匹配,会增加未经预期的秘密接触面,并为后续调用外部服务提供基础。

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
对 .env 文件存在性检查后继续读取内容,是显式凭据访问流程的一部分。结合上下文可见其目标是提取 XBY_APIKEY,这使技能具备接触和消费本地秘密的能力,而该能力与数学计算服务上下文不相称,因此风险更高。

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
save_api_key_to_env 明确实现了对 .env 的读取、修改和写回,属于主动处理和持久化凭据。对一个数学计算技能而言,这种秘密落盘能力会增加凭据长期驻留、误提交到仓库、备份泄漏或被其他组件读取的风险。

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
set_api_key 提供了对 API key 的设置与持久化入口,使调用方可在运行时写入秘密并改变全局状态。该接口降低了凭据被滥用或被非预期代码路径植入的门槛,尤其在一个本应仅执行数学计算的技能中显得不必要且危险。

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 range (`requests>=2.31.0`) rather than a pinned version, which makes builds non-reproducible and can unexpectedly pull in newly released packages with breaking changes or malicious upstream compromise. In a service package, dependency drift increases supply-chain risk because the installed version may vary across environments and over time.

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
93% confidence
Finding
Using `pydantic>=2.7.0` allows any newer release to be installed, reducing reproducibility and exposing deployments to unreviewed upstream changes. While not an exploit by itself, this is a genuine supply-chain hardening weakness that can increase operational and security risk.

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
93% confidence
Finding
The version specifier `pydantic-settings>=2.2.0` permits uncontrolled upgrades, which can introduce security regressions or malicious package compromise into future installations. For a protocol service component, deterministic dependency resolution is important for both security review and reliable deployment.

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>=1.0.1` is unpinned, so future installs may resolve to different versions without review, increasing supply-chain and reproducibility risk. This is especially relevant because dotenv libraries can affect configuration loading and secrets handling behavior across environments.

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
89% confidence
Finding
The requirements allow installation of `requests` 2.31.0, a version identified with multiple advisories, so the package set can resolve to a known vulnerable release. In a network-capable service, flaws in `requests` can matter more because malicious URLs, redirect handling, credential leakage, or session verification issues may be reachable depending on how HTTP functionality is used elsewhere in the skill.

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
84% confidence
Finding
The dependency set permits `python-dotenv` 1.0.1, which is reported as affected by a symlink-following arbitrary file overwrite issue in `set_key`. This is only dangerous if the skill uses the vulnerable write path on attacker-influenced files, but as a dependency-level issue it remains a real risk that should be removed.

Static analysis

No suspicious patterns detected.