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.

Severity (CVSS 3.1)9.4Critical
Exploit odds (30 days)3.8%top 9.8% of all CVEs
Exploited in the wildNo reportsCISA SSVC: poc
Attack tooling1Public PoC

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

EcosystemPackageFixed inAdvisory
Debian:12pymatgen2022.11.7+dfsg1-11+deb12u1DEBIAN-CVE-2024-23346
Debian:12pymatgen2022.11.7+dfsg1-11+deb12u1DSA-5763-1
Debian:13pymatgen2024.1.27+dfsg1-6DEBIAN-CVE-2024-23346
PyPIpymatgen2024.2.20GHSA-vgv8-5cpj-qj2f
PyPIpymatgen2024.2.20PYSEC-2024-226
Ubuntu:22.04:LTSpymatgenno fix listedUBUNTU-CVE-2024-23346

Affected products (as reported)

VendorProductVersions
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