VYPR
Critical severity9.8NVD Advisory· Published Mar 20, 2025· Updated Apr 15, 2026

CVE-2024-12029

CVE-2024-12029

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.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
InvokeAIPyPI
>= 5.3.1, < 5.4.3rc25.4.3rc2

Patches

1
756008dc5899

fix: Fail scan on InvalidMagicError in picklescan, update default for read_checkpoint_meta to scan unless explicitly told not to

https://github.com/invoke-ai/invokeaiBrandon RisingNov 25, 2024via ghsa
3 files changed · +4 4
  • invokeai/app/services/model_load/model_load_default.py+1 1 modified
    @@ -86,7 +86,7 @@ def load_model_from_path(
     
             def torch_load_file(checkpoint: Path) -> AnyModel:
                 scan_result = scan_file_path(checkpoint)
    -            if scan_result.infected_files != 0:
    +            if scan_result.infected_files != 0 or scan_result.scan_err:
                     raise Exception("The model at {checkpoint} is potentially infected by malware. Aborting load.")
                 result = torch_load(checkpoint, map_location="cpu")
                 return result
    
  • invokeai/backend/model_manager/probe.py+1 1 modified
    @@ -469,7 +469,7 @@ def _scan_model(cls, model_name: str, checkpoint: Path) -> None:
             """
             # scan model
             scan_result = scan_file_path(checkpoint)
    -        if scan_result.infected_files != 0:
    +        if scan_result.infected_files != 0 or scan_result.scan_err:
                 raise Exception("The model {model_name} is potentially infected by malware. Aborting import.")
     
     
    
  • invokeai/backend/model_manager/util/model_util.py+2 2 modified
    @@ -44,7 +44,7 @@ def _fast_safetensors_reader(path: str) -> Dict[str, torch.Tensor]:
         return checkpoint
     
     
    -def read_checkpoint_meta(path: Union[str, Path], scan: bool = False) -> Dict[str, torch.Tensor]:
    +def read_checkpoint_meta(path: Union[str, Path], scan: bool = True) -> Dict[str, torch.Tensor]:
         if str(path).endswith(".safetensors"):
             try:
                 path_str = path.as_posix() if isinstance(path, Path) else path
    @@ -55,7 +55,7 @@ def read_checkpoint_meta(path: Union[str, Path], scan: bool = False) -> Dict[str
         else:
             if scan:
                 scan_result = scan_file_path(path)
    -            if scan_result.infected_files != 0:
    +            if scan_result.infected_files != 0 or scan_result.scan_err:
                     raise Exception(f'The model file "{path}" is potentially infected by malware. Aborting import.')
             if str(path).endswith(".gguf"):
                 # The GGUF reader used here uses numpy memmap, so these tensors are not loaded into memory during this function
    

Vulnerability mechanics

Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

6

News mentions

0

No linked articles in our index yet.