(0Day) PyTorch Foundation PyTorch load_state_dict_from_url Deserialization of Untrusted Data Remote Code Execution Vulnerability
The load_state_dict_from_url function in PyTorch does not properly validate user-supplied data, which leads to deserialisation of untrusted data. An attacker could use this to run arbitrary code in the context of the current process, provided the target visits a malicious page or opens a malicious file.
This vulnerability allows remote attackers to execute arbitrary code on affected installations of PyTorch Foundation PyTorch. User interaction is required to exploit this vulnerability in that the target must visit a malicious page or open a malicious file.
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 function deserialises data fetched from a URL without validating or restricting what that data contains, so a crafted payload is turned into live objects.
Impact
An attacker could execute arbitrary code in the context of the current process, but only if the target visits a malicious page or opens a malicious file.
What the attacker needed
Victim loads a malicious page or file
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 has a function that loads saved model data. The problem is that it does not properly validate what it loads, so untrusted data can be deserialised and a crafted file can lead to code running. The victim must load a malicious page or file.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.