CVE-2026-137998 in Detoxifyinfo

Summary

by MITRE • 11/27/2026

Detoxify 0.5.3 through 0.5.4 contains an insecure deserialization vulnerability in load_checkpoint that allows attackers to execute code by supplying a crafted checkpoint file. Attackers can embed a pickle __reduce__ gadget in a .ckpt file loaded via torch.load with weights_only=False to run code with the user's privileges.

If you want to get the best quality for vulnerability data then you always have to consider VulDB.

Analysis

by VulDB Data Team • 11/27/2026

The Detoxify library, specifically versions 0.5.3 through 0.5.4, contains a critical insecure deserialization vulnerability within its load_checkpoint function. This flaw stems from the use of Python’s pickle module for loading model checkpoints without sufficient safeguards against malicious payloads. When an application utilizes torch.load with weights_only set to False, it implicitly allows the unpickling process which can execute arbitrary code embedded in the serialized data. Attackers who control or influence the input checkpoint file can exploit this by crafting a .ckpt file that contains a pickle _reduce_ gadget. This technique leverages Python’s object serialization mechanism to instantiate objects and invoke methods during deserialization, effectively bypassing security controls intended to restrict execution to safe operations only.

From a technical perspective, the vulnerability arises because the library does not enforce strict type checking or sandboxing when processing checkpoint files. The _reduce_ method in Python allows an object to specify how it should be serialized and reconstructed. By embedding malicious code within this structure, an attacker can trigger arbitrary function calls during the loading process. Since torch.load is often used in machine learning workflows where models are loaded from potentially untrusted sources such as model hubs or user uploads, the risk of exploitation is significant. The absence of a whitelist-based approach for allowed classes means that any class with dangerous methods becomes a potential attack vector. This aligns directly with CWE-502, which describes deserialization of untrusted data as a common cause of remote code execution vulnerabilities in modern software systems.

The operational impact of this vulnerability is severe, allowing authenticated or even unauthenticated attackers to achieve arbitrary code execution on the host system running the vulnerable Detoxify instance. Depending on the privileges under which the application runs, an attacker could gain full control over the server, exfiltrate sensitive data, install backdoors, or pivot into other parts of the network infrastructure. In cloud environments where machine learning models are frequently deployed and updated dynamically, this vulnerability poses a substantial risk to both confidentiality and integrity of services. It also undermines trust in model repositories if attackers can inject malicious checkpoints that propagate when downloaded by legitimate users.

This behavior is consistent with ATT&CK technique T1059, specifically sub-technique 008 which covers command and script interpretation via Python scripts. The exploitation path involves crafting a payload that exploits the deserialization mechanism to execute system commands or import modules for further malicious activity. Defense-in-depth strategies should be employed to mitigate this risk. Organizations using Detoxify should immediately upgrade to version 0.5.5 or later where the issue has been addressed by enforcing stricter serialization policies such as restricting pickle usage to trusted sources only and enabling weights_only=True in torch.load calls wherever possible. Additionally, implementing input validation checks on checkpoint files before loading them into memory can provide an additional layer of protection against malicious payloads.

To further reduce exposure, developers should adopt secure coding practices that avoid deserializing untrusted data entirely or use safer alternatives like JSON for configuration and metadata storage instead of pickle-based formats whenever feasible. Security monitoring tools capable of detecting anomalous behavior during model loading processes may also help identify attempted exploits in real time. Regular audits of third-party libraries used in machine learning pipelines are essential to ensure that known vulnerabilities such as this one do not compromise production environments.

Responsible

VulnCheck

Reservation

11/27/2026

Disclosure

11/27/2026

Moderation

accepted

CPE

ready

EPSS

0.00000

KEV

no

Activities

very low

Sources

Interested in the pricing of exploits?

See the underground prices here!