Skip to content
OpenAdvisories
Critical · 9.4 Public exploit CVE-2024-23346 EUVD-2024-0203GHSA-vgv8-5cpj-qj2fPYSEC-2024-226

pymatgen arbitrary code execution when parsing a maliciously crafted JonesFaithfulTransformation transformation_string

Published Feb 21, 2024 · Updated Aug 19, 2024 · 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.

Affected products

VendorProductAffectedFixed
materialsproject pymatgen < 2024.2.20 —

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

ReleasePackageFixed inAdvisory
Debian 13 pymatgen 2024.1.27+dfsg1-6 —
Debian 12 pymatgen 2022.11.7+dfsg1-11+deb12u1 DSA-5763-1
ReleasePackageFixed inAdvisory
Ubuntu 22.04 LTS pymatgen No fix yet —

Public exploits

Exploit or proof-of-concept code for this vulnerability is publicly available, which lowers the bar for attackers. Treat it as a reason to patch sooner.

Third-party code, not reviewed by us. Public PoCs are sometimes fake or contain malware. Read the code first and run it only in an isolated lab, against systems you are authorised to test.

Exploit-DB 1

GitHub 5 repositories

  • DAVIDAROCA27/CVE-2024-23346-exploit ★ 4 · Jul 24, 2025

    This is a exploit for the known Remote Code Execution (RCE) vulnerability in the `pymatgen` (CVE-2024-23346) Python library by uploading a malicious `CIF` file to the hosted `CIF Analyzer` website on…

  • 9carlo6/CVE-2024-23346 ★ 3 · Nov 5, 2024

    This repository contains a Crystallographic Information File (CIF) intended for use on the "Chemistry" machine on Hack The Box (HTB).

  • Sanity-Archive/CVE-2024-23346 ★ 2 · Feb 20, 2025

    PoC of the vulnerability CVE-2024-23346

  • szyth/CVE-2024-23346-rust-exploit ★ 0 · Feb 25, 2025

    A Rust exploit for CVE-2024-23346 that functions as a "terminal" (tested on chemistry.htb)

  • MAWK0235/CVE-2024-23346 ★ 0 · Dec 9, 2024

    This is an exploit for CVE-2024-23346 that acts as a "terminal" (tested on chemistry.htb)

Sources: PoC-in-GitHub, Metasploit Framework, Exploit-DB — updated daily. Only links are listed; no exploit code is hosted here.

Affected packages

EcosystemPackageAffectedFixedRecord
PyPI pymatgen < 2024.2.20 2024.2.20 GHSA-vgv8-5cpj-qj2f

Advisories 1

References