geopy through 2.5.0 contains a regular expression denial of service vulnerability in Point.fromstring() that allows remote attackers to exhaust CPU by supplying crafted strings under the 256-character cap. Attackers can send short strings of digits separated by runs of spaces with a trailing non-matching character to geopy.Point() or reverse(), pinning workers for minutes per request.
Impact
geopy.Point and Point.fromstring() may take excessive CPU time when parsing long, malformed coordinate strings due to inefficient regular-expression behavior. The numeric Point constructor is not affected.
Geocoders' reverse methods called with string inputs exercise the vulnerable path.
Applications are affected when they pass attacker-controlled strings to these APIs without an appropriate length limit. Repeated requests may cause denial of service.
Patches
Fixed in geopy 2.5.0 by rejecting overly long (over 256 characters) coordinate strings before parsing.
Workarounds
Limit coordinate strings to a reasonable maximum length, such as 256 characters, before passing them to geopy.