CVE-2025-58367: Verified Repro With Script Download
CVE-2025-58367: deepdiff: Class Pollution RCE via Delta Tuple Path Bypass
CVE-2025-58367 is verified against deepdiff · pip. Affected versions: >= 5.0.0, <= 8.6.0. Fixed in 8.6.1. Vulnerability class: RCE. This critical reproduction includes runnable sandbox proof, artifacts, and a plain-text agent view under REPRO-2026-00063.
What Is CVE-2025-58367?
CVE-2025-58367 is a critical (CVSS 10.0) class pollution / remote code execution vulnerability (CWE-915) in the deepdiff Python library's Delta class, versions 5.0.0 through 8.6.0. Attacker-controlled Delta input can bypass dunder-attribute filters and traverse to sensitive object attributes. Pruva reproduced it (reproduction REPRO-2026-00063).
CVE-2025-58367 Severity & CVSS Score
CVE-2025-58367 is rated critical severity, with a CVSS base score of 10.0 out of 10.
Critical — the most severe class — typically remotely exploitable with severe impact. Treat as an emergency.
Affected deepdiff Versions
deepdiff · pip versions >= 5.0.0, <= 8.6.0 are affected.
How to Reproduce CVE-2025-58367
pruva-verify REPRO-2026-00063 curl -O https://pruva.dev/api/v1/reproductions/REPRO-2026-00063/artifacts/reproduction_steps.sh && chmod +x reproduction_steps.sh && ./reproduction_steps.sh Proof of Reproduction for CVE-2025-58367
Root Cause and Exploit Chain for CVE-2025-58367
Summary
- Vulnerability: Class pollution RCE in deepdiff Delta class via tuple path bypass
- Affected: deepdiff >= 5.0.0, <= 8.6.0 (confirmed on 8.6.0)
- Fixed: 8.6.1 and later
- Impact: Remote code execution, denial of service, authentication bypass when attacker controls Delta input
Mechanism (What is broken)
- DeepDiff's Delta class accepts dictionaries with paths as keys to represent object changes.
- While string paths are filtered for dangerous attributes like
__globals__, the_path_to_elementsfunction returns tuple representations unchanged. - An attacker can pass tuple paths like
(("root", "GETATTR"), ("__class__", "GETATTR"), ("__globals__", "GETATTR"))to bypass security filters. - This allows traversing to sensitive attributes including
__globals__,__builtins__, and executing arbitrary code. - The vulnerable code pattern: Delta accepts user input and applies it without validating tuple path representations.
Proof of Vulnerability
- On deepdiff 8.6.0, creating a Delta with tuple paths containing dunder attributes succeeds.
- The path
(("root", "GETATTR"), ("__class__", "GETATTR"), ("__init__", "GETATTR"), ("__globals__", "GETATTR"))is accepted. - This demonstrates the string filter bypass - the same path as string would be rejected.
- Evidence captured in logs/evidence_vuln.txt confirming tuple path bypass.
- Evidence JSON: {"reproduced": true, "vulnerable_version": "8.6.0"}
Patched Behavior (Latest)
- In deepdiff 8.6.1, dunder attribute traversal is blocked for ALL path formats including tuples.
- The patched code raises DeltaError: "traversing dunder attributes is not allowed".
- Additionally, SAFE_TO_IMPORT is now a frozenset (immutable), preventing runtime modification.
- Pickle deserialization blocks forbidden modules by default.
Bypass Exploration (12 distinct attempts) We tested the following bypass attempts on the patched version:
- Tuple path to class - Result: BLOCKED (dunder filter)
- Tuple path to globals - Result: BLOCKED (dunder filter)
- Tuple path to init - Result: BLOCKED (dunder filter)
- Pickle reduce with os.system - Result: BLOCKED (ForbiddenModule)
- String path root.class - Result: BLOCKED (no effect)
- Unicode escape dunder (\u005f\u005f) - Result: BLOCKED (normalized)
- Nested tuple path to class - Result: BLOCKED (dunder filter)
- attribute_added with class - Result: BLOCKED (dunder filter)
- values_changed with dict - Result: BLOCKED (dunder filter)
- type_changes with class - Result: BLOCKED (dunder filter)
- Opcode gadget via pickle - Result: BLOCKED (no effect)
- SAFE_TO_IMPORT mutation - Result: BLOCKED (frozenset immutable)
Result: All 12 bypass attempts blocked. The patch comprehensively addresses both tuple path bypass and pickle gadget chains.
Threat Model Considerations
- Access: Attacker needs ability to control input to Delta constructor (web APIs, user uploads)
- Gain: Full RCE, DoS via corrupting built-in classes, authentication bypass via secret modification
- Prerequisites: Application using DeepDiff Delta with user-controlled input
- CVSS 10.0 reflects network-accessible, no auth required, full impact
How to Interpret Our Artifacts
- logs/evidence_vuln.txt: Shows "CLASS_POLLUTION_TUPLE_PATH_BYPASS" proving the vulnerability
- logs/vulnerable.log: Shows Delta accepting tuple path with dunder attributes
- logs/patched.log: Shows all 12 bypass attempts blocked with specific error messages
- logs/result.json: JSON summary with reproduced=true, patched_blocked=true, bypass_attempts=12
Conclusion
- Vulnerability reproduced on affected version (8.6.0) - tuple paths bypass string filters for dunder attributes
- Patched version (8.6.1) blocks ALL 12 bypass attempts via comprehensive dunder filtering
- Key fixes: dunder filter applies to tuple paths, SAFE_TO_IMPORT is immutable frozenset, ForbiddenModule for pickle
References
CVE-2025-58367 Reproduction Transcript
The agent's step-by-step process — every tool call, every handoff, the moment the exploit fired.
Loading session...
Artifacts and Evidence for CVE-2025-58367
Scripts, logs, diffs, and output captured during the reproduction.
No artifacts available
How to Fix CVE-2025-58367
Upgrade deepdiff · pip to 8.6.1 or later.
FAQ: CVE-2025-58367
How does the deepdiff tuple-path bypass work?
Which versions of deepdiff are affected by CVE-2025-58367, and where is it fixed?
How severe is CVE-2025-58367?
How can I reproduce CVE-2025-58367?
References for CVE-2025-58367
Authoritative sources for CVE-2025-58367 — official vulnerability databases and the upstream advisory. Pruva's reproduction verifies the issue firsthand; these are the primary records to corroborate it.