PyPI: crawl4ai
GHSA-2jq4-q6vv-4cp3
Safety vulnerability ID: SFTY-20260618-06125
Affected versions of the Crawl4AI package are vulnerable to Path Traversal due to improper handling of filenames derived from attacker-influenced input. The `AsyncHTTPCrawlerStrategy` and `AsyncPlaywrightCrawlerStrategy` in `crawl4ai/async_crawler_strategy.py` fail to sanitize filenames extracted from the `Content-Disposition` header and `suggested_filename`, respectively, allowing traversal outside the intended downloads directory. An attacker can exploit this by crafting filenames with absolute paths or `../` sequences, enabling arbitrary file writes with controlled content, potentially leading to Remote Code Execution by overwriting critical system files or scripts.
Overview
Crawl4AI: Arbitrary file write (path traversal) in crawler downloads can lead to RCE
Advisory
Crawl4AI – Path Traversal
How to Fix
Mitigation and Workarounds
---
Vulnerable Functions
Functions linked to known vulnerabilities.
Verified by Safety
Our Cybersecurity Intelligence Team reviewed this vulnerability. We combine public data with our own research to find issues not yet reported to public sources.
Learn more
