Skip to content

Files

Latest commit

 

History

History
13 lines (7 loc) · 511 Bytes

B614.md

File metadata and controls

13 lines (7 loc) · 511 Bytes

Pattern: Unsafe use of PyTorch

Issue: -

Description

Using torch.load with untrusted data can lead to arbitrary code execution, and improper use of torch.save might expose sensitive data or lead to data corruption.

A safe alternative is to use torch.load with the safetensors library from hugingface, which provides a safe deserialization mechanism.

Further Reading