CVE-2025-58367

Description

A class pollution flaw has been discovered in the python DeepDiff library. Class pollution via the Delta class constructor, and when combined with a gadget available in DeltaDiff, it can lead to Denial of Service and Remote Code Execution (via insecure Pickle deserialization) exploitation. The gadget available in DeepDiff allows deepdiff.serialization.SAFE_TO_IMPORT to be modified to allow dangerous classes such as posix.system, and then perform insecure Pickle deserialization via the Delta class. This potentially allows any Python code to be executed, given that the input to Delta is user-controlled. Depending on the application where DeepDiff is used, this can also lead to other vulnerabilities.

Statement

Red Hat Product Security has determined that this vulnerability does not affect any currently supported Red Hat product. This assessment may evolve based on further analysis and discovery. For more information about this vulnerability and the products it affects, please see the linked references.

Mitigation

A code change mitigation for applications using DeepDiff is to prevent traversal through private keys, as is already done in the path parser. This would be implemented in `deepdiff.path._get_nested_obj`, `deepdiff.path._get_nested_obj_and_force`,
and `deepdiff.delta.Delta._get_elements_and_details`.

Understanding the Weakness (CWE)

Integrity

Technical Impact: Modify Application Data

An attacker could modify sensitive data or program variables.

Integrity

Technical Impact: Execute Unauthorized Code or Commands

Other,Integrity

Technical Impact: Varies by Context; Alter Execution Logic

Frequently Asked Questions

Want to get errata notifications? Sign up here.