ZeroHour

CVE-2026-55520

large

Regex Denial of Service (ReDoS) in Protego robots.txt parser before 0.6.2

CVSS 4.0
7.1 high
EPSS
<1%p30
Published
()
Modified
AI analysis

Protego before 0.6.2 contains a regular-expression denial-of-service flaw: the _prepare_pattern_for_regex routine in src/protego/_urlpattern.py translates every asterisk in an Allow or Disallow directive into a lazy regex wildcard, so a directive containing many asterisks causes exponential backtracking in the _URLPattern match logic. An attacker who controls the robots.txt served by a site being crawled can craft such a directive, and after the crawler parses it with Protego.parse, a call to Protego.can_fetch on a near-miss URL can take an attacker-controlled amount of time to complete. The attacker gains denial of service against the crawler (CPU-bound stalls that can hang or slow a crawl), with no confidentiality or integrity impact, reflected in the CVSS 4.0 score of 7.1 with High impact to availability only. Anyone running a crawler that uses a vulnerable Protego version to fetch robots.txt from third-party or attacker-influenced sites is affected, including Python crawling frameworks that bundle protego as their robots.txt parser. No public proof-of-concept is known, the issue is not in CISA KEV, and EPSS currently estimates a 0.4% probability of exploitation within 30 days.

What to do: Upgrade protego to 0.6.2 or later (e.g., pip install -U 'protego>=0.6.2') in every crawler environment, and verify the resolved version with pip show protego, since other packages may pin older versions. As an interim mitigation, avoid crawling untrusted or user-submitted domains, bound robots.txt size/complexity, and enforce per-request timeouts so a stalled can_fetch() call cannot hang crawl workers.

Affected
Protego project (PyPI package: protego) Protego pure-Python robots.txt parserall versions prior to 0.6.2 (fixed in 0.6.2)
Estimated exposure
large≈ hundreds of thousands of Python crawler deployments/users (protego is a bundled dependency of widely used Python crawler frameworks, with millions of monthly… — No install counts appear in the advisory data, so this order-of-magnitude estimate relies on deployment patterns: protego is distributed on PyPI and embedded as the default robots.txt parser in major Python crawler tooling, putting the…

Order-of-magnitude estimate by the model from install counts, market share and public scan data it knows; verify before quoting.

Description

Protego is a pure-Python robots.txt parser with support for modern conventions. Prior to 0.6.2, protego._urlpattern._URLPattern._prepare_pattern_for_regex translates every asterisk in an Allow or Disallow directive into a lazy regular-expression wildcard, so a directive containing many asterisks creates exponential backtracking. After protego.Protego.parse processes a crafted robots.txt file, protego.Protego.can_fetch can spend an attacker-controlled period matching a near-miss URL and deny service to the crawler. The vulnerable path is src/protego/_urlpattern.py in the _URLPattern match logic. This issue is fixed in version 0.6.2.

Weakness
CWE-400, CWE-1333
Vector
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X

In the news

No ingested article mentions this CVE yet.