CVE-2026-119120
Crawl4AI lets auth clients pick malicious HuggingFace models via unfiltered API, leading to code exec or resource exhaustion.
- CVSS 7.7
- CWE-502
- Input Validation and Sanitization
- Remote
Crawl4AI from 0.9.0 before 0.9.5 fails to filter the CosineStrategy model_name field in untrusted Docker API request bodies, allowing authenticated clients to choose which HuggingFace model the server loads. Attackers can reference a malicious repository with a pickle weight file to execute Python code under PyTorch below 2.6, or exhaust disk and memory.
- CWE
- CWE-502
- CVSS base score
- 7.7
- Published
- 2026-10-29
- OWASP
- A08 Software and Data Integrity Failures
- Orthogonal defect classification
- Interface
- Code defect classification
- Incorrect Interface
- Category
- Input Validation and Sanitization
- Subcategory
- Insecure Parsing or Deserialization
- Accessibility scope
- Remote
- Impact
- Arbitrary Code Execution
- Affected component
- Crawl4AI
- Fixed by upgrading
- Yes
Solution
Upgrade Crawl4AI to version 0.9.5 or later, which adds proper validation of the CosineStrategy model_name field.
Vulnerable code sample
import json
import torch
from transformers import AutoModel
def load_model_from_request(request_body: bytes) -> torch.nn.Module:
"""
Parse a Docker API request body and load the requested HuggingFace model.
"""
data = json.loads(request_body)
# VULNERABLE: unsanitized model_name allows loading arbitrary repository
model_name = data.get("model_name", "bert-base-uncased")
# Directly pass user‑controlled name to AutoModel.from_pretrained
model = AutoModel.from_pretrained(model_name)
return modelPatched code sample
import json
import torch
from transformers import AutoModel
ALLOWED_MODELS = {"bert-base-uncased", "distilbert-base-uncased"}
def load_model_from_request(request_body: bytes) -> torch.nn.Module:
"""
Parse a Docker API request body and load the requested HuggingFace model.
"""
data = json.loads(request_body)
# FIX: validate model_name against whitelist before loading
requested = data.get("model_name", "bert-base-uncased")
model_name = requested if requested in ALLOWED_MODELS else "bert-base-uncased"
model = AutoModel.from_pretrained(model_name)
return modelCite this entry
@misc{vaitp:cve2026119120,
title = {{Crawl4AI lets auth clients pick malicious HuggingFace models via unfiltered API, leading to code exec or resource exhaustion.}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2026},
note = {VAITP Python Vulnerability Dataset, entry CVE-2026-119120},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-119120/}}
}
Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.
The supreme art of war is to subdue the enemy without fighting.
Sun Tzu – “The Art of War”
:: Shaping the future through research and ingenuity ::
