CVE-2024-23346
Python vulnerability analysis and mitigation

Overview

A critical security vulnerability (CVE-2024-23346) was discovered in the Pymatgen (Python Materials Genomics) library's JonesFaithfulTransformation.from_transformation_str() method prior to version 2024.2.20. The vulnerability was disclosed on February 21, 2024, affecting all versions up to 2024.2.8. This open-source Python library for materials analysis contained a critical flaw that could allow arbitrary code execution (GitHub Advisory).

Technical details

The vulnerability exists in the JonesFaithfulTransformation.from_transformation_str() method, which insecurely utilizes the eval() function for processing input. Despite attempts to secure the eval() function by setting __builtins__ to None, the security measure could be bypassed through subclass traversal to recover the BuiltinImporter class. The vulnerability received a CVSS v3.1 base score of 9.3 (Critical) with vector string CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H, indicating local attack vector, low attack complexity, no privileges required, and high impact on confidentiality, integrity, and availability (GitHub Advisory).

Impact

The vulnerability allows attackers to execute arbitrary code when parsing untrusted input, particularly through maliciously crafted CIF files. This could lead to complete system compromise with high impacts on confidentiality, integrity, and availability of the affected system (GitHub Advisory).

Mitigation and workarounds

The vulnerability has been patched in version 2024.2.20 of the Pymatgen library. Users are strongly advised to upgrade to this version or later. The fix involves replacing the unsafe eval() implementation with a more secure parsing mechanism using sympy (GitHub Advisory).

Additional resources


SourceThis report was generated using AI

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

“Best User Experience I have ever seen, provides full visibility to cloud workloads.”
David EstlickCISO
“Wiz provides a single pane of glass to see what is going on in our cloud environments.”
Adam FletcherChief Security Officer
“We know that if Wiz identifies something as critical, it actually is.”
Greg PoniatowskiHead of Threat and Vulnerability Management