Python-semver
python-semver: super-quadratic ReDoS in _LAST_NUMBER via attacker-controlled version strings
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 versions and mitigation
From the CVE record and the vendor's references.Affected
- < 3.1.3
Fixed in 3.1.3
Mitigation
Upgrade python-semver to 3.1.3 or later.
References
- Vendor advisory github.com/python-semver/python-semver/securit…
- Patch github.com/python-semver/python-semver/commit/…
- Release notes github.com/python-semver/python-semver/release…
Timeline
Days relative to CVE publicationFirst public PoC 1.8 days after publication; not in CISA KEV. First PoC: googlesky/CVE-2026-140095 (created 2 Dec 2026, found by us: 2 Dec 2026).
PoC repositories
Found on GitHub.1 PoCs
PoCs 1
| Repository | Created | Found by us | Stars | Assessment |
|---|---|---|---|---|
| googlesky/CVE-2026-140095 | 2 Dec 2026 +1.8 d | 2 Dec 2026 | 0 | PoC |
Only PoCs count toward the first-PoC date and the characteristics below. Do not run PoC code from unknown sources.