CVE-2026-140095
8.7high
python-semver: super-quadratic ReDoS in _LAST_NUMBER via attacker-controlled version strings
- Severity
- 8.7high CVSS:4.0 by GitHub_M
- Exploit likelihood
- 0.58% (higher than 49% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
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.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| python-semver python-semver | < 3.1.3 | CVE List |
Classification
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-140095 changed 2026-11-30 | CVE Terms of Use |
| NVD | CVE-2026-140095 changed 2026-11-30 | Public domain |