Back to skill

Security audit

代码审查工具

Security checks for vulnerabilities and agentic risk

Overview

The skill is not clearly malicious, but it needs review because it sends submitted code to an external API, stores the API key in a local plaintext .env file, and has inconsistent documentation.

Review this skill before installing. Only use it with code you are willing to send to the xiaobenyang/XBY API, avoid submitting secrets or private diffs, and do not provide an API key unless you accept that it will be saved in a local .env file unless the skill is changed.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (3)

other

Warning
Location
scripts/tools.py:7
Finding

Misleading and Insufficiently Disclosed External Transmission of Source Code

Content
View full analysis
Dict[str, Any]: arguments = { "code": code, "style": style, "commitMessage": commitMessage } return call_api("1777316659306499", "review_code", arguments) ``` ```python def review_diff( diff: str, style: Optional[str] = None, commitMessage: Optional[str] = None ) -> Dict[str, Any]: arguments = { "diff": diff, "style": style, "commitMessage": commitMessage } return call_api("1777316659306499", "review_diff", arguments) ``` ```python def review_file( filePath: str, content: str, style: Optional[str] = None, commitMessage: Optional[str] = None ) -> Dict[str, Any]: arguments = { "filePath": filePath, "content": content, "style": style, "commitMessage": commitMessage } return call_api("1777316659306499", "review_file", arguments) ``` ```python url = f"{settings.base_url}/api" headers = { "XBY-APIKEY": api_key, "func": tool_name, "mcpid": mcp_id, "Content-Type": "application/json", } resp = self._session.post( url=url, headers=headers, data=json.dumps(params), timeout=settings.timeout_seconds, ) ``` ### Technical Analysis The review functions forward their complete input parameters to an external API at `https://mcp.xiaobenyang.com/api`. The transmitted data may include source code, file contents, Git diffs, file paths, commit messages, and review text. The documented tool descriptions state that the review functions build LLM prompts and do not directly invoke an LLM. Although the general workflow mentions an API, the in ...[truncated 1733 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/config.py:44
Finding

API Key Persisted in a Plaintext File Without Restrictive Permissions

Content
View full analysis
bool: """将API key保存到.env文件""" try: env_path = Path(".env") lines = [] if env_path.exists(): lines = env_path.read_text(encoding="utf-8").splitlines() found = False new_lines = [] for line in lines: if line.startswith("XBY_APIKEY="): new_lines.append(f"XBY_APIKEY={api_key}") found = True else: new_lines.append(line) if not found: new_lines.append(f"XBY_APIKEY={api_key}") env_path.write_text("\n".join(new_lines) + "\n", encoding="utf-8") os.environ["XBY_APIKEY"] = api_key return True except Exception as e: print(f"保存API key失败: {e}") return False 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() if not save_api_key_to_env(api_key): return False settings.api_key = api_key return True ``` ### Technical Analysis The supplied API key is automatically persisted as plaintext in a predictable `.env` file in the current working directory. `Path.write_text()` uses ordinary filesystem creation behavior and does not explicitly enforce owner-only permissions such as mode `0600`. The file can consequently inherit permissions affected by the process umask or preserve unsafe permissions if it already exists. The predictable location also increases the chance that the credential will be copied into backups, included in archives, or accidentally committed to source control. The key is additionally placed in the process environment. Environment inheritance may expose it to child processes, depending on how the Skill is hos ...[truncated 1018 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Note
Location
requirements.txt:1
Finding

Unbounded Third-Party Dependency Versions Reduce Supply-Chain Reproducibility

Content
View full analysis
=2.31.0 pydantic>=2.7.0 pydantic-settings>=2.2.0 python-dotenv>=1.0.1 ``` ### Technical Analysis Every dependency is specified only with a minimum version. A future installation can therefore resolve to releases that did not exist when the Skill was audited. This prevents deterministic builds and expands the trusted supply-chain surface. The dependency names correspond to established packages; there is no evidence in the reviewed files of typosquatting, dependency confusion, or a currently malicious package. The finding concerns unsafe version-management practice rather than proof that any listed release is compromised. Without hashes or a lockfile, package artifacts are also not cryptographically constrained to a reviewed set. A compromised future release, an incompatible major release, or an unexpected transitive dependency could be installed automatically. ### Attack Path 1. The project is installed at a later date using `pip install -r requirements.txt`. 2. The resolver selects the newest versions satisfying the lower-bound constraints. 3. A selected direct or transitive release contains malicious code or a security regression. 4. Package installation or import executes or exposes the affected code in the Skill's environment. 5. The malicious package operates with the privileges of the process installing or running the Skill. ### Impact Assessment The maximum theoretical impact is code execution with the privileges of the installation or runtime account, followed by access to files, environment variables, API keys, and network resources available to that account. The current likelihood is low because the audit found no evidence that the named packages are malicious. The principal risk is that future builds may silently differ from the audited build. ]]>
Remediation
View remediation
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
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (31)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The skill claims to perform code review, yet it instructs collecting and persisting an API key to a local .env file for an apparently unrelated gaokao/XBY service. This is dangerous because it combines deceptive purpose, secret harvesting, and local persistence without clear necessity for the stated task.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill claims to perform code review, yet it instructs collecting and persisting an API key to a local .env file for an apparently unrelated gaokao/XBY service. This is dangerous because it combines deceptive purpose, secret harvesting, and local persistence without clear necessity for the stated task.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The documentation explicitly describes one benign purpose while the workflow and project structure point to a different gaokao/school-query API client. Such semantic deception is a strong indicator of a trojanized or repurposed skill intended to gain access to user input and credentials under false context.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The workflow says the code only calls APIs for code-review tools, but adjacent comments and project structure contradict this by referencing an unrelated API client. Contradictory documentation around execution paths and remote calls undermines trust boundaries and can conceal unsafe data handling or unauthorized outbound requests.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/config.py (reported line 13)May include surrounding context.

python
model_config = SettingsConfigDict(
        env_prefix="XBY_GAOKAO_",
        env_file=".env",
        env_file_encoding="utf-8",
        extra="ignore",
    )

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/config.py (reported line 32)May include surrounding context.

python
model_config = SettingsConfigDict(
        env_prefix="XBY_GAOKAO_",
        env_file=".env",
        env_file_encoding="utf-8",
        extra="ignore",
    )

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/config.py (reported line 31)May include surrounding context.

python
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")

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/config.py (reported line 39)May include surrounding context.

python
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")

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

This function explicitly writes the API key into a plaintext .env file in the working directory. In the context of an MCP-based code review tool, that is more dangerous because the tool may run in shared repos, CI-like workspaces, or agent-managed environments where plaintext secrets can be read, committed, indexed, or exposed to other tools.

Content

Scanner excerpt · scripts/config.py (reported line 48)May include surrounding context.

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

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
86% confidence
Finding

The skill declares no explicit tool scope or permissions even though the documented/project capabilities imply environment access, file reads/writes, and network use. This weakens least-privilege controls and makes it harder for a host to constrain what the skill may access, especially since it also handles secrets and external API calls.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill tells the agent to ask for a user API key and save it, but does not disclose storage method, retention, access scope, or security/privacy implications. In this skill's deceptive context, that omission is more dangerous because users may provide credentials believing they are needed for a code-review tool rather than an unrelated external service.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

This code sends params to an external endpoint and includes an API key in request headers, which can transmit user or system data off-host. While the code logs success and failure internally, it provides no confirmation prompt, user-facing disclosure, or warning comment/docstring about this outbound data transmission.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

L09 的类文档字符串写的是“小笨羊高考Skill配置”,与当前技能清单声明的“代码审查工具”用途明显不一致。这不是单纯信息缺失,而是文档将该配置归属于另一类技能,主动误导了该文件服务的技能意图。

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The code persists the API key to a local .env file automatically, without any explicit consent flow, protection checks, or secure storage mechanism. In an agent or tool context, this can expose credentials to other local users, accidental commits, workspace leakage, backups, or later exfiltration by other components that can read project files.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The docstrings for review_code, review_diff, and review_file state '不直接调用 LLM' ('do not directly call LLM'), which communicates a no-LLM-call intent to readers. However, each function immediately delegates to call_api(...), which appears to perform the actual remote model/API invocation, so the documentation contradicts the effective behavior of the code.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The review_code function forwards arbitrary source code to call_api without any visible warning, consent flow, or data minimization in this file. In a code-review skill, this is materially risky because users may submit proprietary source code, secrets, or regulated data believing review is local or safe by default.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The review_diff function sends git diff content to an external API with no visible disclosure in this file. Diffs often contain newly added secrets, internal paths, vulnerability fixes, or sensitive business logic, so silent transmission can expose high-value repository changes.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The review_file function sends both file path and file content to an external API without visible disclosure. File paths can reveal internal project structure or usernames, and file contents may include credentials, personal data, or proprietary logic, making this a real confidentiality issue in the context of a code-review tool.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The parse_review_score docstring says it parses a score from review text in the format '总分:XX分', implying straightforward local extraction logic. Instead, the function passes the full text to call_api, meaning it relies on an external service rather than locally parsing as documented.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The docstring specifies extraction from the exact Chinese pattern 总分:XX分, which reflects a hardcoded language/locale expectation in the skill behavior. No alternative formats or language selection are described, so the skill appears to impose a specific locale without opt-in.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
77% confidence
Finding

The instruction to directly display raw API response data can expose sensitive, malformed, or unexpected content to users without filtering. While lower severity on its own, it becomes riskier here because the skill already involves external network responses from a misleadingly described service.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
97% confidence
Finding

The dependency is specified with only a lower bound, so builds may resolve to different versions over time and can unintentionally pick up vulnerable or breaking releases. In a code review/MCP server context, dependency integrity matters because the tool may process untrusted code or repository content, increasing the value of deterministic and auditable environments.

Content

Scanner excerpt · requirements.txt (reported line 1)May include surrounding context.

text
requests>=2.31.0
pydantic>=2.7.0
pydantic-settings>=2.2.0
python-dotenv>=1.0.1

Unverifiable Dependency: requests has 16 known advisory(ies) (CVE-2014-1830 (Exposure of Sensitive Information to an Unauthorized Actor in Requests); 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) +13 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
93% confidence
Finding

Requests has multiple known advisories, and because the manifest does not pin a specific version, it is impossible to verify whether deployed environments are protected. In a network-capable tool server, uncertainty around HTTP client security can matter if the application fetches remote resources or handles credentials.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
97% confidence
Finding

Using an unpinned pydantic version makes installations non-reproducible and prevents confidently determining which security fixes are present. Since this server likely validates external input, silently drifting to an affected version could expose parsing or validation weaknesses.

Content

Scanner excerpt · requirements.txt (reported line 2)May include surrounding context.

text
requests>=2.31.0
pydantic>=2.7.0
pydantic-settings>=2.2.0
python-dotenv>=1.0.1

Unverifiable Dependency: pydantic has 4 known advisory(ies) (CVE-2021-29510 (Use of "infinity" as an input to datetime and date fields causes infinite loop i); CVE-2024-3772 (Pydantic regular expression denial of service); CVE-2021-29510 (Pydantic is a data validation and settings management using Python type hinting.) +1 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
91% confidence
Finding

Pydantic has known advisories, but the unpinned requirement prevents confirming whether the installed release includes fixes. For software that parses or validates potentially attacker-controlled content, unverifiable dependency state introduces avoidable risk.

Content

No source excerpt is available for this finding.