Description
In crawl4ai/utils.py (line 344), RobotsParser.can_fetch() issues the robots.txt request with ssl=False:
session.get(robots_url, timeout=2, ssl=False)
Certificate validation is disabled, so an on-path attacker (MITM, rogue DNS, malicious proxy) can impersonate the target host and feed arbitrary robots.txt content, silently controlling whether the crawler honors Disallow rules for the target site.
Impact is limited (robots.txt is an advisory protocol and the request carries no credentials), so I'm filing this as a hardening issue rather than a private security report.
Suggested fix
Keep TLS verification enabled for https:// URLs; allow opt-in disabling only for explicitly configured hosts:
ssl = parsed.scheme.lower() != "https" # or an explicit per-request override
Reproduction
- Route the target host through a proxy that presents a self-signed certificate.
- Observe the robots.txt request succeeding despite the invalid certificate, and the tampered
Disallow rules taking effect.
Description
In
crawl4ai/utils.py(line 344),RobotsParser.can_fetch()issues the robots.txt request withssl=False:Certificate validation is disabled, so an on-path attacker (MITM, rogue DNS, malicious proxy) can impersonate the target host and feed arbitrary robots.txt content, silently controlling whether the crawler honors
Disallowrules for the target site.Impact is limited (robots.txt is an advisory protocol and the request carries no credentials), so I'm filing this as a hardening issue rather than a private security report.
Suggested fix
Keep TLS verification enabled for
https://URLs; allow opt-in disabling only for explicitly configured hosts:Reproduction
Disallowrules taking effect.