InvokeAI/invokeai/backend/model_management
jeremy e0e01f6c50 Reduced Pickle ACE attack surface
Prior to this commit, all models would be loaded with the extremely unsafe `torch.load` method, except those with the exact extension `.safetensors`. Even a change in casing (eg. `saFetensors`, `Safetensors`, etc) would cause the file to be loaded with torch.load instead of the much safer `safetensors.toch.load_file`.
If a malicious actor renamed an infected `.ckpt` to something like `.SafeTensors` or `.SAFETENSORS` an unsuspecting user would think they are loading a safe .safetensor, but would in fact be parsing an unsafe pickle file, and executing an attacker's payload. This commit fixes this vulnerability by reversing the loading-method decision logic to only use the unsafe `torch.load` when the file extension is exactly `.ckpt`.
2023-03-13 16:16:30 -04:00
..
__init__.py fix call signature of import_diffuser_model() 2023-03-05 23:37:59 -05:00
convert_ckpt_to_diffusers.py Reduced Pickle ACE attack surface 2023-03-13 16:16:30 -04:00
model_manager.py Reduced Pickle ACE attack surface 2023-03-13 16:16:30 -04:00