Settings

Theme

How Pickle Files Backdoor AI Models

jchandra.com

6 points by jchandra 9 months ago · 7 comments

Reader

compressedgas 9 months ago

Pickle can be made safe. Just limit what the unpickler can call to a fixed list based on what is expected and permitted for the pickle to use.

vivahir215 9 months ago

Nice read !

You could also use joblib format as well.

  • jchandraOP 9 months ago

    joblib is not fully secure because it still relies on Pickle internally. The reason it is slightly better in pickle is due to fact that pickle file gets immediately executed when it gets imported whereas joblib doesn’t execute code just by being imported.

    • vivahir215 9 months ago

      ah okay. Didnt know this. I generally use pytorch save models for my workflow.

      • jchandraOP 9 months ago

        pytorch save/load still are pickle based models. Its fine for trusted sources but when you start using from untrusted sources then there is always a risk of ACE. If you want to execute it, would suggest to try it in a sandbox env like docker, VM or online notebooks envs or other option is to inspect the model file.

        As Open source AI booms, the risk of supply chain attacks also increases.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection