Closed
Description
🐛 Describe the bug
In torch.jit.annotations
, it looks like there are some functions that are deprecated, but still retain code, which may lead to some backdoors, especially since some of these functions still use eval while implementing.
But now I'm not sure if there are some features (jit decorator) in some version of pytorch are still using this function parse_type_line
or get_signature
which calls parse_type_line
, if so, it can cause RCE, if not, maybe someone can also leave a backdoor by calling this function while writing code and share it to the people.
import torch
torch.jit.annotations.parse_type_line('# type: __import__("os").system("ls") -> 234', None, 1)
Versions
master
cc @ezyang @gchanan @zou3519 @EikanWang @jgong5 @wenzhe-nrv @sanchitintel