GHSA-5882-5RX9-XGXP
Vulnerability from github – Published: 2026-01-16 20:59 – Updated: 2026-01-16 20:59
VLAI?
Summary
Crawl4AI is Vulnerable to Remote Code Execution in Docker API 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.
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: - 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
Mitigation
- Upgrade to v0.8.0 (recommended)
- If unable to upgrade immediately:
- Disable the Docker API
- Block
/crawlendpoint at network level - Add authentication to the API
Fix Details
- Removed
__import__fromallowed_builtinsinhook_manager.py - Hooks disabled by default (
CRAWL4AI_HOOKS_ENABLED=false) - Users must explicitly opt-in to enable hooks
Credits
Discovered by Neo by ProjectDiscovery (https://projectdiscovery.io)
Severity ?
10.0 (Critical)
{
"affected": [
{
"package": {
"ecosystem": "PyPI",
"name": "Crawl4AI"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "0.8.0"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": true,
"github_reviewed_at": "2026-01-16T20:59:16Z",
"nvd_published_at": null,
"severity": "CRITICAL"
},
"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__(\u0027os\u0027).system(\u0027malicious_command\u0027)\\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)",
"id": "GHSA-5882-5rx9-xgxp",
"modified": "2026-01-16T20:59:16Z",
"published": "2026-01-16T20:59:16Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/unclecode/crawl4ai/security/advisories/GHSA-5882-5rx9-xgxp"
},
{
"type": "PACKAGE",
"url": "https://github.com/unclecode/crawl4ai"
},
{
"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"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H",
"type": "CVSS_V3"
}
],
"summary": "Crawl4AI is Vulnerable to Remote Code Execution in Docker API via Hooks Parameter"
}
Loading…
Loading…
Sightings
| Author | Source | Type | Date |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
Loading…
Loading…