mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
e0e01f6c50
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`. |
||
---|---|---|
.. | ||
app | ||
assets | ||
backend | ||
configs | ||
frontend | ||
version | ||
__init__.py | ||
README |
Organization of the source tree: app -- Home of nodes invocations and services assets -- Images and other data files used by InvokeAI backend -- Non-user facing libraries, including the rendering core. configs -- Configuration files used at install and run times frontend -- User-facing scripts, including the CLI and the WebUI version -- Current InvokeAI version string, stored in version/invokeai_version.py