Protego (Python), ReDoS (Regular Expression Denial of Service), CVE-2026-55520 (High) -DC-Aug2026-2008

Listen to this Post

Protego is a pure-Python `robots.txt` parser with support for modern conventions. A critical ReDoS (Regular Expression Denial of Service) vulnerability, identified as CVE-2026-55520, exists in versions prior to 0.6.2.
The root cause of this vulnerability lies in how Protego processes the `Allow` and `Disallow` directives from a `robots.txt` file. Within the `protego._urlpattern._URLPattern._prepare_pattern_for_regex()` function, every asterisk () wildcard in a directive value is translated into a lazy `.?` regex piece. An attacker can exploit this by crafting a `robots.txt` file containing a `Disallow` or `Allow` directive with a large number of asterisks. When this malicious file is parsed using `Protego.parse()`, it generates a highly complex regular expression. The issue manifests when a subsequent URL matching attempt is made with `Protego.can_fetch()`. The regular expression engine, attempting to match a URL against this pattern, can enter a state of exponential backtracking. This means the matching process can take an extraordinarily long time, effectively freezing the crawler and leading to a denial of service. The vulnerable code path is located in `src/protego/_urlpattern.py`. The vulnerability is fixed in version 0.6.2 by performing wildcard matching without using regular expressions.
<h2 style="color: blue;">DailyCVE Form:</h2>
Platform: Python/Scrapy
Version: <0.6.2
Vulnerability: ReDoS
Severity: High
Date: 2026-08-28
<h2 style="color: blue;">Prediction: Already Patched (0.6.2)</h2>
<h2 style="color: blue;">What Undercode Say:</h2>
Analytics show that this vulnerability allows a server to cause a Denial of Service (DoS) against any crawler using the Protego library by serving a maliciously crafted `robots.txt` file. The attack is performed remotely over the network with low complexity and requires no privileges.
The following proof of concept demonstrates how a specially crafted `robots.txt` can trigger the vulnerability:

from protego import Protego
Crafted robots.txt with many asterisks to cause exponential backtracking
robotstxt = f"""
User-agent:
Disallow: /{"1" 12}Z
"""
rp = Protego.parse(robotstxt)
url = "/" + "1" 60
This call will freeze due to ReDoS
rp.can_fetch(url, "mybot")

<h2 style="color: blue;">Exploit: (Educational Purposes!)</h2>
To exploit this vulnerability, an attacker would need to control the `robots.txt` file served to a vulnerable crawler. The following steps outline the process:
1. Craft a Malicious robots.txt: Create a `robots.txt` file with a `Disallow` or `Allow` directive for a specific user-agent. The directive's value should contain an excessive number of asterisks (
) to generate a complex regex. For example:

User-agent: MyCrawler
Disallow: /A

2. Serve the Malicious File: Host this `robots.txt` file on a web server.
3. Trigger the Vulnerability: When a vulnerable crawler using Protego < 0.6.2 attempts to fetch and parse this `robots.txt` file, it will generate a regex prone to catastrophic backtracking.
4. Cause Denial of Service: The next time the crawler attempts to match a URL against this pattern (e.g., by calling can_fetch()), the regex engine will enter a state of exponential backtracking, consuming significant CPU resources and effectively freezing the crawler.

Protection:

The primary and most effective protection against this vulnerability is to update Protego to version 0.6.2 or later. This version fixes the issue by implementing wildcard matching without using regular expressions.

Impact:

Successful exploitation of this vulnerability leads to a Denial of Service (DoS). An attacker can cause a crawler to become unresponsive by forcing it to spend an attacker-controlled period of time attempting to match a URL. This can disrupt the crawler’s operations and potentially affect dependent services. The vulnerability has a CVSS v4.0 base score of 7.1, indicating a High severity.

🎯Let’s Practice Exploiting & Learn Patching For Free:

🎓 Live Courses & Certifications:

Join Undercode Academy for Verified Certifications

🚀 Request a Custom Project:

Secure, high-velocity infrastructure and disruptive technological engineering. Contact our engineering team for high-tier development and proprietary systems:
[email protected]
💎 Smart Architecture | 🛡️ Secure by Design | ⭐ Trusted by Thousands

Sources:

Reported By: github.com
Extra Source Hub:
Undercode

🔐JOIN OUR CYBER WORLD [ CVE News • HackMonitor • UndercodeNews ]

💬 Whatsapp | 💬 Telegram

📢 Follow DailyCVE & Stay Tuned:

𝕏 formerly Twitter 🐦 | @ Threads | 🔗 Linkedin Featured Image

Scroll to Top