Cloudanix VulnDB

CVE-2022-42964

High · 7.5

CVSS

7.5

EPSS

0.9%

Published

Nov 9, 2022

CISA due date

—

Cloudanix analysis

Monitor only SSVC: Track

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.

Exploit Available
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

  1. Locate an application or service that accepts user-supplied data and passes it to pymatgen GaussianInput.from_string
  2. Craft an input string engineered to produce catastrophic backtracking in the vulnerable regex
  3. Submit the malicious string via network request, file upload, or API call
  4. 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