CVE-2024-23346
published critical CVSS 3.1 · 9.4pymatgen arbitrary code execution when parsing a maliciously crafted JonesFaithfulTransformation transformation_string
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| materialsproject | — | pymatgen< 2024.2.20 | Affected | Not stated | GitHub_M |
| pymatgen | — | pymatgen0 to < 2024.2.20 · Other versions: unknown | Affected | Not stated | CISA-ADP |
| Debian | bookworm | pymatgen | Advisory build | 2022.11.7+dfsg1-11+deb12u1 | DSA-5763-1 |
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.
Related advisories
Vendor advisories explicitly linked to this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 3.1
- Base score
- 9.4 / 10
- Severity
- critical
- Provider
- GitHub_M · cna
- Vector string
- CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| materialsproject | pymatgen | < 2024.2.20 (affected) | GitHub_M · cna |
| pymatgen | pymatgen | 0 to < 2024.2.20 (affected · custom)Default: unknown | CISA-ADP · adp |
Weaknesses
1- CWE-77 CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection')
References
4- https://github.com/materialsproject/pymatgen/blob/master/pymatgen/symmetry/settings.py#L97C1-L111C108
- https://github.com/materialsproject/pymatgen/commit/c231cbd3d5147ee920a37b6ee9dd236b376bcf5a
- https://github.com/materialsproject/pymatgen/security/advisories/GHSA-vgv8-5cpj-qj2f
- https://www.vicarius.io/vsociety/posts/critical-security-flaw-in-pymatgen-library-cve-2024-23346
Provider assertions
3GitHub_M · cna
pymatgen arbitrary code execution when parsing a maliciously crafted JonesFaithfulTransformation transformation_string
CISA-ADP · adp
CISA ADP Vulnrichment
CVE · adp
CVE Program Container
Provenance
- Schema
- 5.1
- Searchable
- yes
- Content hash
- 20dc2921bbb2059e721c1f6d4baa36e7bce7b0f6f55bba4dd19f8897e3f7b97d
- Ingested
- 23 Sep 2026, 08:19:29 UTC
- Source record
- Official CVE record