/

CVE-2026-119120

Severity:

HIGH RISK

(7.5)

Unsafe Deserialization (CWE-502) in Crawl4AI API Server

CVE-2026-119120

Deferred

Vulnerability type

Category:

Unsafe Deserialization

CWE:

CWE-502

Impact:

Remote Code Execution and Resource Exhaustion

Severity:

HIGH RISK

(7.5)

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 exposes a model selection field through Docker API request bodies without sufficiently restricting which HuggingFace model can be loaded. An authenticated client may select a malicious model repository, potentially causing Python code execution through unsafe pickle-based model loading on affected PyTorch versions, or triggering disk and memory exhaustion.

Crawl4AI exposes a model selection field through Docker API request bodies without sufficiently restricting which HuggingFace model can be loaded. An authenticated client may select a malicious model repository, potentially causing Python code execution through unsafe pickle-based model loading on affected PyTorch versions, or triggering disk and memory exhaustion.

Affected context

The issue may occur in Crawl4AI deployments that:

  • Use affected releases between 0.9.0 and before 0.9.5
  • Expose the Docker API to authenticated clients
  • Allow client-controlled CosineStrategy.model_name values
  • Load HuggingFace model artifacts without sufficiently restricting repositories or serialization formats

Risk depends on API exposure, client privileges, model-loading configuration, and the PyTorch runtime version.

The issue may occur in Crawl4AI deployments that:

  • Use affected releases between 0.9.0 and before 0.9.5
  • Expose the Docker API to authenticated clients
  • Allow client-controlled CosineStrategy.model_name values
  • Load HuggingFace model artifacts without sufficiently restricting repositories or serialization formats

Risk depends on API exposure, client privileges, model-loading configuration, and the PyTorch runtime version.

Exploit preconditions

  • Attack surface: Crawl4AI Docker API model-loading functionality
  • Required access: Valid authentication and permission to submit requests that control the model name
  • Trigger point: Processing a request that causes the selected HuggingFace model to be downloaded and loaded
  • Why exploitation is possible: The model identifier is insufficiently filtered, allowing server-side retrieval of attacker-controlled artifacts that may invoke unsafe deserialization or consume excessive resources
  • Attack surface: Crawl4AI Docker API model-loading functionality
  • Required access: Valid authentication and permission to submit requests that control the model name
  • Trigger point: Processing a request that causes the selected HuggingFace model to be downloaded and loaded
  • Why exploitation is possible: The model identifier is insufficiently filtered, allowing server-side retrieval of attacker-controlled artifacts that may invoke unsafe deserialization or consume excessive resources

Why this happens

The underlying bug is insufficient validation and trust-boundary enforcement for a client-controlled model selection field.

By allowing an untrusted request to determine which external model repository is loaded, the application may process serialized model data from an attacker-influenced source. Pickle-based model artifacts can deserialize Python objects with executable behavior in affected runtime configurations, mapping to CWE-502: Unsafe Deserialization. Unrestricted model retrieval can also create denial-of-service conditions through excessive disk or memory consumption.

The underlying bug is insufficient validation and trust-boundary enforcement for a client-controlled model selection field.

By allowing an untrusted request to determine which external model repository is loaded, the application may process serialized model data from an attacker-influenced source. Pickle-based model artifacts can deserialize Python objects with executable behavior in affected runtime configurations, mapping to CWE-502: Unsafe Deserialization. Unrestricted model retrieval can also create denial-of-service conditions through excessive disk or memory consumption.

Potential impact

  • An attacker may execute Python code within the Crawl4AI server process
  • The service could be compromised or used to access permitted local resources
  • Disk space or memory may be exhausted, causing denial of service
  • Malicious model artifacts could alter processing results or damage data integrity
  • The host or surrounding environment could face further compromise depending on runtime privileges
  • An attacker may execute Python code within the Crawl4AI server process
  • The service could be compromised or used to access permitted local resources
  • Disk space or memory may be exhausted, causing denial of service
  • Malicious model artifacts could alter processing results or damage data integrity
  • The host or surrounding environment could face further compromise depending on runtime privileges

General mitigation guidance

Mitigation generally focuses on reducing trust in client-selected model sources and preventing unsafe artifact deserialization.

Common defensive patterns include:

  • Restricting model selection to an explicit allowlist of approved repositories and immutable revisions
  • Avoiding pickle-based model formats where safer serialization alternatives are available
  • Applying safe model-loading options and keeping serialization libraries configured for restricted behavior
  • Validating model identifiers against strict schemas before any network access or loading occurs
  • Limiting outbound network access from the service and using controlled artifact registries
  • Enforcing memory, disk, CPU, and download quotas for model operations
  • Running the service with least privilege and isolating model-loading workers
  • Requiring authentication scopes that separate ordinary crawling from model administration

Mitigation generally focuses on reducing trust in client-selected model sources and preventing unsafe artifact deserialization.

Common defensive patterns include:

  • Restricting model selection to an explicit allowlist of approved repositories and immutable revisions
  • Avoiding pickle-based model formats where safer serialization alternatives are available
  • Applying safe model-loading options and keeping serialization libraries configured for restricted behavior
  • Validating model identifiers against strict schemas before any network access or loading occurs
  • Limiting outbound network access from the service and using controlled artifact registries
  • Enforcing memory, disk, CPU, and download quotas for model operations
  • Running the service with least privilege and isolating model-loading workers
  • Requiring authentication scopes that separate ordinary crawling from model administration

How teams detect issues like this

Detection can include:

  • Static analysis rules for unsafe deserialization and unrestricted model-loading APIs
  • Code review checks for request fields that directly select external repositories or artifacts
  • Policy enforcement requiring model allowlists, pinned revisions, and approved serialization formats
  • Runtime monitoring for unexpected HuggingFace domains, model downloads, large temporary files, and abnormal memory growth
  • Audit logging of authenticated model-selection requests and rejected validation attempts

Automated security review tools may help identify unsafe loader usage and missing input validation, but should be supplemented with deployment and runtime controls.

Detection can include:

  • Static analysis rules for unsafe deserialization and unrestricted model-loading APIs
  • Code review checks for request fields that directly select external repositories or artifacts
  • Policy enforcement requiring model allowlists, pinned revisions, and approved serialization formats
  • Runtime monitoring for unexpected HuggingFace domains, model downloads, large temporary files, and abnormal memory growth
  • Audit logging of authenticated model-selection requests and rejected validation attempts

Automated security review tools may help identify unsafe loader usage and missing input validation, but should be supplemented with deployment and runtime controls.

Sources

SourceLink
github.comgithub.com/unclecode/crawl4ai/security/advisories/GHSA-f856-7xp9-w3cc
vulncheck.comvulncheck.com/advisories/crawl4ai-0.9.0-before-0.9.5-untrusted-model-loading-via-cosinestrategy-model-name

Frequently asked

questions

An attacker generally needs valid authentication and sufficient permission to submit requests that control the model_name field. The practical scope depends on API exposure and authorization design.

The server must be reachable by an authorized client, either directly or through an internal service path. Internet exposure is not inherently required.

Do not accept arbitrary model repository names from clients. Use an allowlist of trusted, pinned artifacts and safe serialization formats, with resource limits and least-privilege execution.

Treat model identifiers and downloaded artifacts as untrusted input, enforce strict authorization and schema validation, restrict outbound access, monitor model-loading activity, and include deserialization checks in code review and CI policies.

An attacker generally needs valid authentication and sufficient permission to submit requests that control the model_name field. The practical scope depends on API exposure and authorization design.

The server must be reachable by an authorized client, either directly or through an internal service path. Internet exposure is not inherently required.

Do not accept arbitrary model repository names from clients. Use an allowlist of trusted, pinned artifacts and safe serialization formats, with resource limits and least-privilege execution.

Treat model identifiers and downloaded artifacts as untrusted input, enforce strict authorization and schema validation, restrict outbound access, monitor model-loading activity, and include deserialization checks in code review and CI policies.

Find out what's already
exploitable in your codebase.