cvelo
P2 · HighCVSS 8.7EPSS 0.9%

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

  • CVE-2026-140095
  • GHSA-3qgw-g8j9-rcg4
  • EUVD-2026-139743

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.

Text from the CVE.org record.

Recommendation

No source states a fixed version. Check the vendor advisory.

Affected

  • python-semver

    Affected versionsFixed in
    < 3.1.3none stated
  • semverPyPI

    Affected versionsFixed in
    up to 3.1.2none stated

Product versions from the CVE.org record.

Timeline

  1. Published

Related news

No article from the followed outlets names this vulnerability.