Executive brief
Crawl4AI is an open-source tool used to crawl and scrape web content for use with Large Language Models (LLMs). A security flaw in its data extraction feature allows an unauthenticated attacker to bypass security restrictions and execute arbitrary commands on the server or within the Docker container. This could lead to a complete system takeover, unauthorized access to sensitive data, and the ability to modify or delete files.
Technical details
A sandbox escape vulnerability exists in Crawl4AI's `_safe_eval_expression()` function within the computed fields feature. The Abstract Syntax Tree (AST) validator implemented to secure expressions only filtered attributes starting with an underscore. However, Python generator and frame object attributes such as `gi_frame`, `f_back`, and `f_builtins` do not start with underscores, allowing an attacker to traverse the frame chain to reach `__import__` and execute arbitrary system commands. The attack is reachable via a `POST /crawl` request using a crafted `JsonCssExtractionStrategy` schema. This vulnerability is fixed in version 0.8.7 by removing the use of `eval()` in the computed field expression path.
Affected products
- unclecode crawl4ai < 0.8.7
Timeline
- 2026-06-02: advisory: GitHub Security Advisory published
- 2026-06-23: disclosed: NVD publication date
- 2026-08-07: patched: Fixed in version 0.8.7