T08 · Insecure Dependencies
- Location
scripts/setup_python_env.py:10- Finding
Unpinned Third-Party Package Is Installed and Upgraded Without Integrity Verification
- Content
View full analysis
Vulnerability Details
File Location:
scripts/setup_python_env.py:10-28; related dependency declarations atrequirements.txt:1,SKILL.md:92,127, andreferences/2d-pygcadwin-workflow.md:23-24
Vulnerability Type: Unverified and unpinned third-party dependency installation
Risk Level: MediumVulnerable Code
python PYPI_PACKAGE = 'pygcadwin' def run(cmd: list[str]) -> None: print("+", " ".join(cmd)) subprocess.check_call(cmd) def main() -> int: parser = argparse.ArgumentParser(description="Install skill Python packages from PyPI.") parser.add_argument( "--allow-network", action="store_true", help="Accepted for compatibility; this installer always uses PyPI.", ) parser.parse_args() run([sys.executable, "-m", "pip", "install", "--upgrade", PYPI_PACKAGE]) return 0The corresponding requirement also permits any future compatible release:
text pygcadwin>=0.1.0The workflow documentation recommends another unconstrained installation:
powershell pip install pygcadwinTechnical Analysis
The setup script invokes
pip install --upgrade pygcadwinagainst the public Python Package Index without pinning an exact reviewed version or validating package hashes. The requirements file only defines a lower bound, so later versions may be selected without further review.Python packages can execute code during installation through build backends and during subsequent imports. Consequently, the effective code executed by this Skill can change after the Skill itself has been audited. The unconditional
--upgradeoption increases exposure by replacing an already installed and potentially reviewed release with the newest available release.The
--allow-networkargument does not provide a security boundary. It is parsed but never checked, and the help text explicitly states that the installer always uses PyPI. Thus, running the setup script performs network-dependent ...[truncated 1935 chars]- Remediation
View remediation
Remediation Suggestions
-
Pin an audited release exactly instead of accepting arbitrary future releases:
text pygcadwin==0.1.0 -
Verify distribution integrity with hashes. Generate a locked requirements file containing hashes and install it using:
text python -m pip install --require-hashes -r requirements.lock -
Lock transitive dependencies so that all installed artifacts—not only the direct dependency—have reviewed versions and hashes.
-
Remove
--upgradefrom the normal installation path. Updating dependencies should be a deliberate maintenance operation followed by security review and testing. -
Enforce explicit network authorization. Either remove the misleading
--allow-networkargument or make installation fail unless it is supplied:python args = parser.parse_args() if not args.allow_network: parser.error("Network access requires --allow-network") -
Prefer a controlled package source for production use, such as an internal index containing reviewed artifacts. Configure pip to use only that index and disable unintended additional indexes.
-
Apply the same version constraint in every installation instruction, including
SKILL.mdandreferences/2d-pygcadwin-workflow.md, to prevent users from bypassing the lock through documented unconstrained commands. -
Run dependency update checks in an isolated environment and review package provenance, release signatures where available, artifact hashes, dependency changes, and runtime behavior before updating the lock file.
-
