CVE-2025-58367
DeepDiff is vulnerable to DoS and Remote Code Execution via Delta class pollution
DeepDiff 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.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- None
What an attacker can affect
- Confidentiality
- High
- Integrity
- High
- Availability
- High
Exploit likelihood
What each source reports
CVE List Score used
10.0
DeepDiff is vulnerable to DoS and Remote Code Execution via Delta class pollution
DeepDiff 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.
- Record
CVE-2025-58367- CVSS 4.0
- 10.0 Critical
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 - Weakness
- CWE-915
- Updated
- 2026-11-02
EUVDEUVD-2025-27049
10.0
DeepDiff 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.
- Record
EUVD-2025-27049- CVSS 4.0
- 10.0 Critical
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 - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-mw26-5g2v-hqw3
10.0
DeepDiff Class Pollution in Delta class leading to DoS, Remote Code Execution, and more
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/b639fece73fe3ce4120261fdcff3cc7b826776e3/deepdiff/path.py#L23
However, this code only runs when parsing the path from a string.
The _path_to_elements function helpfully returns the given input if it is already a list/tuple:
https://github.com/seperman/deepdiff/blob/b639fece73fe3ce4120261fdcff3cc7b826776e3/deepdiff/path.py#L52-L53
This means that it is possible to pass the path as the internal representation used by Delta, bypassing the filter:
Delta(
{
"dictionary_item_added": {
(
("root", "GETATTR"),
("__init__", "GETATTR"),
("__globals__", "GETATTR"),
("PWNED", "GET"),
): 1337
}
},
)
Going back to the possible inputs of Delta, when it takes a bytes as input, it uses pickle to deserialize them.
Care was taken by DeepDiff to prevent arbitrary code execution via the SAFE_TO_IMPORT allow list.
https://github.com/seperman/deepdiff/blob/b639fece73fe3ce4120261fdcff3cc7b826776e3/deepdiff/serialization.py#L62-L98
However, using the class pollution in the Delta, an attacker can add new entries to this set.
This then allows a second call to Delta to unpickle an insecure class that runs os.system, for example.
Using dict
Usually, class pollution does not work when traversal starts at a dict/list/tuple, because it is not possible to reach __globals__ from there.
However, using two calls to Delta (or just one call if the target dictionary that already contains at least one entry) it is possible to first change one entry of the dictionary to be of type deepdiff.helper.Opcode, which then allows traversal to __globals__, and notably sys.modules, which in turn allows traversal to any module already loaded by Python.
Passing Opcode around can be done via pickle, which Delta will happily accept given it is in the default allow list.
Proof of Concept
With deepdiff 8.6.0 installed, run the following scripts for each proof of concept.
All input to Delta is assumed to be user-controlled.
Denial of Service
This script will pollute the value of builtins.int, preventing the class from being used and making code crash whenever invoked.
# ------------[ Setup ]------------
import pickle
from deepdiff.helper import Opcode
pollute_int = pickle.dumps(
…
- Record
GHSA-mw26-5g2v-hqw3- CVSS 4.0
- 10.0 Critical
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 - Weakness
- CWE-915
- Updated
- 2026-11-02
NVD
10.0
DeepDiff 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.
- Record
CVE-2025-58367- CVSS 4.0
- 10.0 Critical
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 - Weakness
- CWE-915
- Updated
- 2026-11-02
OSV
10.0
DeepDiff is vulnerable to DoS and Remote Code Execution via Delta class pollution
DeepDiff 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.
- Record
CVE-2025-58367- CVSS 4.0
- 10.0 Critical
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 - Weakness
- CWE-915
- Updated
- 2026-11-02
OSVDEBIAN-CVE-2025-58367
10.0
DeepDiff 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.
- Record
DEBIAN-CVE-2025-58367- CVSS 4.0
- 10.0 Critical
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 - Updated
- 2026-11-02
Show 6 moreShow less
OSVGHSA-mw26-5g2v-hqw3
10.0
DeepDiff Class Pollution in Delta class leading to DoS, Remote Code Execution, and more
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/b639fece73fe3ce4120261fdcff3cc7b826776e3/deepdiff/path.py#L23
However, this code only runs when parsing the path from a string.
The _path_to_elements function helpfully returns the given input if it is already a list/tuple:
https://github.com/seperman/deepdiff/blob/b639fece73fe3ce4120261fdcff3cc7b826776e3/deepdiff/path.py#L52-L53
This means that it is possible to pass the path as the internal representation used by Delta, bypassing the filter:
Delta(
{
"dictionary_item_added": {
(
("root", "GETATTR"),
("__init__", "GETATTR"),
("__globals__", "GETATTR"),
("PWNED", "GET"),
): 1337
}
},
)
Going back to the possible inputs of Delta, when it takes a bytes as input, it uses pickle to deserialize them.
Care was taken by DeepDiff to prevent arbitrary code execution via the SAFE_TO_IMPORT allow list.
https://github.com/seperman/deepdiff/blob/b639fece73fe3ce4120261fdcff3cc7b826776e3/deepdiff/serialization.py#L62-L98
However, using the class pollution in the Delta, an attacker can add new entries to this set.
This then allows a second call to Delta to unpickle an insecure class that runs os.system, for example.
Using dict
Usually, class pollution does not work when traversal starts at a dict/list/tuple, because it is not possible to reach __globals__ from there.
However, using two calls to Delta (or just one call if the target dictionary that already contains at least one entry) it is possible to first change one entry of the dictionary to be of type deepdiff.helper.Opcode, which then allows traversal to __globals__, and notably sys.modules, which in turn allows traversal to any module already loaded by Python.
Passing Opcode around can be done via pickle, which Delta will happily accept given it is in the default allow list.
Proof of Concept
With deepdiff 8.6.0 installed, run the following scripts for each proof of concept.
All input to Delta is assumed to be user-controlled.
Denial of Service
This script will pollute the value of builtins.int, preventing the class from being used and making code crash whenever invoked.
# ------------[ Setup ]------------
import pickle
from deepdiff.helper import Opcode
pollute_int = pickle.dumps(
…
- Record
GHSA-mw26-5g2v-hqw3- CVSS 4.0
- 10.0 Critical
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 - Weakness
- CWE-915
- Updated
- 2026-11-02
OSVPYSEC-2026-327
10.0
DeepDiff Class Pollution in Delta class leading to DoS, Remote Code Execution, and more
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/b639fece73fe3ce4120261fdcff3cc7b826776e3/deepdiff/path.py#L23
However, this code only runs when parsing the path from a string.
The _path_to_elements function helpfully returns the given input if it is already a list/tuple:
https://github.com/seperman/deepdiff/blob/b639fece73fe3ce4120261fdcff3cc7b826776e3/deepdiff/path.py#L52-L53
This means that it is possible to pass the path as the internal representation used by Delta, bypassing the filter:
Delta(
{
"dictionary_item_added": {
(
("root", "GETATTR"),
("__init__", "GETATTR"),
("__globals__", "GETATTR"),
("PWNED", "GET"),
): 1337
}
},
)
Going back to the possible inputs of Delta, when it takes a bytes as input, it uses pickle to deserialize them.
Care was taken by DeepDiff to prevent arbitrary code execution via the SAFE_TO_IMPORT allow list.
https://github.com/seperman/deepdiff/blob/b639fece73fe3ce4120261fdcff3cc7b826776e3/deepdiff/serialization.py#L62-L98
However, using the class pollution in the Delta, an attacker can add new entries to this set.
This then allows a second call to Delta to unpickle an insecure class that runs os.system, for example.
Using dict
Usually, class pollution does not work when traversal starts at a dict/list/tuple, because it is not possible to reach __globals__ from there.
However, using two calls to Delta (or just one call if the target dictionary that already contains at least one entry) it is possible to first change one entry of the dictionary to be of type deepdiff.helper.Opcode, which then allows traversal to __globals__, and notably sys.modules, which in turn allows traversal to any module already loaded by Python.
Passing Opcode around can be done via pickle, which Delta will happily accept given it is in the default allow list.
Proof of Concept
With deepdiff 8.6.0 installed, run the following scripts for each proof of concept.
All input to Delta is assumed to be user-controlled.
Denial of Service
This script will pollute the value of builtins.int, preventing the class from being used and making code crash whenever invoked.
# ------------[ Setup ]------------
import pickle
from deepdiff.helper import Opcode
pollute_int =…
- Record
PYSEC-2026-327- CVSS 4.0
- 10.0 Critical
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 - Updated
- 2026-11-02
OSVUBUNTU-CVE-2025-58367
10.0
DeepDiff 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.
- Record
UBUNTU-CVE-2025-58367- CVSS 4.0
- 10.0 Critical
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 - Updated
- 2026-11-05
OSVCLSA-2025-1757981510 No score
TuxCare security update for deepdiff (1 CVE)
TuxCare rebuilt deepdiff to address 1 CVE. Fixed in 6.2.3.post1+tuxcare.
- Record
CLSA-2025-1757981510- Updated
- 2026-11-02
OSVopenSUSE-SU-2025:15536-1 No score
python311-deepdiff-8.6.1-1.1 on GA media
These are all security issues fixed in the python311-deepdiff-8.6.1-1.1 package on the GA media of openSUSE Tumbleweed.
- Record
openSUSE-SU-2025:15536-1- Updated
- 2026-11-02
OSVSUSE-SU-2025:03127-1 No score
Security update for python-deepdiff
This update for python-deepdiff fixes the following issues:
- CVE-2025-58367: class pollution via the
Deltaclass constructor can lead to denial-of-service and remote code execution (bsc#1249347).
- Record
SUSE-SU-2025:03127-1- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
deepdiffPyPI |
5.0.0 up to 8.6.1 | 8.6.1 |
deepdiffTuxCare:PyPI |
6.2.3 up to 6.2.3.post1+tuxcare | 6.2.3.post1+tuxcare |
deepdiffDebian:12 |
All versions, plus listed versions 6.2.2-16.7.1-16.7.1-28.1.1-18.1.1-2 Show 5 moreShow less8.1.1-38.1.1-48.6.1-19.0.0-19.0.0-2 |
None known |
deepdiffDebian:13 |
before 8.1.1-4+deb13u1, plus listed versions 8.1.1-4 |
8.1.1-4+deb13u1 |
deepdiffDebian:14 |
before 8.6.1-1, plus listed versions 8.1.1-4 |
8.6.1-1 |
deepdiffPyPI |
5.0.0 up to 8.6.1, plus listed versions 5.0.15.0.25.2.05.2.15.2.2 Show 32 moreShow less5.2.35.3.05.5.05.6.05.7.05.8.05.8.16.2.16.2.26.2.36.3.06.3.16.4.06.4.16.5.06.6.06.6.16.7.06.7.17.0.07.0.18.0.08.0.18.1.08.1.18.2.08.3.08.4.08.4.18.4.28.5.08.6.0 |
8.6.1 |
python-deepdiffopenSUSE:Leap 15.6 |
before 6.3.0-150600.3.3.1 | 6.3.0-150600.3.3.1 |
deepdiffUbuntu:22.04:LTS |
All versions, plus listed versions 3.3.0-23.3.0-2ubuntu13.3.0-35.6.0-2 |
None known |
deepdiffUbuntu:24.04:LTS |
All versions, plus listed versions 6.2.2-16.7.1-1 |
None known |
deepdiffUbuntu:25.10 |
All versions, plus listed versions 8.1.1-38.1.1-4 |
None known |
python-deepdiffopenSUSE:Tumbleweed |
before 8.6.1-1.1 | 8.6.1-1.1 |
History
| Recorded | Changed | Sources |
|---|---|---|
| affected, facts | OSV | |
| first indexed | CVE List, EUVD, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2025-58367 is a critical vulnerability (CVSS 10.0) in Seperman Deepdiff, published September 3, 2025. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 1.20%, the 68th percentile. Fixed in deepdiff 8.6.1.
References
github.com/seperman/deepdiff/security/advisories/GHSA-mw26-5g2v-hqw3
github.com/seperman/deepdiff/commit/c69c06c13f75e849c770ade3f556cd16209fd183
github.com/seperman/deepdiff/releases/tag/8.6.1
github.com/dgilland/pydash/issues/180
github.com/dgilland/pydash/commit/2015f0a4bcdbc3a5b27652e38fe97b3ee13ac15f
nvd.nist.gov/vuln/detail/CVE-2025-58367
Show 12 moreShow less
github.com/pypa/advisory-database/tree/main/vulns/deepdiff/PYSEC-2026-327.yaml
pypi.org/project/deepdiff
github.com/advisories/GHSA-mw26-5g2v-hqw3
github.com/CVEProject/cvelistV5/tree/main/cves/2025/58xxx/CVE-2025-58367.json
security-tracker.debian.org/tracker/CVE-2025-58367
github.com/seperman/deepdiff
suse.com/support/update/announcement/2025/suse-su-202503127-1
bugzilla.suse.com/1249347
suse.com/security/cve/CVE-2025-58367
ubuntu.com/security/CVE-2025-58367
cve.org/CVERecord?id=CVE-2025-58367
github.com/qlustered/deepdiff/security/advisories/GHSA-mw26-5g2v-hqw3
Left out here: the rest of 3 source descriptions. The JSON record has them.