GCVE Workshop - 22 September 2026 (14:00-18:00), Luxembourg Before The Vulnopticon Conference - Registration

GHSA-5882-5RX9-XGXP

Vulnerability from github – Published: 2026-01-16 20:59 – Updated: 2026-06-05 16:23
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

  1. Upgrade to v0.8.0 (recommended)
  2. If unable to upgrade immediately:
  3. Disable the Docker API
  4. Block /crawl endpoint at network level
  5. Add authentication to the API

Fix Details

  1. Removed __import__ from allowed_builtins in hook_manager.py
  2. Hooks disabled by default (CRAWL4AI_HOOKS_ENABLED=false)
  3. Users must explicitly opt-in to enable hooks

Credits

Discovered by Neo by ProjectDiscovery (https://projectdiscovery.io)

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "PyPI",
        "name": "Crawl4AI"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "0.8.0"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2026-26216"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-94"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-01-16T20:59:16Z",
    "nvd_published_at": "2026-02-12T16:16:17Z",
    "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-06-05T16:23:37Z",
  "published": "2026-01-16T20:59:16Z",
  "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"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "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",
      "type": "CVSS_V4"
    }
  ],
  "summary": "Crawl4AI is Vulnerable to Remote Code Execution in Docker API via Hooks Parameter"
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

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…

Detection rules are retrieved from Rulezet.

Loading…

Loading…

Related by attack behaviour

Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.


Loading…