/

CVE-2026-31237

Severity:

CRITICAL RISK

(9.8)

Unsafe Deserialization in Ludwig predict() Data Loading

CVE-2026-31237

Deferred

Vulnerability type

Category:

Unsafe Deserialization

CWE:

CWE-502

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

Ludwig framework versions through 0.10.4 are vulnerable to insecure deserialization when handling dataset paths passed to the predict() method.

If a user-supplied dataset is a pickle (.pkl) file, it is loaded via pandas.read_pickle() without validation, allowing a malicious file to trigger arbitrary code execution on the prediction host.

Affected context

The vulnerability occurs in Ludwig's prediction workflow when applications call predict() with a file path to input data.

Ludwig automatically infers file format and, for .pkl inputs, uses pandas.read_pickle() to load the content.

In deployments where prediction endpoints accept user-controlled or untrusted dataset files (e.g., uploaded datasets, API-exposed file paths, or indirectly referenced storage objects), an attacker-controlled pickle file can be processed without additional validation or sandboxing.

Exploit preconditions

  • Attack surface: Any Ludwig-powered prediction interface that accepts user-specified dataset paths or files.
  • Required access: Ability to supply or influence the pickle file that predict() will read (e.g., file upload, path reference, or shared storage write access).
  • Trigger point: Invocation of Ludwig's predict() method on a .pkl dataset, which internally calls pandas.read_pickle().
  • Why exploitation is possible: Pickle deserialization is inherently capable of instantiating arbitrary Python objects with side effects, and Ludwig treats .pkl inputs as trusted data without enforcing type constraints, content validation, or deserialization safeguards.

Why this happens

The core issue is Ludwig's reliance on Python pickle-based deserialization for user-provided datasets in the prediction path.

When the framework auto-detects a .pkl file, it delegates loading to pandas.read_pickle(), which uses Python's pickle module and will execute arbitrary object constructors embedded in the file.

This aligns with CWE-502: Deserialization of Untrusted Data, where untrusted input is fed into a general-purpose deserialization mechanism that was designed for trusted, in-process data.

Conceptually, the insecure pattern is treating serialized objects as mere "data files," rather than as executable object graphs, and not constraining or authenticating the source or structure of those objects.

Potential impact

  • Execution of arbitrary OS commands with the privileges of the Ludwig prediction process.
  • Full compromise of the host running the prediction service (including lateral movement, data theft, or service disruption).
  • Exposure or manipulation of sensitive ML assets such as models, training data, and configuration secrets accessible to the process.
  • Installation of backdoors or malware on the application server.
  • Abuse of the compromised environment for further attacks within the network or cloud account.

General mitigation guidance

Mitigations generally focus on eliminating unsafe object deserialization and tightening trust boundaries around input data:

  • Avoid using pickle-based formats for user-supplied or otherwise untrusted datasets; prefer safer, purely data-oriented formats such as CSV, JSON, or Parquet.
  • Introduce explicit format whitelists for prediction inputs and reject .pkl or other object-serialization formats by default.
  • Apply strict input validation and content checks before any deserialization logic, including verifying expected schemas and types.
  • Separate runtime roles and apply least privilege so that the prediction process runs with minimal OS and network privileges, reducing blast radius if compromise occurs.
  • Consider isolating prediction workloads in containers, sandboxes, or dedicated execution environments that do not have access to sensitive infrastructure resources.
  • Treat any mechanism that reconstructs Python objects from external input as untrusted and avoid it entirely on remote or multi-tenant interfaces.

How teams detect issues like this

High-level detection commonly combines code-level and operational measures:

  • Static analysis: Flag calls to pandas.read_pickle(), pickle.load(), or equivalent APIs that are reachable from request handlers or other untrusted input paths.
  • Code review: Look for prediction or data-loading code paths that perform automatic format detection and include pickle handling for user-supplied files; ensure reviewers challenge any use of object deserialization on external input.
  • Security testing: Incorporate tests that attempt to pass known unsafe serialized objects into prediction endpoints, confirming they are rejected and never deserialized.
  • Policy enforcement: Establish engineering standards disallowing pickle or similar formats (e.g., joblib, dill) for untrusted input, and enforce these via CI checks or pre-merge hooks.
  • Runtime monitoring: Log and monitor uses of pickle-loading functions, especially from network-accessible services, and alert on unexpected .pkl processing events.

Sources

SourceLink
github.comgithub.com/ludwig-ai/ludwig
notion.sonotion.so/CVE-2026-31237-35d1e139318881fb95a2ee7c5d0e17d8

Frequently asked

questions

Yes, if a Ludwig-based prediction service exposes an interface (such as an HTTP API, job submission system, or file upload feature) that allows an attacker to control a dataset file or path processed by predict(), then the vulnerability can be exploited remotely.

The attacker needs the ability to cause Ludwig's predict() method to read a malicious .pkl file—typically by uploading the file, referencing a path they can write to, or influencing a data ingestion workflow. No shell or prior code execution on the host is required.

The safest pattern is to avoid deserializing untrusted data with general-purpose object serialization mechanisms like pickle. Restrict inputs to data-only formats, explicitly reject unsafe formats, and ensure that any remaining deserialization is limited to strictly defined types from trusted sources.

Build and enforce architectural rules that disallow unsafe deserialization on any external-facing path, review data-loading utilities for use of serialization APIs, and codify secure data format standards for ML pipelines. Combine these with automated checks in CI and regular security reviews of data ingestion and prediction entry points.

Find out what's already
exploitable in your codebase.