PyPI: crawl4ai
GHSA-7cx2-g3h9-382p
Safety vulnerability ID: SFTY-20260616-67050
Affected versions of the Crawl4AI package are vulnerable to Arbitrary File Write due to improper validation of symlink paths. The `POST /screenshot` and `POST /pdf` endpoints accept an `output_path` parameter that was only string-validated against `ALLOWED_OUTPUT_DIR`, allowing symlink traversal to write files outside the intended directory. An attacker can exploit this by crafting a symlink within the allowed directory to a sensitive location, potentially achieving code execution if the runtime user has write permissions to executable directories, as the API is unauthenticated by default.
Overview
Crawl4AI: Arbitrary file write (symlink/TOCTOU) plus log and webhook-header injection in Docker server
Advisory
Crawl4AI – Path Traversal
How to Fix
Mitigation and Workarounds
---
Vulnerable Functions
Functions linked to known vulnerabilities.
References
- https://getsafety.com/vulnerabilities/SFTY-20260616-67050
- https://github.com/unclecode/crawl4ai/commit/aa81e8fe7d940dde8e6eec4beca178a8d6e0eb72
- https://github.com/unclecode/crawl4ai/security/advisories/GHSA-7cx2-g3h9-382p
- https://github.com/unclecode/crawl4ai/issues/1
- https://github.com/unclecode/crawl4ai/issues/2
- https://github.com/unclecode/crawl4ai/pull/3
- https://github.com/pypa/advisory-database/tree/main/vulns/crawl4ai/PYSEC-2026-228.yaml
- https://www.vulncheck.com/advisories/crawl4ai-arbitrary-file-write-via-output-path-symlink-and-toctou
- https://github.com/advisories/GHSA-7cx2-g3h9-382p
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
