All vulnerabilities

PyPI

CVE-2026-140095

python-semver: Super-quadratic ReDoS in _LAST_NUMBER via attacker-controlled version strings

Severity
High
Published
1 Dec 2026
Last changed
1 Dec 2026
Added to UpHeron
1 Dec 2026
Fixed in
3.1.3
Exploit chance
0.6% in the next 30 daysHigher than 49% of CVEs. EPSS by FIRST, 1 Dec 2026
Weakness
Regular expression denial of service (ReDoS) (CWE-1333)
Also known as
GHSA-3qgw-g8j9-rcg4
Sources
OSV.dev and GitHub

Description

python-semver/python-semver is the Python Semantic Versioning library published on PyPI as semver. At src/semver/version.py:95 it defines:

The pattern is used by bump_build() to find and increment the last numeric component of a version string's build metadata. Its outer repeated group (?:[^\d](\d+)[^\d])+ contains two unbounded [^\d]* quantifiers plus \d+, and adjacent repetitions can consume the same run of non-digit characters. When the build metadata is a long alphabetic string with no digits, the engine must try an enormous number of ways to divide that run among the quantifiers before the overall match fails, producing super-quadratic catastrophic backtracking, a CWE-1333 (Inefficient Regular Expression Complexity / ReDoS) condition.

The vulnerability is reachable end to end through the public API semver.Version.parse("1.0.0+" + "a" * N).bump_build(): the library's BUILD_IDENTIFIER rule is [0-9a-zA-Z-]+, so an arbitrarily long all-letter build identifier parses successfully…

From the GitHub Advisory Database, CC BY 4.0. Shortened; the full text is there.

Affected software

SoftwareAffected versions
semverPyPI · osv:PyPI:semver
  • Every version before 3.1.3

Status in Debian

Debian builds fixes into its own packages, so a release is often fixed under an older version number than the one upstream names.

  • 4 vulnerable
PackageDebian releaseStatus
python-semversidunstableVulnerableNo fix yet.
14forkytestingVulnerableNo fix yet.
13trixiestableVulnerableNo fix yet.
12bookwormoldstableVulnerableNo fix yet.

From Debian's security tracker for CVE-2026-140095 , read in the last 12 hours.

About semver

Weekly downloads (PyPI)
18,309,473PyPI Stats, 1 Dec 2026

This is the only vulnerability in semver in our list.

References