/

CVE-2026-53753

Severity:

CRITICAL RISK

(9.8)

Code Injection (CWE-94) in Crawl4AI Computed Fields

CVE-2026-53753

Analyzed

Vulnerability type

Category:

Code Injection / Sandbox Escape

CWE:

CWE-94, CWE-913

Impact:

Remote Code Execution

Severity:

CRITICAL RISK

(9.8)

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 computed fields feature includes a flawed expression sandbox that allows crafted schemas to break out of evaluation restrictions and run arbitrary Python code.

Because POST /crawl can be accessed without authentication by default, an attacker can remotely trigger arbitrary code execution on the host running the crawler.

Affected context

The vulnerability occurs in deployments that expose the Crawl4AI HTTP interface and use the computed fields feature for dynamic extraction schemas.

Risk is present when the _safe_eval_expression() function processes user-supplied expressions and relies on an AST-based validator that only blocks attribute names starting with an underscore.

In such setups, expressions delivered via POST /crawl are effectively treated as trusted logic, even if the caller is unauthenticated or the JWT mechanism remains disabled.

Exploit preconditions

  • Attack surface: HTTP POST requests to the /crawl endpoint in Crawl4AI.
  • Required access: Network reachability to the service; no authentication needed when JWT is disabled (default configuration).
  • Trigger point: Submission of a crafted extraction schema that uses computed fields, causing _safe_eval_expression() to evaluate the supplied expression.
  • Why exploitation is possible: The AST validator only filters attribute names starting with underscore and does not account for generator and frame object attributes (e.g., gi_frame, f_back, f_builtins), enabling access to runtime internals and arbitrary code execution.

Why this happens

This issue stems from an incomplete sandbox design in the expression evaluation mechanism used by the computed fields feature.

The _safe_eval_expression() routine attempts to secure evaluation by walking the AST and disallowing attributes with names that begin with an underscore, assuming this will block access to sensitive internals.

However, Python generator and frame objects expose powerful attributes (such as gi_frame, f_back, and f_builtins) that do not begin with an underscore but still grant access to interpreter frames, global namespaces, and builtins.

This behavior maps to CWE-94: Improper Control of Code Generation and CWE-913: Improper Control of Dynamically-Managed Code Resources, because untrusted expressions are evaluated under insufficient constraints, allowing them to influence and execute dynamic code.

Potential impact

  • An attacker can achieve arbitrary code execution in the Crawl4AI process.
  • The host system running Crawl4AI may be fully compromised.
  • Crawling infrastructure and collected data can be modified, exfiltrated, or destroyed.
  • The compromised instance can be abused as a pivot point for further attacks within the environment.
  • Service availability may be affected through destructive payloads or resource exhaustion.

General mitigation guidance

Effective mitigation focuses on removing or strictly hardening dynamic expression evaluation paths and reducing trust in user-provided schemas.

Common defensive patterns include:

  • Avoiding generic eval-like mechanisms for user-controlled expressions; prefer declarative, data-only schemas rather than executable code.
  • Using whitelisted, domain-specific languages (DSLs) or restricted expression evaluators that expose only safe operations and data.
  • Implementing robust AST-based validation that blocks all access to runtime internals, frames, builtins, and reflection APIs, rather than relying on simple name-based checks.
  • Running the crawler with least privilege, limiting file system access, network reach, and operating system capabilities to reduce impact if an escape occurs.
  • Isolating expression evaluation in separate, locked-down processes or containers to enforce strong sandbox boundaries.
  • Requiring authentication and authorization for API endpoints that accept dynamic extraction schemas and computed fields.

How teams detect issues like this

Detection typically involves both code-level analysis and runtime monitoring:

  • Static analysis rules that flag any use of eval, exec, or custom evaluators that process user-supplied expressions, especially when tied to HTTP endpoints.
  • Code review patterns that call out AST-based "safe eval" implementations, checking for access to frames, builtins, or other interpreter internals.
  • Security tests and fuzzing focused on the computed fields mechanism, attempting to access attributes of generators, frames, and builtins.
  • Logging and monitoring of extraction schemas and computed field expressions, with anomaly detection for suspicious attribute names or access patterns.
  • Policy enforcement in CI/CD pipelines to prevent deployment of new or modified code that introduces unsafe dynamic evaluation.

Sources

SourceLink
github.comgithub.com/unclecode/crawl4ai/security/advisories/GHSA-qxjp-w3pj-48m7

Frequently asked

questions

Yes. When the Crawl4AI service is reachable over the network and JWT-based authentication remains disabled, an attacker can remotely send crafted POST /crawl requests to trigger the unsafe expression evaluation.

Only network access to the vulnerable endpoint is required. No valid credentials are needed under the default configuration, although restrictive network controls can reduce exposure.

The safest approach is to eliminate generic dynamic code evaluation for user-controlled expressions and replace it with a strictly constrained, declarative mechanism or a heavily whitelisted DSL, isolating any remaining evaluation logic in a hardened sandbox.

Avoid treating user data as executable logic, design computed-field or transformation features around data-only descriptors, enforce rigorous validation of any dynamic code paths, apply least-privilege and isolation principles, and integrate security-focused reviews and automated checks for eval-like patterns into the development lifecycle.

Find out what's already
exploitable in your codebase.