leggedrobotics / rsl_rl

Fast and simple implementation of RL algorithms, designed to run fully on GPU.
Other
656 stars 186 forks source link

torch.load in the runner will throw warning due to ACE security vuln #42

Open KyleM73 opened 1 month ago

KyleM73 commented 1 month ago

torch.load allows arbitrary code execution when the argument weights_only is set to False (default). The default value will switch to True in a future torch release. People wishing to get rid of the error (and eliminate the risk of ACE when loading files you did not train yourself) can change the torch.load call in the runner.load method to include the argument weights_only=True as a default.

Specifically:

def load(self, path, load_optimizer=True):
        loaded_dict = torch.load(path)

should become

def load(self, path, load_optimizer=True):
        loaded_dict = torch.load(path, weights_only=True)