PyPI: crawl4ai
CVE-2026-26216
Safety vulnerability ID: SFTY-20260116-60596
Safety legacy ID: pyup.io-84607
Affected versions of the Crawl4AI package are vulnerable to Remote Code Execution due to executing user-supplied Python hook code with exec(). The Docker API’s /crawl endpoint processes the hooks parameter (for example, hooks.code.on_page_context_created) and runs it via the hook execution logic while allowing dangerous builtins such as __import__, enabling arbitrary module imports and command execution (for example, __import__('os').system(...)).
Overview
Crawl4AI is Vulnerable to Remote Code Execution in Docker API via Hooks Parameter
Advisory
Affected versions of the Crawl4AI package are vulnerable to Remote Code Execution due to executing user-supplied Python hook code with exec(). The Docker API’s /crawl endpoint processes the hooks parameter (for example, hooks.code.on_page_context_created) and runs it via the hook execution logic while allowing dangerous builtins such as __import__, enabling arbitrary module imports and command execution (for example, __import__('os').system(...)).
How to Fix
Mitigation and Workarounds
---
Vulnerable Functions
Functions linked to known vulnerabilities.
References
- https://getsafety.com/vulnerabilities/SFTY-20260116-60596/CVE-2026-26216
- https://data.safetycli.com/changelogs/crawl4ai/
- https://github.com/advisories/GHSA-5882-5rx9-xgxp
- https://pypi.org/project/crawl4ai
- https://github.com/unclecode/crawl4ai/security/advisories/GHSA-5882-5rx9-xgxp
- https://github.com/unclecode/crawl4ai/blob/release/v0.8.0/docs/blog/release-v0.8.0.md
- https://github.com/unclecode/crawl4ai/blob/release/v0.8.0/docs/migration/v0.8.0-upgrade-guide.md
- https://nvd.nist.gov/vuln/detail/CVE-2026-26216
- https://github.com/unclecode/crawl4ai/blob/main/docs/blog/release-v0.8.0.md
- https://www.vulncheck.com/advisories/crawl4ai-docker-api-unauthenticated-remote-code-execution-via-hooks-parameter
- https://github.com/advisories/GHSA-5882-5rx9-xgxp
Verified by Safety
Our Cybersecurity Intelligence Team reviewed this vulnerability. We combine public data with our own research to find issues not yet reported to public sources.
Learn more
