Skip to content
CriticalVulnerability

GHSA-qxjp-w3pj-48m7: Crawl4AI: AST Sandbox Escape via gi_frame.f_back Chain - Pre-Auth RCE in Docker API

Published
Record updated
View JSON
Affected
  • crawl4ai <= 0.8.6
Fixed in
0.8.7
  • released June 1, 2026, 15 days before disclosure

Summary

Crawl4AI's `_safe_eval_expression()` function, used by computed fields, has an AST validator that blocks only attributes starting with an underscore. Attributes such as `gi_frame`, `f_back` and `f_builtins` pass that check, so a crafted `POST /crawl` request with a `JsonCssExtractionStrategy` schema can walk to the real `__import__` and run arbitrary commands. No authentication is needed because JWT is disabled by default, giving unauthenticated remote code execution inside the Docker container.

Mitigation

Fixed in the patched release: `eval()` was removed from the computed field expression path, `_safe_eval_expression()` and `_SAFE_EVAL_BUILTINS` were deleted, `/config/dump` now takes JSON validated by Pydantic, and the hook_manager sandbox was tightened. Workarounds: upgrade to the patched version; enable JWT authentication via the `CRAWL4AI_API_TOKEN` environment variable; restrict network access to the Docker API.