CVE-2026-53753: Crawl4AI: AST Sandbox Escape via gi_frame.f_back Chain - Pre-Auth RCE in Docker API
Summary The safeevalexpression() function in the computed fields feature uses an AST validator that only blocks attributes starting with underscore. Python generator and frame object attributes (giframe, fback, fbuiltins) do NOT start with underscore, enabling a complete sandbox escape to achieve arbitrary code execution.
Published Jun 16, 2026 · Updated Jul 20, 2026
Affected packages
crawl4ai
- Ecosystem
- PyPI
- Affected
- <= 0.8.6
- Fixed in
- 0.8.7
- Check
pip show crawl4ai
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
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:
- Creates a generator to access
gi_frame - Walks the frame chain via
f_back - Reaches
f_builtinscontaining the real__import__ - Imports
osand executes arbitrary commands
Impact
Unauthenticated remote code execution inside the Docker container. An attacker can execute arbitrary system commands, read/write files, and exfiltrate secrets.
Fix Details
- Removed
eval()from computed field expression path entirely -- expressions now log a warning and return default value - Deleted
_safe_eval_expression()function and_SAFE_EVAL_BUILTINS(dead security-sensitive code) functionkey with Python callables still works for SDK users- Replaced
eval()in/config/dumpwith JSON-based input validated by Pydantic - Fixed hook_manager sandbox: stripped
__builtins__,__loader__,__spec__from injected modules; removedgetattr,setattr,type,__build_class__from allowed builtins
Workarounds
- Upgrade to the patched version (recommended)
- Enable JWT authentication via
CRAWL4AI_API_TOKENenvironment variable - Restrict network access to the Docker API
Credits
Credited to q1uf3ng, August829, ntohidi.
References
- https://github.com/unclecode/crawl4ai/security/advisories/GHSA-qxjp-w3pj-48m7
- https://github.com/unclecode/crawl4ai/pull/1855
- https://github.com/unclecode/crawl4ai/pull/1886
- https://nvd.nist.gov/vuln/detail/CVE-2026-53753
- https://github.com/advisories/GHSA-qxjp-w3pj-48m7
- https://github.com/pypa/advisory-database/tree/main/vulns/crawl4ai/PYSEC-2026-319.yaml
- https://github.com/unclecode/crawl4ai
- https://pypi.org/project/crawl4ai
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More PyPI vulnerabilities
All PyPI entriesCVE-2026-56265
Crawl4AI: authentication bypass vulnerability due to a hardcoded default JWT signing key in the Docker API server
critical9.8Jun 21, 2026GHSA-2jq4-q6vv-4cp3
Crawl4AI: Arbitrary file write (path traversal) in crawler downloads can lead to RCE
critical9.6Jun 18, 2026GHSA-r253-r9jw-qg44
Crawl4AI: Unauthenticated RCE via Chromium launch-argument injection in browser_config.extra_args
critical10.0Jun 18, 2026CVE-2026-56266
Crawl4AI: Multiple Docker API Vulnerabilities - File Write, SSRF, Auth Bypass, XSS, JS Execution
critical9.8Jun 16, 2026CVE-2026-26217
Crawl4AI Has Local File Inclusion in Docker API via file:// URLs
critical8.6Jan 16, 2026
