# CVE-2024-23346: pymatgen arbitrary code execution when parsing a maliciously crafted JonesFaithfulTransformation transformation_string

- Severity: Critical 9.4 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 3.85%, higher than 90% of CVEs (2026-12-01)
- Public exploit code or proof of concept: 2 links below, marked "exploit"
- Published: 2024-02-21T16:13:25.498Z
- Modified: 2026-06-17T07:12:38.440Z
- Also known as: GHSA-vgv8-5cpj-qj2f, PYSEC-2024-226
- Weaknesses: CWE-77
- SSVC (CISA-ADP): exploitation poc, automatable no, technical impact total
- Assigned by: GitHub_M

## Description

Pymatgen (Python Materials Genomics) is an open-source Python library for materials analysis. A critical security vulnerability exists in the `JonesFaithfulTransformation.from_transformation_str()` method within the `pymatgen` library prior to version 2024.2.20. This method insecurely utilizes `eval()` for processing input, enabling execution of arbitrary code when parsing untrusted input. Version 2024.2.20 fixes this issue.

(As written by CVE List.)

## Affected

- materialsproject pymatgen: < 2024.2.20
- pymatgen pymatgen: before 2024.2.20
- pymatgen (PyPI): before 2024.2.20; before c231cbd3d5147ee920a37b6ee9dd236b376bcf5a
- materialsvirtuallab pymatgen: before 2024.2.20

## Every score

- GitHub_M: CVSS:3.1 9.4 Critical `CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H`
- GitHub: CVSS:3.1 9.3 Critical `CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H`
- NVD: CVSS:3.1 7.8 High `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- PyPA Advisory Database: CVSS:3.1 7.8 High `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`

## References

- <https://github.com/materialsproject/pymatgen/security/advisories/GHSA-vgv8-5cpj-qj2f> (exploit, advisory, evidence, vendor-advisory, web)
- <https://www.vicarius.io/vsociety/posts/critical-security-flaw-in-pymatgen-library-cve-2024-23346> (exploit, evidence, third-party-advisory, web)
- <https://github.com/materialsproject/pymatgen/commit/c231cbd3d5147ee920a37b6ee9dd236b376bcf5a> (fix, patch, web)
- <https://github.com/materialsproject/pymatgen/blob/master/pymatgen/symmetry/settings.py#L97C1-L111C108> (broken-link, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2024-23346> (advisory)
- <https://github.com/materialsproject/pymatgen> (package)
- <https://github.com/pypa/advisory-database/tree/main/vulns/pymatgen/PYSEC-2024-226.yaml> (web)
- <https://github.com/advisories/GHSA-vgv8-5cpj-qj2f> (advisory)

## Sources

- CVE List: [CVE-2024-23346](https://www.cve.org/CVERecord?id=CVE-2024-23346), CVE Terms of Use, modified 2024-08-19
- GitHub Advisory Database: [GHSA-vgv8-5cpj-qj2f](https://github.com/advisories/GHSA-vgv8-5cpj-qj2f), CC-BY-4.0, modified 2026-06-10
- NVD: [CVE-2024-23346](https://nvd.nist.gov/vuln/detail/CVE-2024-23346), Public domain, modified 2026-06-17
- PyPA Advisory Database: [PYSEC-2024-226](https://osv.dev/vulnerability/PYSEC-2024-226), CC-BY-4.0, modified 2026-06-10

---

Page: https://cve.day/CVE-2024-23346 · Whole record: https://cve.day/CVE-2024-23346.json · Rebuilt by cve.day 2026-11-25T22:58:36.965Z
