# CVE-2026-140095: python-semver: super-quadratic ReDoS in _LAST_NUMBER via attacker-controlled version strings

- Severity: High 8.7 (CVSS:4.0, scored by GitHub_M) `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`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.58%, higher than 49% of CVEs (2026-12-01)
- Published: 2026-11-30T22:15:01.996Z
- Modified: 2026-12-01T19:15:03.122Z
- Also known as: GHSA-3qgw-g8j9-rcg4
- Weaknesses: CWE-1333
- 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.

(As written by CVE List.)

## Affected

- python-semver python-semver: < 3.1.3
- semver (PyPI): before 3.1.3

## Every score

- GitHub_M: CVSS:4.0 8.7 High `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`
- GitHub: CVSS:4.0 High `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`

## References

- <https://github.com/python-semver/python-semver/security/advisories/GHSA-3qgw-g8j9-rcg4> (web)
- <https://github.com/python-semver/python-semver/commit/fbf1e8f21c050256579de9199e53b6807e49014a> (web)
- <https://github.com/python-semver/python-semver/releases/tag/3.1.3> (web)
- <https://nvd.nist.gov/vuln/detail/CVE-2026-140095> (advisory)
- <https://github.com/python-semver/python-semver> (package)

## Sources

- CVE List: [CVE-2026-140095](https://www.cve.org/CVERecord?id=CVE-2026-140095), CVE Terms of Use, modified 2026-11-30
- GitHub Advisory Database: [GHSA-3qgw-g8j9-rcg4](https://github.com/advisories/GHSA-3qgw-g8j9-rcg4), CC-BY-4.0, modified 2026-12-01
- NVD: [CVE-2026-140095](https://nvd.nist.gov/vuln/detail/CVE-2026-140095), Public domain, modified 2026-11-30

---

Page: https://cve.day/CVE-2026-140095 · Whole record: https://cve.day/CVE-2026-140095.json · Rebuilt by cve.day 2026-12-01T19:47:32.550Z
