crawl4ai
Affected
- introduced
0, fixed0.8.0(ecosystem)
Fixed versions
0.8.0
Fix
- Fixed version
0.8.0pip install --upgrade crawl4ai==0.8.0
Advisory
Also known as: CVE-2026-26216, PYSEC-2026-33
Crawl4AI is Vulnerable to Remote Code Execution in Docker API via Hooks Parameter
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"
}
}
}
Impact
An unauthenticated attacker can:
Mitigation
/crawl endpoint at network levelFix Details
__import__ from allowed_builtins in hook_manager.pyCRAWL4AI_HOOKS_ENABLED=false)Credits
Discovered by Neo by ProjectDiscovery (https://projectdiscovery.io)
Critical Basis: The source's own band: CRITICAL
0, fixed 0.8.0 (ecosystem)0.8.0
0.8.0pip install --upgrade crawl4ai==0.8.0Fix 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: GitHub Advisory Database (reviewed advisories) · CC BY 4.0