Skip to content

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.

REPRO-2026-00063 deepdiff · pip RCE Jan 13, 2026 CVE entry ↗ .txt
Severity
CRITICAL
CVSS
10.0
Reproduced in
1m 7s
Tool calls
5
01 · Overview

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).

02 · Severity & CVSS

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 threat level
10.0 / 10 CVSS base
Weakness CWE-915 — Improperly Controlled Modification of Dynamically-Determined Object Attributes

Critical — the most severe class — typically remotely exploitable with severe impact. Treat as an emergency.

03 · Affected Versions

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
or curl -O https://pruva.dev/api/v1/reproductions/REPRO-2026-00063/artifacts/reproduction_steps.sh && chmod +x reproduction_steps.sh && ./reproduction_steps.sh
Run in a VM or disposable container. This exploits a real vulnerability.
06 · Proof of Reproduction

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_elements function 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:

  1. Tuple path to class - Result: BLOCKED (dunder filter)
  2. Tuple path to globals - Result: BLOCKED (dunder filter)
  3. Tuple path to init - Result: BLOCKED (dunder filter)
  4. Pickle reduce with os.system - Result: BLOCKED (ForbiddenModule)
  5. String path root.class - Result: BLOCKED (no effect)
  6. Unicode escape dunder (\u005f\u005f) - Result: BLOCKED (normalized)
  7. Nested tuple path to class - Result: BLOCKED (dunder filter)
  8. attribute_added with class - Result: BLOCKED (dunder filter)
  9. values_changed with dict - Result: BLOCKED (dunder filter)
  10. type_changes with class - Result: BLOCKED (dunder filter)
  11. Opcode gadget via pickle - Result: BLOCKED (no effect)
  12. 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

08 · How to Fix

How to Fix CVE-2025-58367

Upgrade deepdiff · pip to 8.6.1 or later.

Coming soon

Step-by-step mitigation and hardening guidance for CVE-2025-58367 — configuration checks, workarounds where no patch exists, and how to verify you're protected — is on the way.

10 · FAQ

FAQ: CVE-2025-58367

How does the deepdiff tuple-path bypass work?

An attacker crafts a Delta dictionary keyed by tuple paths that traverse an object's __class__, __init__, and __globals__ (or __builtins__) attributes — a path the string filter would reject as a string but not as a tuple. Applying the Delta then executes arbitrary code, causes denial of service, or bypasses authentication depending on what is reached through the exposed global namespace.

Which versions of deepdiff are affected by CVE-2025-58367, and where is it fixed?

deepdiff >= 5.0.0 and <= 8.6.0 is affected (confirmed vulnerable on 8.6.0). It is fixed in 8.6.1, which blocks dunder attribute traversal for all path representations.

How severe is CVE-2025-58367?

Critical, CVSS 10.0 — full remote code execution, denial of service, or authentication bypass when an attacker controls Delta input.

How can I reproduce CVE-2025-58367?

Download the verified script from this page and run it in an isolated environment against deepdiff 8.6.0. Construct a Delta using a tuple path containing dunder attributes (e.g. __class__, __globals__) that would be rejected as a string path, and confirm the Delta is accepted and traverses to sensitive attributes; confirm 8.6.1 blocks all such tuple paths.
11 · References

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.