CVE-2025-58367
Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.
NVD · uneditedDeepDiff 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.
Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.
dbcve analysis · high confidenceDeepDiff versions 5.0.0-8.6.0 contain a class pollution vulnerability in the Delta class constructor. Attackers can manipulate deepdiff.serialization.SAFE_TO_IMPORT to allow dangerous classes like posix.system, then achieve Remote Code Execution through insecure Pickle deserialization when user-controlled input is passed to the Delta class.
Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.
CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.
From the vector- Attack vector
- Network
- Complexity
- Low
- Privileges
- None
- Authentication
- X
- User interaction
- None
- Scope
- X
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.
dbcve checksWork through these to decide whether this CVE applies to you.
-
Check DeepDiff installed versionRun 'pip show deepdiff' or 'pip list | grep -i deepdiff' to retrieve the installed version numberAffected if The version falls within 5.0.0 to 8.6.0 inclusive
-
Locate Delta class usage in codeSearch source code for imports of 'Delta' from 'deepdiff' or 'deepdiff.serialization' and subsequent instantiation (e.g., Delta(input), Delta(data), Delta(config))Affected if Code passes any user-controlled or external input directly to Delta() constructor without validation
-
Inspect SAFE_TO_IMPORT attributeRun Python: 'from deepdiff import serialization; print(serialization.SAFE_TO_IMPORT)' to view current valueAffected if The attribute contains dangerous classes like 'posix.system', 'os.system', 'subprocess' modules, or any class not present in the default safe allowlist
-
Check for pickle deserialization patternsSearch code for patterns where Delta receives pickled data, serialized strings, or data from external sources (HTTP requests, files, user inputs) that may contain serialized Delta objectsAffected if Delta is instantiated with data from untrusted sources, especially data that could contain pickled objects
-
Audit Delta class instantiation contextReview all call sites where Delta() is invoked and trace the source of the input argument - check if it originates from user input, HTTP headers, file upload, API call, or any external sourceAffected if Any Delta() call receives input that originates from users, APIs, files, or external systems without validation
You are affected if DeepDiff version is 5.0.0-8.6.0 AND the Delta class is used with any external or user-controlled input, or if SAFE_TO_IMPORT has been modified from its default safe allowlist.
Generated from the published advisory. Verify against your own configuration.
Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.
dbcve · scopedUpgrade DeepDiff to version 8.6.1 or later. Additionally, never pass untrusted user input directly to the Delta class without thorough validation, as the underlying Pickle deserialization vulnerability can be exploited if Delta input is user-controlled.
Upgrade to DeepDiff version 8.6.1 or later
- Check the current installed version of DeepDiff by running: pip show deepdiff or pip list | grep deepdiff
- If the installed version is between 5.0.0 and 8.6.0 (inclusive), upgrade to the fixed version using: pip install deepdiff>=8.6.1
- Verify the upgrade was successful by running: pip show deepdiff
- If using a requirements.txt file, update the DeepDiff version specification to: deepdiff>=8.6.1
- Test the application to ensure functionality is maintained after the upgrade
Generated from the published advisory — verify against the referenced sources before acting.
- Consultation3.0 h
- Implementation8.0 h
- Testing4.0 h
- Review / QA2.0 h
An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $4,800.
Scan for this in your stack
Free · runs locallyCheck whether your project pulls in CVE-2025-58367 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.
References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.
Primary sourcesPractitioner notes
ContributedPeer-ranked notes from engineers who’ve handled CVE-2025-58367 in production — separate from our analysis above.
The advisory tells you what broke. It rarely tells you what actually worked. If you’ve dealt with this one, that detail is what the next engineer is searching for.
- The version that genuinely resolved it — not the one the vendor claimed
- A config change or rule that shut the vector down
- A gotcha in the upgrade path that cost you an afternoon
No notes yet
Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.
A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.
- Verified mitigations, workarounds, and config changes
- Version or environment caveats, and links to real fixes
- No weaponised exploit code, or anything meant to cause harm
- No spam, self-promotion, credentials, or personal data