/

CVE-2026-56264

Severity:

HIGH RISK

(8.1)

Arbitrary JS Code Execution (CWE-94) in Crawl4AI API

CVE-2026-56264

Analyzed

Vulnerability type

Category:

Arbitrary Code Execution

CWE:

CWE-94

Impact:

Server-Side JavaScript Execution and SSRF

Severity:

HIGH RISK

(8.1)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Crawl4AI's Docker API server exposes an /execute_js endpoint that runs attacker-supplied JavaScript inside a browser context configured with disabled web security.

When reachable, this endpoint can be abused to execute arbitrary script and, due to relaxed browser policies, perform server-side request forgery (SSRF) against internal services.

Affected context

This vulnerability appears in deployments of Crawl4AI that expose the Docker API server, particularly when the /execute_js endpoint is reachable from untrusted networks or integrated into automated workflows.

The issue is most relevant in environments where the browser within the container is launched with --disable-web-security, expanding the JavaScript execution context beyond normal same-origin constraints.

Risk increases when the container has network visibility into internal services, metadata endpoints, or other sensitive infrastructure.

Exploit preconditions

  • Attack surface: HTTP access to the Crawl4AI Docker API server's /execute_js endpoint
  • Required access: Ability to send crafted requests (usually network-level access; authentication requirements depend on deployment)
  • Trigger point: Submission of arbitrary JavaScript payloads through the /execute_js API
  • Why exploitation is possible: The API directly evaluates user-supplied JavaScript within a browser instance configured with --disable-web-security, allowing scripts to issue requests to internal endpoints and bypass typical browser origin restrictions.

Why this happens

The underlying bug is the design pattern of exposing an endpoint that accepts and directly executes user-provided JavaScript without robust controls.

This maps to CWE-94: Improper Control of Generation of Code, where external input is treated as executable code in a privileged environment.

By running script in a browser with disabled web security, the component effectively grants untrusted code a powerful network-capable execution environment, blurring the boundary between user input and internal logic.

Potential impact

  • Arbitrary JavaScript execution in the server-controlled browser context
  • Server-side request forgery (SSRF) to internal HTTP services and cloud metadata endpoints
  • Unauthorized access to internal APIs and data reachable from the container's network
  • Pivoting into adjacent systems via exposed management interfaces
  • Interference with crawling workflows, data integrity, or automation pipelines

General mitigation guidance

Effective mitigation focuses on reducing or eliminating the ability for untrusted input to become executable JavaScript within the server environment.

Pattern-based defensive approaches include:

  • Avoid exposing generic "execute script" endpoints to untrusted users or networks.
  • Replace arbitrary code execution with constrained, declarative APIs that offer specific, vetted actions instead of raw scripting.
  • Enforce strict authentication, authorization, and allowlisting of permitted scripts or operations if execution capabilities must remain.
  • Run browsers with standard security policies enabled; avoid disabling web security in production unless combined with strict isolation.
  • Restrict outbound network access from the crawling container to only necessary destinations, minimizing SSRF blast radius.
  • Apply least-privilege to container and network configurations so that compromise of the browser context has limited reach.

How teams detect issues like this

Organizations can identify similar vulnerabilities by:

  • Reviewing API designs for endpoints that accept and execute code or script-like input.
  • Applying static analysis rules to highlight direct evaluation of user-supplied JavaScript or unsafe code generation patterns.
  • Establishing code review checklists that flag use of browser flags such as --disable-web-security in server-side automation.
  • Monitoring runtime logs and network telemetry for unusual outbound requests originating from crawling containers, including calls to internal or metadata endpoints.
  • Using automated security testing tools to probe API servers for script execution and SSRF behaviors as part of continuous assessment.

Sources

SourceLink
github.comgithub.com/unclecode/crawl4ai
github.comgithub.com/unclecode/crawl4ai/security/advisories/GHSA-365w-hqf6-vxfg
vulncheck.comvulncheck.com/advisories/crawl4ai-arbitrary-javascript-execution-via-execute-js-endpoint

Frequently asked

questions

Yes, if the Docker API server's /execute_js endpoint is reachable from a remote network and not adequately protected, an attacker can submit JavaScript for execution.

The attacker needs network access to the vulnerable API endpoint. Any additional authentication requirements depend on how the API server is deployed and integrated.

The safest pattern is to remove or strictly limit arbitrary JavaScript execution capabilities, replacing them with narrowly scoped, declarative operations and enforcing strong authentication and authorization on any remaining script-like features.

Avoid designs that turn user input into executable code, keep browser security features enabled by default, perform regular security-focused code reviews on automation and crawling components, and restrict network egress from containers to reduce the impact of potential SSRF.

Find out what's already
exploitable in your codebase.