Vulnerabilities in pkg:pypi/Protego

PACKAGE
Advisory Identifier: GHSA-wjmf-p669-5m5p
Advisory Summary

CVE-2026-55520 is a HIGH denial of service vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting Protego libraries in the PyPI ecosystem. The issue involves protego has exponential backtracking redos in robots.txt url wildcard matching. Remediation is available by upgrading affected packages to version 0.6.2.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:pypi/Protego

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:pypi/Protego. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-wjmf-p669-5m5p CVE-2026-55520 HIGH Protego has exponential backtracking ReDoS in robots.txt URL wildcard matching

CVE-2026-55520 at a Glance

CVE Identifier CVE-2026-55520
GHSA Identifier GHSA-wjmf-p669-5m5p
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-400: Uncontrolled Resource Consumption
Affected Product Protego
Package Ecosystem PyPI
Published Date
Last Updated

How to Fix CVE-2026-55520

To remediate this vulnerability, upgrade all affected Protego dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

Protego fixed: 0.6.2
pip install Protego>=0.6.2
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show Protego

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2026-55520, inspect your installed packages using pip:

pip show Protego

Analyze the terminal output to locate any version of Protego in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.6.2), your application is affected.

Note: The pip show Protego command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-400: Uncontrolled Resource Consumption, where the product does not properly control the allocation and maintenance of a limited resource. In Protego, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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 ```python 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 ```

CVE-2026-55520 Affected Protego Versions

1 component(s)
Fixed Versions:
0.6.2
Product / Package Ecosystem Affected Versions Fixed Version
Protego
PyPI
< 0.6.2
0.6.2

References

Frequently Asked Questions

What is CVE-2026-55520?
CVE-2026-55520 is a security vulnerability in Protego involving Protego has exponential backtracking ReDoS in robots.txt URL wildcard matching under CWE-400: Uncontrolled Resource Consumption.
Which Protego versions are affected?
Affected versions include releases prior to 0.6.2 across affected packages: Protego.
What version fixes CVE-2026-55520?
Upgrading to 0.6.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is Protego affected?
Yes, Protego is affected in releases prior to 0.6.2. Upgrade your dependency to 0.6.2 or later.
What CWE is associated with CVE-2026-55520?
CVE-2026-55520 is classified under CWE-400: Uncontrolled Resource Consumption (The product does not properly control the allocation and maintenance of a limited resource.).
How can I check PyPI dependencies for CVE-2026-55520?
Run the dependency tree command: 'pip show Protego'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-wjmf-p669-5m5p",
  "modified" : "2026-08-28T18:43:02Z",
  "published" : "2026-08-28T18:43:02Z",
  "aliases" : [ "CVE-2026-55520" ],
  "summary" : "Protego has exponential backtracking ReDoS in robots.txt URL wildcard matching",
  "details" : "### Problem description\n\nProtego 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.\n\n### Impact\n\nParsing 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.\n\n### Proof of concept\n\n```python\nfrom protego import Protego\n\nrobotstxt = f\"\"\"\nUser-agent: *\nDisallow: /{\"*1\" * 12}*Z\n\"\"\"\nrp = Protego.parse(robotstxt)\nurl = \"/\" + \"1\" * 60\nrp.can_fetch(url, \"mybot\")  # freezes\n```",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "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"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "Protego"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.6.2"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 0.6.1"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/scrapy/protego/security/advisories/GHSA-wjmf-p669-5m5p"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/scrapy/protego/commit/785940181659bf440ba82f1da148fade5087e858"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/scrapy/protego"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/scrapy/protego/releases/tag/0.6.2"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-1333", "CWE-400" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-08-28T18:43:02Z",
    "nvd_published_at" : null
  }
}