Back to skill

Security audit

hantek-scope-control

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent oscilloscope-control reference skill with disclosed local USB/PyVISA use and no hidden execution or persistence.

Install the Python dependencies in a dedicated virtual environment and prefer pinned, reviewed package versions when possible. Expect the skill to help send SCPI commands to a connected oscilloscope, including settings changes, so review commands before applying them to live or powered equipment.

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:43
Finding

Unpinned Third-Party Dependencies Installed from an Unverified Package Source

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 43-45
Vulnerability Type: Supply-chain exposure through unpinned Python dependencies
Risk Level: Medium

Vulnerable Code Snippet:

sh
python -m pip install pyvisa pyvisa-py pyusb

Technical Analysis

The installation command retrieves three third-party packages without specifying reviewed versions, cryptographic hashes, a lock file, or an expected package index. Consequently, the installed components may change between executions, and package authenticity is determined entirely by the user's active pip configuration and package source.

Python package installation can execute package build backends or other installation-time code. A compromised package release, malicious package-index mirror, or substituted dependency could therefore execute attacker-controlled code during installation. The referenced package names are not alleged to be malicious; the finding concerns the unsafe and non-reproducible dependency installation process.

Attack Path

  1. An attacker compromises a referenced package release or causes the victim's pip configuration, DNS, proxy, or package mirror to resolve a package name to an attacker-controlled artifact.
  2. The user follows the documented command without version or hash verification.
  3. pip downloads the substituted or compromised package and invokes its installation or build process.
  4. Attacker-controlled installation code executes with the privileges of the user running pip.
  5. The payload may access user-readable files, credentials, network resources, and connected USB instruments, or modify files writable by that user.

Impact Assessment

Successful exploitation provides code execution under the account that runs the installation command. The accessible scope includes that user's files, environment variables, development credentials, network permissions, Python environment, and connected devices expos ...[truncated 326 chars]

Remediation
View remediation

Remediation Suggestions

  1. Replace the ad hoc installation command with a reviewed requirements file containing exact versions.

  2. Generate and publish cryptographic hashes for every direct and transitive dependency.

  3. Require hash validation during installation, for example:

    sh
    python -m pip install --require-hashes -r requirements.txt
    
  4. Document the expected official package index and avoid untrusted extra indexes or mirrors.

  5. Recommend creating a dedicated virtual environment before installation to limit unintended changes to the system Python environment.

  6. Periodically review and update pinned versions through a controlled process that includes vulnerability scanning and compatibility testing.

  7. Validate downloaded artifacts and retain the lock file or requirements file in the audited project so installations remain reproducible.

Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • 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