T08 · Insecure Dependencies
- Location
scripts/ligand_designer.py:21- Finding
Unpinned Third-Party Dependency Installation Guidance
- Content
View full analysis
Vulnerability Details
File Location:
scripts/ligand_designer.py, lines 21-27
Vulnerability Type: Unpinned third-party dependency and unsafe installation guidance
Risk Level: MediumVulnerable Code
python try: from rdkit import Chem from rdkit.Chem import AllChem, Descriptors, Draw, rdMolDescriptors, rdmolops from rdkit.Chem import RWMol except ImportError: print(json.dumps({"error": "RDKit not installed. Run: pip install rdkit", "status": "error"})) sys.exit(1)Technical Analysis
When RDKit is unavailable, the application recommends installing it with
pip install rdkit. This command does not pin a reviewed package version, verify artifact hashes, require a lockfile, or constrain resolution to a documented trusted package source.The application does not execute this command automatically, so exploitation requires a user or an automation agent to follow the emitted guidance. If followed, pip resolves the package and its transitive dependencies according to the mutable state of the configured package index. A compromised package release, dependency, package-index mirror, or local pip configuration could consequently introduce attacker-controlled code.
Python packages can execute code during installation and subsequently during import. The absence of version and integrity constraints therefore exposes the installation workflow to supply-chain compromise.
Attack Path
- RDKit is absent from the runtime environment.
- The user or automation agent invokes
ligand_designer.py. - The script emits the recommendation
pip install rdkit. - The user or agent executes that command without adding version, hash, or trusted-source restrictions.
- Pip resolves artifacts from its configured package index or mirror.
- An attacker who has compromised a resolved package, dependency, release, or configured index supplies a malicious artifact.
- Malicious code executes during package installation or when the ...[truncated 1053 chars]
- Remediation
View remediation
Remediation Suggestions
- Declare RDKit in a reviewed dependency manifest rather than presenting an unconstrained installation command.
- Pin RDKit and all transitive dependencies to approved versions.
- Use a lockfile or hash-verified requirements file, such as installation with
pip --require-hashes. - Document and enforce an approved package index or internal artifact repository.
- Verify downloaded package provenance and integrity before deployment.
- Replace the current message with guidance referencing the controlled installation procedure, for example:
python except ImportError: print(json.dumps({ "error": "RDKit is not installed. Install dependencies from the project's reviewed, hash-locked requirements file.", "status": "error" })) sys.exit(1)- Perform dependency vulnerability and provenance scanning in CI, and update pinned versions through a reviewed change-management process.
- Run dependency installation and the Skill under a least-privileged account in an isolated virtual environment or container.
