Back to skill

Security audit

字符索引字符串处理工具

Security checks for vulnerabilities and agentic risk

Overview

This skill advertises simple string indexing but routes user text through a credentialed third-party API and persists an API key locally, so it needs review before installation.

Install only if you are comfortable giving this skill a Xiaobenyang API key, storing that key in a local .env file, and sending the text you process to the Xiaobenyang MCP API. Avoid using it with secrets, private code, personal data, or regulated data unless the publisher documents the backend, retention, and credential-handling practices clearly.

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

Lp3

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding
The skill declares itself as a simple string-index tool, but the documentation reveals capabilities to read environment variables, write files, and make network calls, all without any declared permission boundary. This expands the attack surface and weakens user awareness and platform controls, especially because the hidden capabilities include credential handling and external data transfer.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
The skill's stated purpose is local character-index string processing, but its documented behavior includes collecting an API key, persisting it to .env, and sending requests to a remote service. This mismatch can mislead users into granting secrets and approving networked behavior they would not expect from the advertised functionality.

Description-Behavior Mismatch

High
Confidence
98% confidence
Finding
Requiring an external API key and remote API usage for basic string indexing is disproportionate to the claimed function and suggests unnecessary collection of credentials and user data. In this context, the mismatch makes the skill more dangerous because users would reasonably expect deterministic local processing rather than secret collection and outbound requests.

Description-Behavior Mismatch

High
Confidence
95% confidence
Finding
The project structure references an unrelated external-service framework ('xiaobenyang_gaokao_skill'), indicating possible copy-paste reuse or repurposing inconsistent with the declared string-tool identity. This undermines trust in the skill's provenance and increases the risk of hidden behaviors or misrouted requests to unintended services.

Context-Inappropriate Capability

Medium
Confidence
94% confidence
Finding
Forcing users to provide and persist an API key for a simple string manipulation task violates data minimization and creates avoidable secret-handling risk. If compromised or mishandled, the key could be exposed through logs, prompts, local files, or downstream services.

Intent-Code Divergence

High
Confidence
88% confidence
Finding
The workflow example instructs the agent to call an unrelated function (`search_schools`) that does not belong to this skill's tool list, indicating documentation inconsistency and possible cross-skill confusion. Such confusion is dangerous because it can cause unintended tool invocation, accidental data disclosure to the wrong backend, or use of capabilities outside the user's expectations.

Description-Behavior Mismatch

High
Confidence
97% confidence
Finding
The file implements a generic outbound HTTP client that can invoke arbitrary remote MCP tools, which does not match the declared purpose of a character-index string processing tool. This capability expansion creates hidden remote-execution and data-exfiltration pathways, especially because callers can supply tool names and parameters that are forwarded upstream.

Context-Inappropriate Capability

High
Confidence
96% confidence
Finding
Outbound network access and remote tool execution are powerful capabilities that are unjustified by the stated string-processing function of the skill. In this context, the mismatch makes the behavior more dangerous because users and downstream systems may trust the skill as local-only text processing while it can actually transmit data to an external service and trigger remote actions.

Description-Behavior Mismatch

High
Confidence
98% confidence
Finding
该配置模块为宣称的“字符索引字符串处理工具”引入了与核心用途无关的外部服务地址、MCP 标识和 API key 读取/持久化能力,明显超出最小权限范围。对一个字符串处理技能而言,这类凭据管理会扩大攻击面,使技能具备接触和保留敏感凭据的能力,一旦被滥用可导致外部服务访问或凭据泄露。

Context-Inappropriate Capability

High
Confidence
97% confidence
Finding
代码不仅接收 API key,还会修改并持久化写入 .env,同时更新进程环境变量,使凭据在本地长期驻留。对于仅应处理字符串的技能,这种能力与功能声明不相称,意味着技能可以保存敏感凭据并在后续执行中继续使用,增加凭据泄露、误提交到版本控制或被其他组件读取的风险。

Intent-Code Divergence

Medium
Confidence
85% confidence
Finding
类文档字符串声称这是“高考Skill配置”,与当前技能元数据描述的字符串处理工具不一致,显示代码可能被复用、混入了其他项目逻辑或存在功能伪装。此类上下文不一致本身不等于直接利用链,但会显著降低可审计性,并提示存在未声明的能力,尤其与本文件中的凭据处理逻辑结合时更可疑。

Description-Behavior Mismatch

Medium
Confidence
96% confidence
Finding
The module is presented as a local character-index string processing utility, but it imports a generic API caller and forwards all operations to a remote service. This creates an unexpected trust boundary and can expose arbitrary user-provided text to an external system, which is risky for a tool whose stated function could be implemented entirely locally.

Context-Inappropriate Capability

Medium
Confidence
93% confidence
Finding
The call_api invocation gives this simple text utility unnecessary remote execution capability with no evident technical need for such basic operations. That increases attack surface, creates dependency on an opaque external service, and enables exfiltration of any text passed through the wrapper functions.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
Instructing the agent to display raw API return data directly to the user creates a risk of exposing secrets, internal identifiers, unexpected HTML/JSON fields, or maliciously crafted remote content. This is more dangerous here because the skill already depends on an external service and secret-based authentication, so the response surface is untrusted and potentially sensitive.

Missing User Warnings

Medium
Confidence
81% confidence
Finding
The code retrieves an API key and sends it as a request header to an external endpoint without any user-facing disclosure in this file. While using an API key is not inherently unsafe, the lack of transparency combined with hidden outbound communication increases the risk of unauthorized credential use and unexpected sharing of user-supplied data with a third party.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
函数会将敏感 API key 直接写入 .env,但没有明显的用户提示、确认步骤或安全说明。用户可能在不知情的情况下将凭据持久化到磁盘,进而被本地其他进程读取、被打包分发,或误纳入日志与代码仓库。

Missing User Warnings

Medium
Confidence
97% confidence
Finding
User-supplied text fields such as text, substring, markers, and regex patterns are packaged into arguments and sent to an API without any visible disclosure or consent flow. In a string-processing skill, users may reasonably expect local-only handling, so silent transmission can leak sensitive source code, secrets, or personal data.

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
95% confidence
Finding
`model_post_init` 明确强制打开 `.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
96% confidence
Finding
该函数专门实现将 API key 保存到 `.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
94% confidence
Finding
`set_api_key` 将设置凭据与持久化写入 `.env` 绑定,意味着任何调用该接口的代码路径都会导致敏感信息落盘。这样的 API 设计缺少安全分层,也不符合最小惊讶原则,特别是在当前技能上下文下更显不必要和危险。

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
92% confidence
Finding
The dependency is specified with a lower bound only, which allows future installs to resolve to different versions over time. This weakens reproducibility and can unintentionally pull in newly introduced vulnerable or breaking releases, increasing supply-chain 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
92% confidence
Finding
Using an unpinned pydantic version means builds are not deterministic and may silently consume newer releases. In security-sensitive tooling, this can expose the project to supply-chain issues or behavior changes without code changes in the repository.

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
91% confidence
Finding
An unpinned pydantic-settings dependency permits arbitrary newer compatible versions at install time. This increases the chance of pulling a compromised, vulnerable, or incompatible release and reduces auditability.

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 python-dotenv dependency is not pinned, so environment setup may vary across installations and time. Because configuration-loading libraries often handle sensitive data paths and secrets, uncontrolled upgrades increase operational and supply-chain risk.

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
95% confidence
Finding
The requirements allow installation of requests 2.31.0, which is associated with published advisories including credential leakage via malicious URLs and request verification issues in Session usage. Even though the file uses a '>=' specifier rather than exact pinning, the vulnerable version remains in the allowed range, so affected environments could resolve to or retain that version.

Static analysis

No suspicious patterns detected.