Skip to main content
Vulnerability Database/CVE-2026-77387

CVE-2026-77387: geopy Python Library DOS Vulnerability

CVE-2026-77387 is a denial of service vulnerability in the geopy Python geocoding library caused by inefficient regex processing of malformed coordinate strings. This article covers technical details, affected versions, and mitigation.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-77387 Overview

CVE-2026-77387 is a Regular Expression Denial of Service (ReDoS) vulnerability in geopy, a widely used geocoding library for Python. The flaw resides in geopy.Point and Point.from_string(), where the POINT_PATTERN regular expression exhibits pathological backtracking when parsing long, malformed coordinate strings. Geocoder reverse methods that accept string inputs also reach the vulnerable parsing path. Repeated attacker-controlled requests can exhaust CPU resources and cause application-level denial of service. The numeric Point constructor is not affected. The issue is fixed in geopy version 2.5.0 by capping input length at 256 characters [CWE-1333].

Critical Impact

Attackers who can submit coordinate strings to applications using geopy prior to 2.5.0 can trigger excessive CPU consumption, leading to denial of service.

Affected Products

  • geopy versions prior to 2.5.0
  • Python applications calling geopy.Point() with untrusted strings
  • Applications invoking geocoder reverse() methods with string inputs

Discovery Timeline

  • 2026-10-01 - CVE-2026-77387 published to NVD
  • 2026-10-02 - Last updated in NVD database

Technical Details for CVE-2026-77387

Vulnerability Analysis

The vulnerability is a classic Regular Expression Denial of Service (ReDoS) condition. The POINT_PATTERN regex used by Point.from_string() contains ambiguous subpatterns that cause catastrophic backtracking against adversarial input. When passed a long malformed coordinate string, the regex engine explores an exponential number of match paths before failing. CPU time grows disproportionately with input length, enabling denial of service with modest attacker bandwidth.

Root Cause

The root cause is inefficient regular-expression behavior in geopy/point.py with no bound on the length of strings submitted to POINT_PATTERN. Valid coordinate strings are short, so unbounded input provided no legitimate benefit while exposing the regex engine to pathological backtracking.

Attack Vector

An attacker supplies a long, malformed coordinate string to any code path that constructs a Point from a string or invokes a geocoder reverse() method with string input. Each request consumes significant CPU time on the server. Repeated submissions amplify the impact into a sustained denial of service against the hosting application or service worker pool.

python
     POINT_PATTERN = POINT_PATTERN

+    # Upper bound on the length of a string parsed by ``from_string``. A valid
+    # coordinate string is short (the longest realistic one is well under this),
+    # so longer inputs cannot be valid points. Capping the length keeps
+    # ``POINT_PATTERN`` from doing pathological amounts of backtracking on very
+    # long adversarial inputs (ReDoS, CWE-1333). See GH-608.
+    _MAX_STRING_LENGTH = 256
+
     def __new__(cls, latitude=None, longitude=None, altitude=None):
         """
         :param float latitude: Latitude of point.

Source: GitHub Commit 5d09fa8. The patch introduces a 256-character cap on strings passed to from_string, preventing the regex engine from processing adversarial inputs long enough to cause meaningful backtracking.

Detection Methods for CVE-2026-77387

Indicators of Compromise

  • Sustained high CPU usage in Python worker processes handling geocoding or coordinate parsing requests.
  • Request logs containing abnormally long coordinate parameters, typically well above 256 characters.
  • Elevated request latency or worker timeouts in endpoints that forward user input to geopy.Point or geocoder reverse() calls.

Detection Strategies

  • Enumerate project dependencies and flag any geopy version lower than 2.5.0 in software bills of materials (SBOMs).
  • Perform static code review for calls to geopy.Point(string) or geocoder reverse(string) where the string originates from user input.
  • Instrument application performance monitoring to alert on request handlers that exceed CPU time thresholds while invoking geopy functions.

Monitoring Recommendations

  • Monitor process-level CPU time per request on endpoints that accept location data.
  • Log and alert on inbound requests with coordinate fields exceeding a conservative length threshold (for example, 256 bytes).
  • Track upstream dependency advisories through GitHub Security Advisories, including GHSA-mhvh-fq92-pfmr.

How to Mitigate CVE-2026-77387

Immediate Actions Required

  • Upgrade geopy to version 2.5.0 or later in all affected applications and container images.
  • Audit application code for user-controlled strings reaching geopy.Point or geocoder reverse() methods.
  • Add input length validation at the application boundary for any field passed to coordinate parsing.

Patch Information

The fix is released in geopy 2.5.0 and implemented in commit 5d09fa8 via pull request #610, which resolves issue #608. The patch introduces _MAX_STRING_LENGTH = 256 to bound the input length processed by POINT_PATTERN.

Workarounds

  • Reject or truncate coordinate strings longer than 256 characters before passing them to geopy.
  • Prefer the numeric Point(latitude, longitude) constructor instead of string parsing where feasible.
  • Place a request-size limit or Web Application Firewall (WAF) rule in front of endpoints that accept location data.
bash
# Upgrade geopy to the patched release
pip install --upgrade "geopy>=2.5.0"

# Verify the installed version
python -c "import geopy; print(geopy.__version__)"

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.