PyPA Advisory Database
PYSEC-2026-909
pymatgen is vulnerable to Regular Expression Denial of Service (ReDoS)
Details
An exponential ReDoS (Regular Expression Denial of Service) can be triggered in the pymatgen PyPI package, when an attacker is able to supply arbitrary input to the GaussianInput.from_string method.
Affected packages
| Ecosystem | Package | Affected versions |
|---|---|---|
| PyPI | pymatgen | All versions before 2025.10.7 (fixed in 2025.10.7) |
References
- https://nvd.nist.gov/vuln/detail/CVE-2022-42964
- https://github.com/materialsproject/pymatgen/issues/2755
- https://github.com/materialsproject/pymatgen
- https://research.jfrog.com/vulnerabilities/pymatgen-redos-xray-257184
- https://pypi.org/project/pymatgen
- https://github.com/advisories/GHSA-5jqp-885w-xj32
- https://github.com/materialsproject/pymatgen/pull/4476
- https://github.com/materialsproject/pymatgen/commit/8d2ca2296109f9e5a4ac1c751eee650ab4303108