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
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).
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.