Vulnerability · Published Feb 21, 2024 · Assigned by GitHub_M
CVE-2024-23346pymatgen arbitrary code execution when parsing a maliciously crafted JonesFaithfulTransformation transformation_string
Critical 9.4
In plain English
A critical-severity command injection in pymatgen from materialsproject. Proof-of-concept exploit code is public. The chance it is exploited in the next 30 days is estimated at 3.8% (higher than 90% of all known vulnerabilities). Ready-made attack tooling exists: public proof-of-concept code. Fixed versions are available - upgrade the affected package.
Official 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.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian:12 | pymatgen | 2022.11.7+dfsg1-11+deb12u1 | DEBIAN-CVE-2024-23346 |
| Debian:12 | pymatgen | 2022.11.7+dfsg1-11+deb12u1 | DSA-5763-1 |
| Debian:13 | pymatgen | 2024.1.27+dfsg1-6 | DEBIAN-CVE-2024-23346 |
| PyPI | pymatgen | 2024.2.20 | GHSA-vgv8-5cpj-qj2f |
| PyPI | pymatgen | 2024.2.20 | PYSEC-2024-226 |
| Ubuntu:22.04:LTS | pymatgen | no fix listed | UBUNTU-CVE-2024-23346 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| materialsproject | pymatgen | < 2024.2.20 |
Weakness: CWE-77 · Vector: CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
References
- https://github.com/materialsproject/pymatgen/security/advisories/GHSA-vgv8-5cpj-qj2f x_refsource_CONFIRM
- https://github.com/materialsproject/pymatgen/commit/c231cbd3d5147ee920a37b6ee9dd236b376bcf5a x_refsource_MISC
- https://github.com/materialsproject/pymatgen/blob/master/pymatgen/symmetry/settings.py#L97C1-L111C108 x_refsource_MISC
- https://www.vicarius.io/vsociety/posts/critical-security-flaw-in-pymatgen-library-cve-2024-23346