Arbitrary code execution via unsafe transformation eval
Published Feb 21, 2024 · Updated Aug 19, 2024
Code injection in Materials Project pymatgen before 2024.2.20 allows attackers to execute arbitrary code through a crafted CIF file. JonesFaithfulTransformation.from_transformation_str() inserts implicit multiplication operators, then passes attacker-controlled basis-change expressions to Python eval() with an ineffective built-ins restriction. Exploitation requires an application or local workflow to parse attacker-controlled CIF content, after which code runs with the parser process's privileges.
Summary
What happened
Code injection in Materials Project pymatgen before 2024.2.20 allows attackers to execute arbitrary code through a crafted CIF file. JonesFaithfulTransformation.from_transformation_str() inserts implicit multiplication operators, then passes attacker-controlled basis-change expressions to Python eval() with an ineffective built-ins restriction. Exploitation requires an application or local workflow to parse attacker-controlled CIF content, after which code runs with the parser process's privileges.
The record
- CVE
- CVE-2024-23346
- Published
- Feb 21, 2024
- Updated
- Aug 19, 2024
- Vendor
- Materials Project
- Product
- pymatgen
- Classifications
- CWE-77, T1204.002
- Attack vector
- local
- Privileges
- unauthenticated
Timeline
How it unfolded
- Feb 21, 2024CVE publishedPublication date reported by the CVE source.
- Aug 19, 2024Record updatedLatest update available in the CVE record.
Exploitability
Present is not the same as exploitable
Compare your product and version with the public record. A matching version still requires validation against your environment.
Is a vulnerable build present?
Compare these published version ranges with your installed build and any vendor patches.
- Affected versionversion=0 <2024.2.20
- Affected versionversion=< 2024.2.20
What conditions does exploitation require?
What is affected?
Attacks
What attackers are doing with it
Daily unique IPs observed by Shadowserver honeypots for known exploited vulnerabilities (KEVs). Missing observations do not establish an absence of attacks.
Weakness, pattern, technique
Public exploit references
- Crafted CIF transformation-string proof of conceptproof of concept · demonstrated
Labels summarize the accepted research assessment. They do not indicate a test against your environment.
Technologies
Your stack
See the directory against your own environment.
Your stack
Check the software in your environment
Book a demo to see how Hinoki identifies affected software and validates exploitability in your environment.
Book a demo