GHSA-wjmf-p669-5m5p: Pip/Protego vulnerability

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

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

Event History

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

Frequently Asked Questions

1

What conditions are required to trigger the parser freeze?

An attacker needs to supply a specially crafted robots.txt containing a directive value with many asterisks, and the application must parse it with Protego.parse(). The slowdown occurs when can_fetch() later matches a URL whose length drives the exponential backtracking.

2

Which deployments are realistically exposed?

Applications using pip/Protego to parse robots.txt and then evaluate URLs with Protego.can_fetch() are exposed when they process attacker-controlled or otherwise untrusted robots.txt content. The impact is a can_fetch() call that may not return for a period dependent on URL length.

3

How can I check whether my application is affected?

Review whether it uses Protego.parse() on robots.txt content and subsequently calls can_fetch(). The provided proof of concept uses a Disallow directive built from repeated "*1" sequences followed by "*Z" and a URL consisting of repeated "1" characters; a freezing or severely delayed can_fetch() call indicates exposure.

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