{"id":"CVE-2026-26216","aliases":["GHSA-5882-5rx9-xgxp","PYSEC-2026-33"],"url":"https://o3.security/vulnerability/CVE-2026-26216","summary":"Crawl4AI < 0.8.0 Docker API Unauthenticated Remote Code Execution via Hooks Parameter","details":"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.\n\n**Attack Vector:**\n```json\nPOST /crawl\n{\n  \"urls\": [\"https://example.com\"],\n  \"hooks\": {\n    \"code\": {\n      \"on_page_context_created\": \"async def hook(page, context, **kwargs):\\n    __import__('os').system('malicious_command')\\n    return page\"\n    }\n  }\n}\n```\n\n### Impact\n\nAn unauthenticated attacker can:\n- Execute arbitrary system commands\n- Read/write files on the server\n- Exfiltrate sensitive data (environment variables, API keys)\n- Pivot to internal network services\n- Completely compromise the server\n\n### Mitigation\n\n1. **Upgrade to v0.8.0** (recommended)\n2. If unable to upgrade immediately:\n   - Disable the Docker API\n   - Block `/crawl` endpoint at network level\n   - Add authentication to the API\n\n### Fix Details\n\n1. Removed `__import__` from `allowed_builtins` in `hook_manager.py`\n2. Hooks disabled by default (`CRAWL4AI_HOOKS_ENABLED=false`)\n3. Users must explicitly opt-in to enable hooks\n\n### Credits\n\nDiscovered by Neo by ProjectDiscovery (https://projectdiscovery.io)","published":"2026-02-12T15:31:20.810Z","modified":"2026-08-12T03:51:25.538801746Z","cvss":null,"epss":null,"cisaKev":null,"exploitsKnown":0,"affectedPackages":[{"ecosystem":"PyPI","name":"crawl4ai","fixedVersion":"0.8.0"}],"fix":null,"references":[{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/26xxx/CVE-2026-26216.json"},{"type":"ADVISORY","url":"https://github.com/unclecode/crawl4ai/blob/main/docs/blog/release-v0.8.0.md"},{"type":"ADVISORY","url":"https://github.com/unclecode/crawl4ai/security/advisories/GHSA-5882-5rx9-xgxp"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-26216"},{"type":"ADVISORY","url":"https://www.vulncheck.com/advisories/crawl4ai-docker-api-unauthenticated-remote-code-execution-via-hooks-parameter"},{"type":"PACKAGE","url":"https://github.com/unclecode/crawl4ai"},{"type":"WEB","url":"https://github.com/pypa/advisory-database/tree/main/vulns/crawl4ai/PYSEC-2026-33.yaml"},{"type":"WEB","url":"https://github.com/unclecode/crawl4ai/blob/release/v0.8.0/docs/blog/release-v0.8.0.md"},{"type":"WEB","url":"https://github.com/unclecode/crawl4ai/blob/release/v0.8.0/docs/migration/v0.8.0-upgrade-guide.md"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-08-12T03:51:25.538801746Z"}}