Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't use pickle to share weights #102

Open
unrealwill opened this issue Jul 19, 2021 · 3 comments
Open

Don't use pickle to share weights #102

unrealwill opened this issue Jul 19, 2021 · 3 comments

Comments

@unrealwill
Copy link

Hello,
Afaik pickle isn't safe from a security standpoint and expose your user to arbitrary code execution when they download what's supposed to be safe weights.

For example https://thisbeachdoesnotexist.com/ offer to download some pretrained model using your architecture.
But there is no way I'll trust a random website to run code, so I can't use their pretrained model.

Thanks.

@johndpope
Copy link

You could use docker as a shield to the OS.
or
https://github.com/CensoredUsername/picklemagic

@unrealwill
Copy link
Author

I'm not in a developer role, I'm in a user role : I just want to run NVLabs' code with untrusted weights downloaded from the internet, to produce pretty images.

Running NVLabs' code :
python generate.py --outdir=out --trunc=1 --seeds=0-35 --class=1 --network=any-untrusted-weight.pkl

Should not compromise my machine or my network ever, and I shouldn't need to protect against using a pseudo jail like docker.

So NVLabs need to take an action, not me or any other user.

I'd advise NVLabs against using CensoredUsername's picklemagic unless they fully audit it first and forever.

@vsemecky
Copy link

I understand your concern, but...

  1. Both StyleGan2-Ada and ThisBeachDoesNotExist.com are for research purposes only, not for end-users, so perhaps they don't deal with security that much.
  2. PKL format is nothing but a serialized data structure. You can easily look inside the pkl file and verify that there is no malicious code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants