InstructLab Remote Code Execution Vulnerability via Malicious HuggingFace Models

Vulnerability

A remote code execution vulnerability exists in InstructLab, specifically within the 'linux_train.py' script, which improperly hardcodes 'trust_remote_code=True' when loading models from HuggingFace. This flaw allows remote attackers to execute arbitrary Python code by persuading users to run 'ilab train/download/generate' with a malicious model sourced from the HuggingFace Hub. The vulnerability could lead to complete system compromise.

Impact

Exploitation of this vulnerability allows for arbitrary code execution on the affected system, potentially leading to a full system compromise.

Reproduction

To reproduce this vulnerability, a user must have a free HuggingFace account and access to InstructLab. The vulnerability can be triggered by running the 'ilab train/download/generate' command with a model that has been crafted to include malicious code. The 'linux_train.py' script will execute the harmful code due to the 'trust_remote_code=True' setting, allowing the attacker to execute arbitrary Python code on the user's system.

Remediation

Users are advised to only use models from trusted sources when working with InstructLab. It is important to review the origin and integrity of any HuggingFace model before using it with the 'ilab train/download/generate' command. Consider executing InstructLab commands in a sandboxed or isolated environment to mitigate the risks of running untrusted code.

Added: Apr 22, 2026, 2:19 PM
Updated: Apr 22, 2026, 2:19 PM

Vulnerability Rating

Custom Algorithm
spread
0.0
impact
7.5
exploitability
4.0
remediation
0.0
relevance
6.5
threat
1.6
urgency
2.9
incentive
0.0

Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.