{"id":"CVE-2026-55520","aliases":["CVE-2026-55520","GHSA-wjmf-p669-5m5p","PYSEC-2026-3906"],"related":[],"kind":"vulnerability","state":"published","title":"Protego: Exponential backtracking ReDoS in robots.txt URL wildcard matching","summary":"Protego is a pure-Python robots.txt parser with support for modern conventions. Prior to 0.6.2, protego._urlpattern._URLPattern._prepare_pattern_for_regex 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.can_fetch 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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Protego is a pure-Python robots.txt parser with support for modern conventions. Prior to 0.6.2, protego._urlpattern._URLPattern._prepare_pattern_for_regex 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.can_fetch 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.","source":"cvelist"},{"lang":"en","text":"### 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```","format":"markdown","source":"ghsa"}],"published":"2026-08-28T18:42:38.334Z","modified":"2026-09-10T12:25:43.026Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":7.1,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":7.1,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"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","rating":"HIGH"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:4.0","vector":"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"}],"cwes":["CWE-400","CWE-1333"],"affected":[{"ranges":[{"version":"< 0.6.2","status":"affected"}],"vendor":"scrapy","product":"protego","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"0.6.2"}],"ecosystem":"PyPI","package":"protego","purl":"pkg:pypi/protego","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"0.6.2"}],"ecosystem":"PyPI","package":"protego","purl":"pkg:pypi/protego","source":"pysec"}],"references":[{"url":"https://github.com/scrapy/protego/security/advisories/GHSA-wjmf-p669-5m5p","tags":["web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/scrapy/protego/commit/785940181659bf440ba82f1da148fade5087e858","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/scrapy/protego/releases/tag/0.6.2","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/scrapy/protego","tags":["package"],"sources":["ghsa","pysec"]},{"url":"https://pypi.org/project/protego","tags":["package"],"sources":["pysec"]},{"url":"https://github.com/advisories/GHSA-wjmf-p669-5m5p","tags":["advisory"],"sources":["pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-55520","tags":["advisory"],"sources":["pysec"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"yes","technicalImpact":"partial","date":"2026-08-31T15:42:18.385Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-55520","url":"https://www.cve.org/CVERecord?id=CVE-2026-55520","licence":"CVE Terms of Use","modified":"2026-08-31T18:54:01.091Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-wjmf-p669-5m5p","url":"https://github.com/advisories/GHSA-wjmf-p669-5m5p","licence":"CC-BY-4.0","modified":"2026-09-10T12:25:43.026Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-55520","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-55520","licence":"Public domain","modified":"2026-09-09T21:09:13.080Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-3906","url":"https://osv.dev/vulnerability/PYSEC-2026-3906","licence":"CC-BY-4.0","modified":"2026-09-10T12:15:12.559Z"}],"updatedAt":"2026-11-25T22:59:35.689Z","epss":{"score":0.00369,"percentile":0.32799,"date":"2026-12-01T12:00:22.000Z"}}