T08 · Insecure Dependencies
- 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: MediumVulnerable Code Snippet:
sh python -m pip install pyvisa pyvisa-py pyusbTechnical 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
- 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.
- The user follows the documented command without version or hash verification.
- pip downloads the substituted or compromised package and invokes its installation or build process.
- Attacker-controlled installation code executes with the privileges of the user running pip.
- 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
-
Replace the ad hoc installation command with a reviewed requirements file containing exact versions.
-
Generate and publish cryptographic hashes for every direct and transitive dependency.
-
Require hash validation during installation, for example:
sh python -m pip install --require-hashes -r requirements.txt -
Document the expected official package index and avoid untrusted extra indexes or mirrors.
-
Recommend creating a dedicated virtual environment before installation to limit unintended changes to the system Python environment.
-
Periodically review and update pinned versions through a controlled process that includes vulnerability scanning and compatibility testing.
-
Validate downloaded artifacts and retain the lock file or requirements file in the audited project so installations remain reproducible.
-
