CVE-2022-42964
High · 7.5CVSS
7.5
EPSS
0.9%
Published
Nov 9, 2022
CISA due date
—
Cloudanix analysis
A materials-science software library can be tricked into using all its computing power on specially crafted data, making any program that uses the library slow down or stop working.
- Exploitation
- Remote Unauthenticated
- Attacker needs
- None
- Complexity
- Low
- Impact
- Denial Of Service
- Component
- Library
- Class
- Denial of service
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Triggers catastrophic backtracking in a regular expression inside GaussianInput.from_string, causing the Python process to consume CPU indefinitely and resulting in denial of service.
Why it matters to the business
Applications or services that parse untrusted Gaussian input files become unresponsive or exhaust resources, interrupting scientific workflows and potentially requiring manual restarts.
How an attack unfolds
An attacker supplies a specially crafted string containing repeated patterns that trigger exponential regex backtracking to the from_string method; because the call is reachable over the network or via file upload in many pymatgen consumers, the single request or file causes sustained high CPU usage without authentication.
How to fix it
Upgrade pymatgen to a version containing a patched regex; until a fixed release is available, wrap calls to from_string with input-length limits or timeouts and avoid processing untrusted Gaussian files.
How to confirm the fix worked
Test the from_string method with known ReDoS payloads while monitoring CPU time; confirm that processing completes within expected bounds after upgrade or mitigation.
Typical attack path
- Locate an application or service that accepts user-supplied data and passes it to pymatgen GaussianInput.from_string
- Craft an input string engineered to produce catastrophic backtracking in the vulnerable regex
- Submit the malicious string via network request, file upload, or API call
- Observe sustained high CPU consumption and eventual service degradation or crash
How to detect it
Review application logs and system metrics for sudden spikes in CPU usage correlated with calls involving Gaussian input parsing; examine web-server or application logs for unusually long request durations or repeated submissions to endpoints that invoke from_string.
What your security team should do
- Inventory all deployments that import pymatgen and identify code paths calling GaussianInput.from_string
- Apply input sanitization or timeouts immediately where upgrades are not yet possible
- Monitor for availability of a patched pymatgen release and schedule upgrade
- Add resource-usage alerts for Python processes handling Gaussian input
The record
An exponential ReDoS (Regular Expression Denial of Service) can be triggered in the pymatgen PyPI package, when an attacker is able to supply arbitrary input to the GaussianInput.from_string method
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| PyPI | pymatgen | 0 | No fix |
| Debian:12 | pymatgen | 0 | No fix |
| Debian:13 | pymatgen | 0 | 2023.06.23+dfsg1-1 |
| Ubuntu:22.04:LTS | pymatgen | 0 | No fix |
| Ubuntu:24.10 | pymatgen | 0 | 2024.1.27+dfsg1-7ubuntu1 |
| pypi | pymatgen | 0 | No fix |
Related vulnerabilities
- CVE-2026-62864 Ring is a Clojure web applications library inspired by Python's WSGI and Ruby's Rack. CWE-1333
- CVE-2026-119300 Wekan is open source kanban built with Meteor. CWE-1333
- CVE-2026-118993 CallBackery versions before 0.62.0 for Perl allow denial of service via the request path… CWE-1333
- CVE-2026-115866 Starlet versions from 0.20 before 0.33 for Perl allow CPU exhaustion via regular… CWE-1333
- CVE-2026-119202 @hapi/content provides HTTP Content-* header parsing. CWE-1333
- CVE-2026-118779 Forge (also called node-forge) is a native implementation of Transport Layer Security in… CWE-1333
- CVE-2026-118772 joi is a schema description language and data validator for JavaScript. CWE-1333
- CVE-2026-118686 EspoCRM before 9.3.11 and 10.x before 10.0.8 contains a denial of service vulnerability… CWE-1333