python-semver is a Python package for working with Semantic Versioning. Prior to 3.1.3, semver.Version.parse accepted an arbitrarily long alphabetic BUILD_IDENTIFIER and bump_build passed it through _increment_string to Version._LAST_NUMBER in src/semver/version.py. The expression contained ambiguous repeated non-digit quantifiers around a required digit run, causing super-quadratic backtracking when no digit was present and allowing an attacker-controlled valid version string to monopolize the Python process and deny service. This issue is fixed in version 3.1.3.
Advisories
Source ID Title
Github GHSA Github GHSA GHSA-3qgw-g8j9-rcg4 python-semver: Super-quadratic ReDoS in _LAST_NUMBER via attacker-controlled version strings
Fixes

Solution

No solution given by the vendor.


Workaround

No workaround given by the vendor.

History

Mon, 30 Nov 2026 22:30:00 +0000

Type Values Removed Values Added
Description python-semver is a Python package for working with Semantic Versioning. Prior to 3.1.3, semver.Version.parse accepted an arbitrarily long alphabetic BUILD_IDENTIFIER and bump_build passed it through _increment_string to Version._LAST_NUMBER in src/semver/version.py. The expression contained ambiguous repeated non-digit quantifiers around a required digit run, causing super-quadratic backtracking when no digit was present and allowing an attacker-controlled valid version string to monopolize the Python process and deny service. This issue is fixed in version 3.1.3.
Title python-semver: super-quadratic ReDoS in _LAST_NUMBER via attacker-controlled version strings
Weaknesses CWE-1333
References
Metrics cvssV4_0

{'score': 8.7, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N'}


Projects

Sign in to view the affected projects.

cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-11-30T22:15:01.996Z

Reserved: 2026-11-30T20:55:13.434Z

Link: CVE-2026-140095

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Received

Published: 2026-11-30T23:17:24.080

Modified: 2026-11-30T23:17:24.080

Link: CVE-2026-140095

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-12-01T16:15:03Z

Weaknesses