CVE-2024-12029 Remote Code Execution via Model Deserialization in invoke-ai/invokeai

Critical 9.8 Published Updated

Attackers can execute arbitrary code by uploading malicious model files to the InvokeAI API due to unsafe deserialization.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2024-12029?

CVE-2024-12029 is a critical unsafe deserialization vulnerability in invoke-ai/invokeai, published on 20 Mar 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

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

Weakness: CWE-502

Which versions are affected by CVE-2024-12029?

3 open source packages ship an affected version, including invokeai and InvokeAI.

PackageAffectedFixed in
invokeai PyPIFrom 5.3.15.4.3rc1
invokeai PyPIFrom 5.3.15.4.3rc2
InvokeAI PyPIFrom 5.3.15.4.3rc2

How do I fix CVE-2024-12029?

Upgrade invokeai to a fixed version for your release line: 5.4.3rc1 or 5.4.3rc2.

Upgrade, and only deserialise data from trusted sources or with an allow-list of types. More about Unsafe deserialization.

Is CVE-2024-12029 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-12029 exists.

Public exploit code: 1 Metasploit module and 1 proofs of concept on GitHub.

Sources

Also known as GHSA-mcrp-whpw-jp68, PYSEC-2025-9.

Is CVE-2024-12029 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free