Read the docs

ReDoS in python-semver via attacker-controlled version strings

Priority MEDIUM 53CWE-1333Published · Updated

Key facts

Attack vector
Network
Privileges required
None
User interaction
None
Attack complexity
Low
Attack requirements
None
Impact type
Denial of service
Confidentiality · integrity · availability
None · None · High
Fix status
Fixed

Attack profile from CVSS 4.0 · CNA. Fix status from CNA. Impact type from CWE-1333.

Summary

python-semver before 3.1.3 is affected. semver.Version.parse accepts an arbitrarily long alphabetic build identifier, and an ambiguous regular expression in _LAST_NUMBER causes super-quadratic backtracking when no digit is present (CWE-1333). An unauthenticated remote attacker can send a valid version string to monopolize the Python process and cause denial of service.

Written with Claude Haiku 5.5 from the sources below · 2026-11-30

Description from the CNA

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.

Why it matters now

Fix Fixed python-semver (python-semver): 3.1.3

SSVC decision points

Not available: CISA has not published SSVC decision points for this record.

Affected products

VendorProductAffected versionsFixed inStatusSource
python-semverpython-semverbefore 3.1.33.1.3Patch availableCNA
  • python-semver Vendorpython-semver Affected before 3.1.3 Fixed in 3.1.3 Patch available CNA

Remediation

Upgrade python-semver to version 3.1.3, which fixes the issue.

Written with Claude Haiku 5.5 from the sources below · 2026-11-30

  • Fix · CNA python-semver (python-semver) Fixed in 3.1.3

Timeline

  1. 2026-11-30 Threatist record created from CVE-2026-140095

References

Sources

This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences