(0Day) PyTorch Foundation PyTorch PT2 File Parsing Code Injection Remote Code Execution Vulnerability
PyTorch does not properly validate a user-supplied string while parsing PT2 files, and that string is then used to execute Python code. An attacker who can get a crafted PT2 file loaded could run arbitrary code in the context of the current process.
This vulnerability allows remote attackers to execute arbitrary code on affected installations of PyTorch. Interaction with this library is required to exploit this vulnerability but attack vectors may vary depending on the implementation.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the PT2 loader passes a string taken from the file into a Python code execution function without validating or restricting it.
Impact
An attacker could execute arbitrary code in the context of the current process, though the victim must interact with the library and the attack vector depends on how it is implemented.
What the attacker needed
Victim loads a crafted PT2 file; attacker can supply the file
The fix
The vendor rejected the report as expected behaviour, so no fix is described; the advisory only suggests restricting interaction with the product.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
PyTorch parses PT2 files. A crafted file can supply a string that PyTorch fails to validate and then uses to run Python code, so loading one could run an attacker's code.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.