Vulnerabilities in pkg:pypi/Crawl4AI
PACKAGECVE-2026-26216 is a CRITICAL remote code execution vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting Crawl4AI libraries in the PyPI ecosystem. The issue involves crawl4ai is vulnerable to remote code execution in docker api via hooks parameter. Remediation is available by upgrading affected packages to version 0.8.0.
pkg:pypi/Crawl4AI
Vulnerability advisories affecting package pkg:pypi/Crawl4AI. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-5882-5rx9-xgxp | CVE-2026-26216 | CRITICAL | Crawl4AI is Vulnerable to Remote Code Execution in Docker API via Hooks Parameter |
| GHSA-vx9w-5cx4-9796 | CVE-2026-26217 | CRITICAL | Crawl4AI Has Local File Inclusion in Docker API via file:// URLs |
| GHSA-445m-27cf-gr3x | CVE-2025-28197 | MODERATE | Crawl4AI SSRF vulnerability |
CVE-2026-26216 at a Glance
How to Fix CVE-2026-26216
To remediate this vulnerability, upgrade all affected Crawl4AI dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install Crawl4AI>=0.8.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show Crawl4AI
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2026-26216, inspect your installed packages using pip:
pip show Crawl4AI
Analyze the terminal output to locate any version of Crawl4AI in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.8.0), your application is affected.
Note: The pip show Crawl4AI command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-94: Improper Control of Generation of Code ('Code Injection'), where the product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. In Crawl4AI, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-26216 Affected Crawl4AI Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
Crawl4AI
|
PyPI |
< 0.8.0
|
0.8.0
|
References
Frequently Asked Questions
What is CVE-2026-26216?
Which Crawl4AI versions are affected?
What version fixes CVE-2026-26216?
Is Crawl4AI affected?
What CWE is associated with CVE-2026-26216?
How can I check PyPI dependencies for CVE-2026-26216?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-5882-5rx9-xgxp",
"modified" : "2026-06-05T16:23:37Z",
"published" : "2026-01-16T20:59:16Z",
"aliases" : [ "CVE-2026-26216" ],
"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.\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)",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "Crawl4AI"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.8.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"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" : "WEB",
"url" : "https://github.com/pypa/advisory-database/tree/main/vulns/crawl4ai/PYSEC-2026-33.yaml"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/unclecode/crawl4ai"
}, {
"type" : "WEB",
"url" : "https://github.com/unclecode/crawl4ai/blob/main/docs/blog/release-v0.8.0.md"
}, {
"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"
}, {
"type" : "WEB",
"url" : "https://www.vulncheck.com/advisories/crawl4ai-docker-api-unauthenticated-remote-code-execution-via-hooks-parameter"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-94" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2026-01-16T20:59:16Z",
"nvd_published_at" : "2026-02-12T16:16:17Z"
}
}