CVE-2026-138444: CHGNet through 0.4.2 Insecure Deserialization RCE via CHGNet.from_file torch.load
CHGNet through 0.4.2 contains an insecure deserialization vulnerability that allows attackers to execute code because CHGNet.fromfile() calls torch.load() with weightsonly=False. Attackers can supply a crafted .pth.tar model file containing a pickle reduce gadget to execute code with the privileges of the user loading it.
Affected Software
Event History
Frequently Asked Questions
Who is realistically exposed to this issue?
Users or services running CHGNet through 0.4.2 are exposed when they load a model file supplied by an untrusted party through CHGNet.from_file(). The code executes with the privileges of the user or process performing the load.
What must an attacker do to exploit the vulnerability?
The attacker must provide a crafted .pth.tar model file containing a pickle __reduce__ gadget and cause a user or process to load it with CHGNet.from_file().
How can I identify potentially affected usage in my environment?
Check whether CHGNet through version 0.4.2 is installed and whether applications or workflows call CHGNet.from_file() on .pth.tar files. Loading model artifacts from external, user-controlled, or otherwise untrusted sources is the relevant exposure condition.