Vulnerability in deepdiff
Auto-generated summary
Assembled by SecPulse from the source data (CVSS, CWE, affected versions) using templates — no AI involved. Check the original description and references below for exact details.
A vulnerability tracked as CVE-2025-58367 has been found in deepdiff.
Attackers can target a specific entry point like deepdiff.serialization.SAFE_TO_IMPORT over the network to misuse the product.
Risk of unauthorized operations or information disclosure.
What to do: upgrade deepdiff to 8.6.1 or later.
If unsure, ask your IT team or search "deepdiff CVE-2025-58367" on the vendor's site.
CVE-2025-58367 (deepdiff) — CWE-915
Attack surface: deepdiff.serialization.SAFE_TO_IMPORT
Patched: 8.6.1 — apply immediately
Plan: 1) Audit SBOM/dependencies, 2) Stage→prod upgrade, 3) Add WAF/proxy monitoring on affected endpoints, 4) Hunt IOCs in logs.
Refs: see the GHSA / vendor advisory / patched release linked on this page.
A vulnerability (CWE-915) exists in deepdiff. Attackers reach the vulnerable code path via deepdiff.serialization.SAFE_TO_IMPORT.
Check the vendor advisory for the affected versions of deepdiff. Attack surface: deepdiff.serialization.SAFE_TO_IMPORT.
Severity: ?. Risk of unauthorized operations or information disclosure.
Update to 8.6.1.
Until the patch is applied: disable the affected feature, apply WAF rules, or restrict access via network ACLs.
Search webserver/proxy logs for unusual request patterns matching this CVE's known IOCs. Run grep -r 'deepdiff' . against your dependency files (package-lock.json, requirements.txt, go.sum) to find affected services.
Response actions
Concrete steps and command examples for SOC/SRE teams to execute in order
-
1
Identify exposureidentify
grep -r 'deepdiff' . | grep -v node_modulesリポジトリと本番環境の依存ファイル (package-lock.json / requirements.txt / go.sum / Gemfile.lock 等) で
deepdiffを grep し、稼働しているサービス・バージョンを把握する。 -
2
Apply patchpatch
Upgrade deepdiff to 8.6.1ステージング環境で 8.6.1 に上げて回帰テスト → 本番反映。回帰テストはアプリの主要ハッピーパスを含めること。
-
3
Post-deployment verificationverify
Confirm patched version is live in productionパッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番ではアクセスログ・WAF でアラート再発が無いか継続監視。
Affected packages
| Package | Affected → Fixed | |
|---|---|---|
| PyPIdeepdiff |
≥ 5.0.0, < 8.6.1→ 8.6.1 |
8.6.1 |
| pipdeepdiff |
< 8.6.1→ 8.6.1 |
8.6.1 |
Fix status by distribution
Records published by each distribution for this CVE. Fixed versions differ by release; check each link.
- Debian DEBIAN-CVE-2025-58367 deepdiff Fix available
- Ubuntu UBUNTU-CVE-2025-58367 deepdiff No fixed version in this record
Original description The description as published by the source.
Summary
Python class pollution is a novel vulnerability categorized under CWE-915. The Delta class is vulnerable to class pollution via its constructor, and when combined with a gadget available in DeltaDiff itself, it can lead to Denial of Service and Remote Code Execution (via insecure Pickle deserialization).
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. For example, in a web application, it might be possible to bypass authentication via class pollution.
Details
The Delta class can take different object types as a parameter in its constructor, such as a DeltaDiff object, a dictionary, or even just bytes (that are deserialized via Pickle).
When it takes a dictionary, it is usually in the following format:
Delta({"dictionary_item_added": {"root.myattr['foo']": "bar"}})
Trying to apply class pollution here does not work, because there is already a filter in place: https://github.com/seperman/deepdiff/blob/b639fece73fe…
Source: OSV.dev (Open Source Vulnerabilities) NVD GitHub Advisory OSV
References
- advisory nvd.nist.gov
- advisory github.com
- package github.com
- web github.com
- web github.com
- web github.com
- web github.com
- web github.com
- web github.com
- web pypi.org
- web github.com