---
id: CVE-2022-42964
aliases:
  - GHSA-5jqp-885w-xj32
  - PYSEC-2026-909
title: pymatgen is vulnerable to Regular Expression Denial of Service (ReDoS)
summary: pymatgen is vulnerable to Regular Expression Denial of Service (ReDoS)
severity: medium
cvss: 5.9
cvssVector: 'CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H'
vendor: pymatgen
product: pymatgen
ecosystem: pip
affected:
  - pymatgen <= 2022.9.21
published: '2022-11-10'
updated: '2026-07-07'
source: OSV
sourceUrl: 'https://osv.dev/vulnerability/GHSA-5jqp-885w-xj32'
references:
  - url: 'https://nvd.nist.gov/vuln/detail/CVE-2022-42964'
  - url: 'https://github.com/materialsproject/pymatgen/issues/2755'
  - url: 'https://github.com/materialsproject/pymatgen'
  - url: 'https://research.jfrog.com/vulnerabilities/pymatgen-redos-xray-257184'
tags:
  - osv
  - pip
epss: 0.00862
epssPercentile: 0.57067
ingestedAt: '2026-07-08T18:25:46.026Z'
---

## Overview

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

- `pymatgen <= 2022.9.21`

## Remediation

Refer to the advisory for the patched release.
