-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Set weights_only=True when using torch.load() #12366
Conversation
The default behavior of torch.load() uses `pickle` to deserialize data, which is known to be insecure when used with untrusted data sources. vLLM used torch.load() with data pulled from potentially untrusted sources (huggingface). This could potentially allow malicious code execution on a machine that tried to run a malicious or compromised model using vllm. Fixes GHSA-rh4j-5rhw-hr54. Thank you to @DogeWatch for the report. Signed-off-by: Russell Bryant <[email protected]>
👋 Hi! Thank you for contributing to the vLLM project. Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging. To run CI, PR reviewers can do one of these:
🚀 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @russellb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems reasonable. FYI this will become the default behavior in upcoming torch 2.6 https://dev-discuss.pytorch.org/t/bc-breaking-change-torch-load-is-being-flipped-to-use-weights-only-true-by-default-in-the-nightlies-after-137602/2573
Yeah, I was looking at that earlier and hoping it had already made it out into a release. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool
Signed-off-by: Russell Bryant <[email protected]>
The default behavior of torch.load() uses
pickle
to deserializedata, which is known to be insecure when used with untrusted data
sources. vLLM used torch.load() with data pulled from potentially
untrusted sources (huggingface). This could potentially allow
malicious code execution on a machine that tried to run a malicious or
compromised model using vllm.
Fixes GHSA-rh4j-5rhw-hr54.
Thank you to @DogeWatch for the report.
Signed-off-by: Russell Bryant [email protected]