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

Published Nov 30, 2026
·
Updated

python-semver is a Python package for working with Semantic Versioning. Prior to 3.1.3, semver.Version.parse accepted an arbitrarily long alphabetic BUILDIDENTIFIER and bumpbuild passed it through incrementstring to Version.LASTNUMBER 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 Software

1 affected component
pypi/python-semver<3.1.3

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 3.1.3

Event History

Nov 30, 2026
CVE Published
via MITRE·10:15 PM
Data Sourced
via MITRE·10:15 PM
DescriptionWeakness
Data Sourced
via OSV·10:15 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·11:17 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

What conditions must be met for exploitation?

An attacker must be able to supply a valid version string whose build identifier is arbitrarily long and alphabetic, and the application must pass it through semver.Version.parse and then bump_build. The denial of service occurs when the build identifier contains no digit, triggering super-quadratic regex backtracking.

2

Who is realistically exposed?

Applications that process attacker-controlled semantic version strings and invoke bump_build on the parsed version are exposed. The vulnerable behavior can monopolize the Python process, so services that handle such input synchronously are particularly at risk.

3

What should be done if immediate patching is not possible?

Restrict or reject unbounded build identifiers from untrusted inputs, especially long alphabetic identifiers without digits, before parsing or calling bump_build. Apply length limits to version strings and build metadata to prevent excessive regex processing.

4

How can I determine whether my deployment is affected?

Check whether python-semver is installed at a version earlier than 3.1.3 and whether your code accepts untrusted version strings that can reach Version.parse followed by bump_build. Version 3.1.3 contains the fix.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203