CVE-2026-55520: Protego: Exponential backtracking ReDoS in robots.txt URL wildcard matching

Published Aug 28, 2026
·
Updated

Problem description

Protego constructs regular expressions to match URLs against robots.txt Allow: and Disallow: directives, see protego.urlpattern.URLPattern.preparepatternforregex(). 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.canfetch() results in the latter call not returning for a period dependent on the length of the URL.

Proof of concept

python from protego import Protego

robotstxt = f""" User-agent: Disallow: /{"1" 12}Z """ rp = Protego.parse(robotstxt) url = "/" + "1" 60 rp.canfetch(url, "mybot") # freezes

Other sources

Protego is a pure-Python robots.txt parser with support for modern conventions. Prior to 0.6.2, protego.urlpattern.URLPattern.preparepatternforregex 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.canfetch 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.

MITRE

Affected Software

1 affected componentFixes available
pip/Protego<=0.6.1
0.6.2

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade pip/Protego to a version that resolves this vulnerability.

    Fixed in 0.6.2
  2. Upgrade

    Upgrade protego to a version that resolves this vulnerability.

    Fixed in 0.6.2

Event History

Aug 28, 2026
CVE Published
via MITRE·06:42 PM
Data Sourced
via MITRE·06:42 PM
DescriptionWeakness
Advisory Published
via GitHub·06:43 PM
Data Sourced
via GitHub·06:43 PM
DescriptionWeaknessAffected Software

Frequently Asked Questions

1

What must an attacker control to trigger the issue?

They need to supply a specially crafted robots.txt containing a directive value with many asterisks. The application must parse that file with Protego and subsequently evaluate a URL against it using can_fetch().

2

When does the application become unresponsive?

The excessive processing occurs during the can_fetch() URL-matching call, rather than when Protego.parse() parses the robots.txt file. The duration depends on the length of the URL being matched.

3

Which configurations are exposed?

Any use of Protego that parses attacker-controlled or otherwise untrusted robots.txt content and calls can_fetch() on it is exposed. The provided example uses a User-agent: * Disallow: directive.

4

What version contains the fix?

The referenced Protego release 0.6.2 includes the fix.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203