Skip to content
RCE Disclosed report Intermediate CVE-2024-12029

InvokeAI Deserialization of Untrusted Data vulnerability

A remote code execution vulnerability exists in InvokeAI versions 5.3.1 to 5.4.2 because the /api/v2/models/install endpoint deserialises model files with torch.load without validation. An attacker can embed malicious code in a model file, which executes when the file is loaded.

invoke-ai/invokeai

Originally disclosed on huntr

Critical View original

A remote code execution vulnerability exists in invoke-ai/invokeai versions 5.3.1 through 5.4.2 via the /api/v2/models/install API. The vulnerability arises from unsafe deserialization of model files using torch.load without proper validation. Attackers can exploit this by embedding malicious code in model files, which is executed upon loading. This issue is fixed in version 5.4.3rc2.

From the GitHub Advisory Database (GHSA-mcrp-whpw-jp68, CC BY 4.0).

The original report as published on the GitHub Advisory Database. Images and videos are our own copies; raw HTML is shown as text. View it on GitHub Advisory Database.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Impact

An attacker could execute arbitrary code on the server hosting InvokeAI.

What the attacker needed

Access to the /api/v2/models/install endpoint; ability to supply a malicious model file

The fix

The issue was fixed in version 5.4.3rc2.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

When a program loads a file, it sometimes rebuilds objects from the file's data. If that rebuilding is not careful, the file can contain instructions that run code on the server. Here, a model file uploaded to InvokeAI could run harmful code on the machine.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

More from invoke-ai/invokeai

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.