crawl4ai
Affected
- introduced
0, fixed0.8.7(ecosystem)
Fixed versions
0.8.7
Fix
- Fixed version
0.8.7pip install --upgrade crawl4ai==0.8.7
Advisory
Also known as: CVE-2026-53753, GHSA-qxjp-w3pj-48m7
Crawl4AI: AST Sandbox Escape via gi_frame.f_back Chain - Pre-Auth RCE in Docker API
Summary
The _safe_eval_expression() function in the computed fields feature uses an AST validator that only blocks attributes starting with underscore. Python generator and frame object attributes (gi_frame, f_back, f_builtins) do NOT start with underscore, enabling a complete sandbox escape to achieve arbitrary code execution.
The attack requires no authentication (JWT disabled by default) and is triggered via POST /crawl with a crafted extraction schema.
Attack Vector
An attacker sends a POST /crawl request with a JsonCssExtractionStrategy schema containing a malicious computed field expression that:
gi_framef_backf_builtins containing the real __import__os and executes arbitrary commandsImpact
Unauthenticated remote code execution inside the Docker container. An attacker can execute arbitrary system commands, read/write files, and exfiltrate secrets.
Fix Details
eval() from computed field expression path entirely -- expressions now log a warning and return default value_safe_eval_expression() function and _SAFE_EVAL_BUILTINS (dead security-sensitive code)function key with Python callables still works for SDK userseval() in /config/dump with JSON-based input validated by Pydantic__builtins__, __loader__, __spec__ from injected modules; removed getattr, setattr, type, __build_class__ from allowed builtinsWorkarounds
CRAWL4AI_API_TOKEN environment variableCredits
Critical Basis: CVSS v3 score 9.8, vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
0, fixed 0.8.7 (ecosystem)0.8.7
0.8.7pip install --upgrade crawl4ai==0.8.7Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.
Check your own computer: guard packages check
Source: PyPA Advisory Database · CC BY 4.0