Skip to main content
CVE Vulnerability Database

CVE-2024-9340: Zenml Zenml DoS Vulnerability

CVE-2024-9340 is a denial of service vulnerability in Zenml Zenml version 0.66.0 that allows unauthenticated attackers to cause infinite loops through malformed multipart requests. This post covers technical details, impact, and mitigation.

Published:

CVE-2024-9340 Overview

CVE-2024-9340 is a Denial of Service (DoS) vulnerability affecting zenml-io/zenml version 0.66.0. Unauthenticated attackers can trigger excessive resource consumption by sending malformed multipart requests with arbitrary characters appended to multipart boundaries. The flaw resides in the multipart request boundary processing logic and produces an infinite loop [CWE-835]. The affected endpoints include /api/v1/login and /api/v1/device_authorization, both reachable without authentication. Successful exploitation renders the ZenML server unavailable for all users.

Critical Impact

Remote unauthenticated attackers can crash a ZenML 0.66.0 server through malformed multipart HTTP requests, causing complete service outage.

Affected Products

  • ZenML zenml-io/zenml version 0.66.0
  • ZenML API endpoint /api/v1/login
  • ZenML API endpoint /api/v1/device_authorization

Discovery Timeline

  • 2025-03-20 - CVE-2024-9340 published to NVD
  • 2026-06-17 - Last updated in NVD database

Technical Details for CVE-2024-9340

Vulnerability Analysis

The vulnerability stems from improper handling of multipart request boundaries in the ZenML server. When an HTTP client submits a multipart/form-data payload, the server parses the boundary declared in the Content-Type header and iterates through the request body looking for boundary delimiters. In ZenML 0.66.0, appending arbitrary characters after the boundary token causes the parser to enter a loop with no terminating condition [CWE-835]. Because the affected routes accept unauthenticated requests, a single attacker can hold server workers indefinitely and exhaust available request handling capacity.

Root Cause

The root cause is missing validation and a missing request body size limit in the multipart parsing path. The upstream fix introduces DEFAULT_ZENML_SERVER_MAX_REQUEST_BODY_SIZE_IN_BYTES = 256 * 1024 * 1024 and enforces it in server_config.py, capping request size and terminating oversized or malformed uploads before they reach the vulnerable loop.

Attack Vector

Exploitation is remote, network-based, and requires no authentication or user interaction. An attacker sends a crafted HTTP POST request to /api/v1/login or /api/v1/device_authorization containing a multipart/form-data body whose boundary token has trailing arbitrary characters. The server enters an infinite loop while attempting to locate boundary terminators, preventing legitimate users from accessing the service.

python
# Upstream patch: src/zenml/constants.py
DEFAULT_ZENML_SERVER_SECURE_HEADERS_REPORT_TO = "default"
DEFAULT_ZENML_SERVER_USE_LEGACY_DASHBOARD = False
DEFAULT_ZENML_SERVER_REPORT_USER_ACTIVITY_TO_DB_SECONDS = 30
DEFAULT_ZENML_SERVER_MAX_REQUEST_BODY_SIZE_IN_BYTES = 256 * 1024 * 1024

# Source: https://github.com/zenml-io/zenml/commit/cba152eb9ca3071c8372b0b91c02d9d3351de48d

Detection Methods for CVE-2024-9340

Indicators of Compromise

  • Unusually long-lived HTTP requests to /api/v1/login or /api/v1/device_authorization.
  • ZenML worker processes stuck at high CPU with no request completion.
  • Content-Type: multipart/form-data requests with malformed or padded boundary= values.
  • Sudden loss of responsiveness on the ZenML API while the process remains running.

Detection Strategies

  • Inspect web server and reverse proxy access logs for repeated POST requests to the affected endpoints from a single source.
  • Alert on request durations exceeding normal baselines for ZenML API endpoints.
  • Deploy a web application firewall rule to flag multipart/form-data requests where trailing bytes follow the declared boundary token.

Monitoring Recommendations

  • Monitor CPU and memory saturation on ZenML server hosts and correlate with inbound request patterns.
  • Track request handler queue depth and worker thread lifetimes for the ZenML API.
  • Aggregate proxy logs into a central analytics platform to identify volumetric abuse against /api/v1/login and /api/v1/device_authorization.

How to Mitigate CVE-2024-9340

Immediate Actions Required

  • Upgrade ZenML to a version that includes commit cba152eb9ca3071c8372b0b91c02d9d3351de48d, which enforces a maximum request body size.
  • Restrict network access to the ZenML API using firewall rules or private network segmentation until patching is complete.
  • Place the ZenML server behind a reverse proxy that enforces request body size limits and connection timeouts.

Patch Information

The vendor addressed the issue in ZenML commit cba152e, titled "Prevent too large requests (#3048)." The patch adds DEFAULT_ZENML_SERVER_MAX_REQUEST_BODY_SIZE_IN_BYTES to src/zenml/constants.py and wires it into src/zenml/config/server_config.py. Additional context is available in the Huntr bounty listing.

Workarounds

  • Terminate multipart/form-data requests larger than a defined threshold at the reverse proxy (for example, client_max_body_size in nginx).
  • Configure request timeouts at the load balancer to reap long-running connections directed at the ZenML API.
  • Require authenticated network access (VPN, mTLS, IP allow-list) to the ZenML server until an upgrade is applied.
bash
# nginx: bound request body size and read timeout for the ZenML API
location /api/ {
    client_max_body_size 8m;
    client_body_timeout  10s;
    proxy_read_timeout   30s;
    proxy_pass           http://zenml_upstream;
}

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.