{"id":"CVE-2026-57571","aliases":["CVE-2026-57571","GHSA-2jq4-q6vv-4cp3","PYSEC-2026-2138"],"related":[],"kind":"vulnerability","state":"published","title":"Crawl4AI arbitrary file write via download filename path traversal","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### Summary\n\nWhen 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).\n\n### Affected paths\n\nTwo download sinks in `crawl4ai/async_crawler_strategy.py`:\n- HTTP crawler (`AsyncHTTPCrawlerStrategy`): the filename is parsed from the response `Content-Disposition` header by `_extract_filename()` and written via `aiofiles.open(filepath, 'wb')`. Reachable directly via the SDK, and via the unauthenticated Docker `/crawl` endpoint when an `HTTPCrawlerConfig` is supplied.\n- Browser crawler (`AsyncPlaywrightCrawlerStrategy`): the download's `suggested_filename` (controllable by the visited page) is joined to `downloads_path` and written via `download.save_as()`.\n\nThe 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.\n\n### Impact\n\nArbitrary file write with attacker-controlled content as the user running the crawler, escalating to remote code execution.\n\n### Fix\n\nBoth 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.\n\n### Workarounds\n\n- Upgrade to the patched version (0.9.0).\n- Run the crawler as an unprivileged user with a dedicated, isolated downloads directory on a volume with no sensitive paths writable.\n- Enable authentication (`CRAWL4AI_API_TOKEN`) on the Docker server.\n\n### Credits\n\nY4tacker - reported the Content-Disposition path traversal in the HTTP crawler with a clear PoC and a basename + realpath-containment fix recommendation.","format":"markdown","source":"ghsa"},{"lang":"es","text":"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.","source":"nvd"}],"published":"2026-06-18T17:25:13.000Z","modified":"2026-10-25T20:10:00.147Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H","score":9.6,"rating":"CRITICAL"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H","score":9.6,"rating":"CRITICAL"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H","score":9.6,"rating":"CRITICAL"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H","score":9.6,"rating":"CRITICAL"}],"cwes":["CWE-22","CWE-59"],"affected":[{"ranges":[{"version":"< 0.9.0","status":"affected"}],"vendor":"unclecode","product":"crawl4ai","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"0.9.0"}],"ecosystem":"PyPI","package":"crawl4ai","purl":"pkg:pypi/crawl4ai","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"0.9.0"}],"vendor":"kidocode","product":"crawl4ai","cpe":"cpe:2.3:a:kidocode:crawl4ai:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"0.9.0"}],"ecosystem":"PyPI","package":"crawl4ai","purl":"pkg:pypi/crawl4ai","source":"pysec"}],"references":[{"url":"https://github.com/unclecode/crawl4ai/security/advisories/GHSA-2jq4-q6vv-4cp3","tags":["evidence","exploit","mitigation","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/unclecode/crawl4ai/commit/60886d1a0c52682e4c83a7cef9dfac417fff6bd2","tags":["fix","patch","x-refsource-misc"],"sources":["cvelist","nvd","pysec"]},{"url":"https://github.com/unclecode/crawl4ai","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"total","date":"2026-07-07T14:53:33.142Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-57571","url":"https://www.cve.org/CVERecord?id=CVE-2026-57571","licence":"CVE Terms of Use","modified":"2026-07-07T14:53:40.859Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-2jq4-q6vv-4cp3","url":"https://github.com/advisories/GHSA-2jq4-q6vv-4cp3","licence":"CC-BY-4.0","modified":"2026-07-13T07:26:47.459Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-57571","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-57571","licence":"Public domain","modified":"2026-10-25T20:10:00.147Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-2138","url":"https://osv.dev/vulnerability/PYSEC-2026-2138","licence":"CC-BY-4.0","modified":"2026-07-13T07:15:22.880Z"}],"updatedAt":"2026-11-25T22:59:27.263Z","epss":{"score":0.00502,"percentile":0.44548,"date":"2026-12-01T12:00:22.000Z"}}