Skip to main content

CVE-2025-58367: CWE-915: Improperly Controlled Modification of Dynamically-Determined Object Attributes in seperman deepdiff

Critical
VulnerabilityCVE-2025-58367cvecve-2025-58367cwe-915
Published: Fri Sep 05 2025 (09/05/2025, 21:52:31 UTC)
Source: CVE Database V5
Vendor/Project: seperman
Product: deepdiff

Description

DeepDiff is a project focused on Deep Difference and search of any Python data. Versions 5.0.0 through 8.6.0 are vulnerable to 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. This is fixed in version 8.6.1.

AI-Powered Analysis

AILast updated: 09/05/2025, 22:12:34 UTC

Technical Analysis

CVE-2025-58367 is a critical vulnerability affecting the Python library DeepDiff, versions 5.0.0 through 8.6.0. DeepDiff is used for deep difference detection and searching within Python data structures. The vulnerability arises from improper control over dynamically-determined object attributes, specifically involving the Delta class constructor. This flaw allows an attacker to perform class pollution by modifying the attribute deepdiff.serialization.SAFE_TO_IMPORT, which controls which classes are considered safe for deserialization. By manipulating this attribute, an attacker can introduce dangerous classes such as posix.system into the deserialization process. When combined with the DeltaDiff gadget, this leads to insecure Pickle deserialization, a well-known vector for remote code execution (RCE). Since Pickle deserialization executes arbitrary Python code during object reconstruction, if an attacker can supply user-controlled input to the Delta class, they can execute arbitrary code on the host system without authentication or user interaction. This vulnerability impacts confidentiality, integrity, and availability, as it allows full system compromise. The vulnerability is fixed in DeepDiff version 8.6.1. The CVSS 4.0 base score is 10.0 (critical), reflecting network attack vector, no required privileges or user interaction, and high impact on confidentiality, integrity, and availability. No known exploits are currently in the wild, but the ease of exploitation and severity make it a high-risk threat for any application using vulnerable DeepDiff versions.

Potential Impact

For European organizations, this vulnerability poses a severe risk, especially for those relying on Python applications that incorporate DeepDiff for data comparison or processing. Exploitation can lead to full system compromise, data breaches, and disruption of critical services. Sectors such as finance, healthcare, government, and critical infrastructure, which often use Python for automation and data analysis, are particularly at risk. The ability to execute arbitrary code remotely without authentication means attackers can deploy ransomware, steal sensitive data, or pivot within networks. Given the widespread use of Python in European enterprises and open-source projects, the vulnerability could have broad implications. Additionally, organizations subject to strict data protection regulations like GDPR could face significant compliance and reputational damage if exploited.

Mitigation Recommendations

Organizations should immediately audit their Python environments to identify usage of DeepDiff versions between 5.0.0 and 8.6.0. Upgrading to version 8.6.1 or later is the primary mitigation step. For environments where immediate upgrade is not feasible, restrict or sanitize all user inputs that may reach the Delta class constructor to prevent malicious payloads. Implement application-level input validation and employ runtime application self-protection (RASP) mechanisms to detect anomalous deserialization attempts. Additionally, consider isolating services using DeepDiff in sandboxed or containerized environments with minimal privileges to limit potential damage. Monitoring logs for unusual Pickle deserialization activity and deploying intrusion detection systems tuned for Python deserialization attacks can provide early warning. Finally, educate developers about the risks of insecure deserialization and enforce secure coding practices.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
GitHub_M
Date Reserved
2025-08-29T16:19:59.012Z
Cvss Version
4.0
State
PUBLISHED

Threat ID: 68bb5cd1535f4a977310270f

Added to database: 9/5/2025, 9:57:37 PM

Last enriched: 9/5/2025, 10:12:34 PM

Last updated: 9/6/2025, 2:13:55 AM

Views: 10

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats