Description
The Im2LatexDataset.load method deserializes dataset files using Python’s pickle.load without any validation or trust boundary checks:
def load(self, filename, args=[]):
if not os.path.exists(filename):
with in_model_path():
tempf = os.path.join('..', filename)
if os.path.exists(tempf):
filename = os.path.realpath(tempf)
with open(filename, 'rb') as file:
x = pickle.load(file)
return x
When users load a dataset through this class, attacker-controlled pickle files can be deserialized directly. Since pickle is not safe for untrusted input, this behavior introduces a deserialization vulnerability that may lead to arbitrary code execution (RCE).
Any user who loads a dataset from an untrusted or tampered source (e.g., downloaded datasets, shared files, third-party repositories) is affected.
Description
The Im2LatexDataset.load method deserializes dataset files using Python’s pickle.load without any validation or trust boundary checks:
When users load a dataset through this class, attacker-controlled pickle files can be deserialized directly. Since pickle is not safe for untrusted input, this behavior introduces a deserialization vulnerability that may lead to arbitrary code execution (RCE).
Any user who loads a dataset from an untrusted or tampered source (e.g., downloaded datasets, shared files, third-party repositories) is affected.