Back to skill

Security audit

代码安全扫描工具

Security checks for vulnerabilities and agentic risk

Overview

This appears to be a remote code security scanner, but it sends sensitive code and possible secrets to an external service and stores its API key in a local plaintext .env file with weak disclosure.

Install only if you are comfortable sending the code you scan, including possible embedded secrets, vulnerability details, and compliance context, to the XiaoBenYang remote API. Use a limited-scope API key, avoid scanning proprietary or regulated code unless your policy allows that provider, and remove or protect the local .env file after use.

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

Lp3

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding
The skill appears to require environment access, file read/write, and network use, yet it declares no permissions or equivalent safety boundaries. This creates a transparency and least-privilege problem: users and hosting platforms cannot accurately assess what the skill may access or modify, increasing the risk of unintended secret access, local file exposure, or unreviewed outbound transmission.

Description-Behavior Mismatch

High
Confidence
98% confidence
Finding
The documentation claims this is a code security scanning skill, but the workflow and project references include unrelated gaokao/school-search behavior. This inconsistency is dangerous because it undermines trust in the declared behavior and may indicate copy-paste drift or hidden/incorrect tool routing, causing the model to invoke unintended functions or mishandle user data in a security-sensitive context.

Intent-Code Divergence

High
Confidence
99% confidence
Finding
The inline example explicitly instructs calling a school-search function that does not belong to the declared security toolset. In an agent setting, contradictory instructions can cause incorrect tool invocation, data leakage to the wrong backend, or execution paths that bypass expected security review, especially when users submit sensitive source code for scanning.

Intent-Code Divergence

High
Confidence
97% confidence
Finding
The file’s identifiers and comments describe a different skill/domain (“小笨羊高考Skill”) and manage a separate service’s API key, which conflicts with the advertised purpose of a code security scanner. In a security-sensitive tool, hidden cross-purpose configuration strongly suggests code reuse or undisclosed secondary behavior, increasing the risk of secret collection or operator confusion.

Description-Behavior Mismatch

High
Confidence
95% confidence
Finding
The advertised skill is a code security scanner, but this file implements persistence and retrieval of a third-party business API key and remote service configuration unrelated to scanning logic. In the context of a security tool, this scope mismatch is dangerous because users may trust the skill with code review while it quietly manages credentials for another service.

Context-Inappropriate Capability

Medium
Confidence
93% confidence
Finding
This skill includes the ability to persistently set an arbitrary API key, which exceeds what is necessary for a local or narrowly scoped code scanning feature. Excess credential-handling capability broadens the attack surface and creates opportunities for misuse, leakage, or unexpected data exfiltration when embedded in a trusted developer tool.

Missing User Warnings

Medium
Confidence
92% confidence
Finding
The skill instructs the agent to collect a user API key and persist it via set_api_key without describing storage security, masking, retention, or consent. Because API keys are highly sensitive credentials, unclear handling can lead to accidental logging, insecure file storage, reuse across sessions, or disclosure to other components.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The skill tells the agent to directly present raw API response data to the user without filtering or sensitivity checks. Security scanning responses may contain secrets, source code fragments, file paths, stack traces, internal identifiers, or compliance metadata, so blindly exposing raw output can amplify data leakage rather than reduce it.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The code writes the API key to a local .env file and to the process environment without any warning, prompt, or disclosure to the user. Silent secret persistence is risky because .env files are often accidentally committed, exposed in backups, or read by other tools and subprocesses.

Missing User Warnings

Medium
Confidence
97% confidence
Finding
The scanCode function forwards arbitrary source code to an external API via call_api without any visible notice, consent flow, or data-minimization step in this file. Because source code may contain proprietary logic, internal endpoints, or embedded secrets, silent exfiltration to a third party creates a real confidentiality and compliance risk.

Missing User Warnings

Medium
Confidence
97% confidence
Finding
The vulnerability-scanning helper sends source code to an external service but this file exposes no warning, confirmation, or trust boundary information to the caller. In a developer tool, users may reasonably assume local analysis, so undisclosed transmission can leak sensitive code and internal security posture information.

Missing User Warnings

High
Confidence
99% confidence
Finding
The detectSecrets function is especially risky because it sends code that may already contain credentials, tokens, or private keys to an external API. That means the very data being searched for can be exposed to a third party, compounding the impact of any accidental secret inclusion and potentially violating internal handling requirements.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The secure-fix suggestion function transmits vulnerability details and surrounding context externally without visible disclosure. Vulnerability context can reveal exploitable weaknesses, architecture details, or sensitive snippets, making unauthorized or unexpected external sharing a meaningful security exposure.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The compliance-check function transmits both source code and compliance-related metadata to an external API with no visible disclosure in this file. This can expose regulated or customer-sensitive material and create legal or contractual issues if users are unaware that assessment data leaves their environment.

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
91% confidence
Finding
The code manually reads .env and forcibly extracts XBY_APIKEY, bypassing normal typed settings behavior and narrowing in on a credential value. In a skill whose stated purpose is unrelated to this external service, targeted secret loading is suspicious and increases the chance of unauthorized credential handling.

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 explicitly persists an API key to .env, creating a plaintext credential at rest in the working directory. Plaintext secret storage is dangerous because it can be exposed through source control mistakes, filesystem compromise, shared workspaces, or local tooling that indexes project files.

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
The function advertises persistent storage of an API key to .env, reinforcing a design that normalizes plaintext credential persistence inside a tool not described as a credential manager. In the context of a security-scanning skill, this mismatch makes the behavior more dangerous because users are more likely to trust it and overlook secret-handling side effects.

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 version constraint instead of an exact pinned version, which makes builds non-reproducible and can cause the environment to resolve to unexpectedly vulnerable or breaking releases over time. In a security scanning tool, supply-chain predictability is especially important because the tool may be deployed broadly in developer environments.

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
90% confidence
Finding
Using pydantic with only a minimum version allows future installs to pull different versions, reducing reproducibility and increasing supply-chain risk. While not an immediate exploit by itself, it weakens dependency control and can introduce vulnerable transitive behavior unexpectedly.

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
89% confidence
Finding
An unpinned pydantic-settings dependency permits uncontrolled upgrades, which can lead to inconsistent builds and accidental adoption of insecure or incompatible releases. For a security-focused tool, this undermines trust and repeatability of 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
91% confidence
Finding
The python-dotenv package is not pinned exactly, so installations may resolve to different versions across environments, increasing supply-chain and reproducibility risk. This is more concerning here because the same file also permits a version identified by the scanner as having a known advisory.

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 version range allows installation of requests 2.31.0, which has multiple published advisories including credential leakage and verification-related issues. If the tool performs network operations against attacker-influenced URLs or handles authentication, these flaws could expose secrets or weaken request security in developer environments.

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
86% confidence
Finding
The allowed python-dotenv version includes 1.0.1, which is reported to have a symlink-following issue in set_key that could allow arbitrary file overwrite in certain usage patterns. This is only exploitable if the application invokes the affected functionality on attacker-controlled paths, but it remains a real dependency risk.

Static analysis

No suspicious patterns detected.