CVE-2025-58367
Python vulnerability analysis and mitigation

Overview

Python class pollution vulnerability (CVE-2025-58367) affects DeepDiff package versions 5.0.0 through 8.6.0. The vulnerability exists in the Delta class which is susceptible to class pollution via its constructor, potentially leading to Denial of Service (DoS) and Remote Code Execution (RCE) through insecure Pickle deserialization. The issue was discovered by diogotcorreia and has been patched in version 8.6.1 (GitHub Advisory).

Technical details

The vulnerability allows attackers to bypass existing security filters by passing paths as internal representations to the Delta class. The Delta class accepts different object types including DeltaDiff objects, dictionaries, or bytes that are deserialized via Pickle. While there is a filter in place for string paths, the pathtoelements function returns the input directly if it's already a list/tuple, creating a bypass opportunity. Additionally, the SAFETO_IMPORT allowlist can be modified through class pollution to include dangerous classes like posix.system (GitHub Advisory).

Impact

The vulnerability can lead to multiple severe impacts including Denial of Service by polluting built-in Python classes, Remote Code Execution through insecure Pickle deserialization, and potential authentication bypasses in web applications. For example, attackers could override app.secret_key in Flask applications to sign arbitrary cookies (GitHub Advisory).

Mitigation and workarounds

The vulnerability has been patched in version 8.6.1. For earlier versions, mitigation involves preventing traversal through private keys by implementing checks in deepdiff.path.getnestedobj, deepdiff.path.getnestedobjandforce, and deepdiff.delta.Delta.getelementsanddetails. Alternatively, specifically restricting access to globals and builtins attributes can prevent the most serious exploitation cases (GitHub Advisory).

Additional resources


SourceThis report was generated using AI

Related Python vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2025-57817HIGH8.6
  • PythonPython
  • ethyca-fides
NoYesSep 08, 2025
CVE-2025-58446MEDIUM6.9
  • PythonPython
  • xgrammar
NoYesSep 06, 2025
CVE-2025-57816MEDIUM6.3
  • PythonPython
  • ethyca-fides
NoYesSep 08, 2025
CVE-2025-57815LOW1.7
  • PythonPython
  • ethyca-fides
NoYesSep 08, 2025
CVE-2025-57766LOW1.7
  • PythonPython
  • ethyca-fides
NoYesSep 08, 2025

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management