Back to skill

Security audit

CodeByteLens — 代码智能分析镜

Security checks for vulnerabilities and agentic risk

Overview

This is a local code-analysis helper with inaccurate documentation and an unnecessary unpinned setup command, but I found no hidden persistence, data exfiltration, or destructive behavior.

Before installing, treat this as a small local Python AST/ripgrep helper, not a full pyright or tree-sitter code-intelligence system. Use a virtual environment if installing pyright, prefer pinned dependencies, and expect Chinese-only output plus incomplete/broken define and call-analysis behavior.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T08 · Insecure Dependencies

Warning
Location
SKILL.md:27
Finding

Unpinned Third-Party Dependency Installation

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:27
Vulnerability Type: Unpinned dependency installation from a mutable package index
Risk Level: Medium

Vulnerable Code Snippet:

bash
# Install dependencies
pip install pyright  # Python type checking

Technical Analysis

The setup documentation instructs users to install pyright without specifying an audited version, verifying cryptographic hashes, using a lockfile, or constraining the package index. Consequently, the package and its transitive dependency set may change between installations.

This does not establish that the current pyright package is malicious. However, it creates a supply-chain exposure: if the configured package index, a future package release, or a transitive dependency is compromised, following the documented installation command could introduce attacker-controlled code. Python packages may execute code during installation or later when imported or invoked.

The risk is amplified when users run the command globally or from a privileged shell. The implementation currently does not invoke pyright, making the documented dependency installation unnecessary for the reviewed functionality.

Attack Path

  1. An attacker compromises a future dependency release, a transitive dependency, or the package source selected by the user's pip configuration.
  2. A user follows the setup instructions and runs pip install pyright.
  3. Pip resolves the unconstrained current package and dependency versions from the configured index.
  4. The compromised artifact is installed and may execute attacker-controlled installation or runtime behavior with the privileges of the user running pip.
  5. The attacker can affect files, credentials, and processes accessible to that account and can persist within the affected Python environment.

Impact Assessment

Successful exploitation could execute arbitrary code with the privileges of the accoun ...[truncated 440 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove the pyright installation requirement unless the Skill actually implements and invokes pyright-based analysis.
  2. If the dependency is required, pin it to a reviewed exact version, for example:
    bash
    python3 -m pip install --require-hashes -r requirements.txt
    
  3. Maintain a lockfile or requirements file containing exact versions and cryptographic hashes for all direct and transitive dependencies.
  4. Install dependencies in a dedicated virtual environment rather than globally:
    bash
    python3 -m venv .venv
    .venv/bin/python -m pip install --require-hashes -r requirements.txt
    
  5. Document the expected package index and prevent unintended index substitution or dependency confusion where operationally appropriate.
  6. Periodically review pinned versions and hashes, and update them through a controlled dependency-review process.
  7. Advise users not to perform package installation with administrator or root privileges.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (8)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The skill description materially overstates what the implementation does, including claims about tree-sitter, pyright, and call analysis that are not actually present. In a security-sensitive agent ecosystem, this can mislead users and reviewers into trusting analysis coverage that does not exist, causing unsafe decisions based on incomplete or inaccurate results.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The manifest description and introductory text are written entirely in Chinese, which indicates a fixed language experience for the skill. The file does not offer users an opt-in language choice or explain that the skill is intentionally region- or locale-specific, so this appears to violate the language/locale policy criteria.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file's natural-language descriptions and all user-facing CLI messages are written in Chinese, which imposes a specific language on users without opt-in or alternative locale support. This is a language-policy issue because the script does not provide a way for users to select their preferred language.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/analyze.py (reported line 131)May include surrounding context.

python
for pattern in patterns:
        try:
            result = subprocess.run(
                ['rg', '-n', '--color=always', pattern, str(path)],
                capture_output=True, text=True, timeout=10
            )

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
97% confidence
Finding

The manifest describes the toolbox as using ripgrep, pyright, and tree-sitter for AST parsing, but this file's own module docstring and implementation rely on Python's standard-library ast module for parsing and symbol extraction. This is a direct description-versus-behavior mismatch about the core analysis mechanism, even though the overall purpose remains code analysis.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

The module docstring presents the tool as an implementation using ast, pyright, and ripgrep, implying those tools underpin the toolbox. In practice, symbol and complexity analysis are ast-based, ripgrep is only used for one search path, and the 'calls' command explicitly states pyright-based call analysis is not yet implemented at L231-L233, so the documentation overstates what the code currently does.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

The script invokes an external command using subprocess.run to execute ripgrep against a user-supplied path. While this is part of the search feature, there is no explicit disclosure in the code near the operation that an external program will be launched, which can matter in constrained or audited environments.

Content

No source excerpt is available for this finding.