9.6critical
Crawl4AI arbitrary file write via download filename path traversal
- Severity
- 9.6critical CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.50% (higher than 44% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-2jq4-q6vv-4cp3PYSEC-2026-2138
Description
Crawl4AI is an open-source LLM-friendly web crawler and scraper. Prior to 0.9.0, when the crawler saves a downloaded file, the destination filename was taken from attacker-influenced input and joined to the downloads directory with no confinement. A filename containing an absolute path or traversal escaped the downloads directory, giving an arbitrary file write with attacker-controlled contents; the HTTP crawler path uses the response Content-Disposition filename and the browser crawler path uses the download's suggested filename. Because the written bytes are attacker-controlled, this can escalate to remote code execution. This issue is fixed in version 0.9.0.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| unclecode crawl4ai | < 0.9.0 | CVE List |
| crawl4ai (PyPI) | before 0.9.0 | GitHub Advisory Database, PyPA Advisory Database |
| kidocode crawl4ai | before 0.9.0 | NVD |
All scores
| GitHub_M | 9.6critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H |
| GitHub | 9.6critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H |
| PyPA Advisory Database | 9.6critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H |
Classification
What each source says
CVE List
Crawl4AI is an open-source LLM-friendly web crawler and scraper. Prior to 0.9.0, when the crawler saves a downloaded file, the destination filename was taken from attacker-influenced input and joined to the downloads directory with no confinement. A filename containing an absolute path or traversal escaped the downloads directory, giving an arbitrary file write with attacker-controlled contents; the HTTP crawler path uses the response Content-Disposition filename and the browser crawler path uses the download's suggested filename. Because the written bytes are attacker-controlled, this can escalate to remote code execution. This issue is fixed in version 0.9.0.
GitHub Advisory Database
Summary
When the crawler saves a downloaded file, the destination filename was taken from attacker-influenced input and joined to the downloads directory with no confinement. A filename containing an absolute path (e.g. /etc/cron.d/evil) or ../ traversal escaped the downloads directory, giving an arbitrary file write with attacker-controlled contents. Because the written bytes are attacker-controlled, this escalates to remote code execution (overwriting a shell rc-file, ~/.ssh/authorized_keys, a cron entry, or a Python module on the import path).
Affected paths
Two download sinks in crawl4ai/async_crawler_strategy.py:
- HTTP crawler (
AsyncHTTPCrawlerStrategy): the filename is parsed from the responseContent-Dispositionheader by_extract_filename()and written viaaiofiles.open(filepath, 'wb'). Reachable directly via the SDK, and via the unauthenticated Docker/crawlendpoint when anHTTPCrawlerConfigis supplied. - Browser crawler (
AsyncPlaywrightCrawlerStrategy): the download'ssuggested_filename(controllable by the visited page) is joined todownloads_pathand written viadownload.save_as().
The HTTP-strategy sink is reachable pre-auth on the default Docker deployment; both are reachable for SDK users simply by crawling an attacker-controlled URL. The default Playwright crawl path that does not trigger a download is unaffected.
Impact
Arbitrary file write with attacker-controlled content as the user running the crawler, escalating to remote code execution.
Fix
Both sinks now resolve the destination through a single hardened helper (_safe_download_filepath) that reduces the attacker-influenced name to a bare basename (dropping absolute paths and .. components) and re-checks, via realpath, that the resolved path stays inside the downloads root (defeating symlink/TOCTOU escapes). A traversal attempt is rejected; normal downloads are unchanged.
Workarounds
- Upgrade to the patched version (0.9.0).
- Run the crawler as an unprivileged user with a dedicated, isolated downloads directory on a volume with no sensitive paths writable.
- Enable authentication (
CRAWL4AI_API_TOKEN) on the Docker server.
Credits
Y4tacker - reported the Content-Disposition path traversal in the HTTP crawler with a clear PoC and a basename + realpath-containment fix recommendation.
NVD (es)
Crawl4AI es un rastreador y extractor web de código abierto compatible con LLM. Antes de la versión 0.9.0, cuando el rastreador guardaba un archivo descargado, el nombre del archivo de destino se tomaba de una entrada influenciada por el atacante y se unía al directorio de descargas sin confinamiento. Un nombre de archivo que contenía una ruta absoluta o de recorrido escapaba del directorio de descargas, permitiendo una escritura de archivo arbitraria con contenido controlado por el atacante; la ruta del rastreador HTTP utiliza el nombre de archivo Content-Disposition de la respuesta y la ruta del rastreador del navegador utiliza el nombre de archivo sugerido de la descarga. Dado que los bytes escritos están controlados por el atacante, esto puede escalar a ejecución remota de código. Este problema se solucionó en la versión 0.9.0.
References
| https://github.com/unclecode/crawl4ai/security/advisories/GHSA-2jq4-q6vv-4cp3 | evidence, exploit, mitigation, vendor-advisory, web | |
| https://github.com/unclecode/crawl4ai/commit/60886d1a0c52682e4c83a7cef9dfac417fff6bd2 | fix, patch | |
| https://github.com/unclecode/crawl4ai | package | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-57571 changed 2026-07-07 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-2jq4-q6vv-4cp3 changed 2026-07-13 | CC-BY-4.0 |
| NVD | CVE-2026-57571 changed 2026-10-25 | Public domain |
| PyPA Advisory Database | PYSEC-2026-2138 changed 2026-07-13 | CC-BY-4.0 |