/

CVE-2026-63767

Severity:

CRITICAL RISK

(9.8)

Unsafe Pickle Deserialization (CWE-502) in ktransformers

CVE-2026-63767

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

ktransformers up to version 0.6.3 contains an unauthenticated pickle deserialization flaw in its SchedulerServer ZMQ ROUTER endpoint, enabling arbitrary Python object construction from attacker-controlled data.

By sending crafted pickle payloads with malicious __reduce__ methods to the exposed socket, a remote attacker can execute arbitrary shell commands as the server process whenever the payload is deserialized.

Affected context

This vulnerability manifests in deployments of ktransformers where the SchedulerServer exposes a ZeroMQ ROUTER socket bound to all interfaces and accepts serialized job data over the network.

It becomes risky when the server trusts incoming pickle data without authentication, authorization, or content validation, and deserializes it directly within the main process.

Environments that run the SchedulerServer with elevated privileges or in proximity to sensitive data and services face heightened impact from exploitation.

Exploit preconditions

  • Attack surface: Network-accessible SchedulerServer ZMQ ROUTER socket bound to 0.0.0.0 or otherwise reachable by the attacker
  • Required access: Ability to send arbitrary messages to the SchedulerServer socket; no prior authentication required under vulnerable configurations
  • Trigger point: Server-side deserialization of incoming pickle payloads during job scheduling or message handling
  • Why exploitation is possible: The server uses Python's pickle module on untrusted data, allowing crafted objects with malicious __reduce__ implementations to execute arbitrary commands during deserialization (CWE-502)

Why this happens

The underlying bug class is unsafe deserialization of untrusted data using Python's pickle mechanism.

Pickle is a general-purpose serialization format that supports arbitrary object graphs and callback-based reconstruction, which includes the ability to trigger function calls when objects are restored.

In ktransformers, incoming data from the SchedulerServer ZMQ ROUTER socket is treated as trusted and passed directly to pickle deserialization routines without authentication, integrity checks, or type restrictions.

This design maps to CWE-502, where data intended to be passive is instead allowed to carry executable behavior, enabling attackers to embed malicious __reduce__ methods or other constructors that run arbitrary code as part of object reconstruction.

Potential impact

  • Remote code execution as the SchedulerServer process
  • Complete compromise of the host running ktransformers, depending on server privileges
  • Unauthorized access to or modification of scheduled jobs, models, and associated data
  • Lateral movement into adjacent services or infrastructure reachable from the compromised server
  • Deployment of persistent backdoors or cryptominers on affected systems
  • Interruption or sabotage of distributed processing workflows and pipelines

General mitigation guidance

Effective mitigation hinges on eliminating unsafe deserialization paths and minimizing trust in remotely supplied data.

Common defensive patterns include:

  • Avoiding Python pickle for any data that can be influenced over a network or by untrusted parties, preferring formats like JSON, MessagePack, or other constrained encodings that do not execute code.
  • Introducing a strict, schema-based messaging protocol where only expected fields and primitive types are accepted, and where all messages are validated before use.
  • Enforcing authentication and authorization on scheduler endpoints so that only trusted clients can submit jobs or serialized data.
  • Running the SchedulerServer with least privilege, isolating it via OS-level sandboxing or containerization, and restricting filesystem and network access to limit blast radius.
  • Designing components so that any necessary extensibility uses explicit, whitelisted entry points rather than implicit behaviors during deserialization.

How teams detect issues like this

Organizations can detect similar unsafe deserialization issues through layered approaches:

  • Static analysis rules or grep-based scans to flag usage of pickle.load, pickle.loads, or equivalent APIs in network-facing or IPC-handling code paths.
  • Code review practices that require scrutiny of any serialization logic, especially in scheduler, orchestration, and messaging layers, with an explicit ban on pickle for untrusted inputs.
  • Runtime monitoring and logging of SchedulerServer activity, including unusual or malformed messages and suspicious command execution patterns near deserialization routines.
  • Policy enforcement in CI/CD pipelines that blocks merges introducing insecure serialization APIs or that lack authentication on public-facing endpoints.
  • Optional use of automated security review tools to continuously scan for CWE-502 patterns and high-risk deserialization constructs.

Sources

SourceLink
github.comgithub.com/kvcache-ai/ktransformers/commit/def0f9313d6e063b5c5ccdfa1f6707f7a40dfdca
github.comgithub.com/kvcache-ai/ktransformers/issues/2087
github.comgithub.com/kvcache-ai/ktransformers/pull/2091
vulncheck.comvulncheck.com/advisories/ktransformers-unauthenticated-pickle-deserialization-rce-via-zmq

Frequently asked

questions

Yes. Because the SchedulerServer ZMQ ROUTER socket is bound to all interfaces and accepts serialized payloads, an attacker who can reach the socket over the network can exploit the unsafe deserialization to achieve remote code execution.

The vulnerability is unauthenticated: an attacker only needs network access to the exposed SchedulerServer endpoint and the ability to send crafted pickle messages. No valid credentials or prior compromise of the system are required under vulnerable configurations.

The most robust fix is to stop using pickle (or any code-executing serialization format) for data that comes from outside the trust boundary. Replace it with a constrained, schema-driven format such as JSON, restrict accepted types to simple primitives and well-defined structures, and introduce authentication and authorization on all scheduler interfaces.

Prevention strategies include adopting secure-by-default serialization libraries, establishing internal policies that prohibit unsafe deserialization APIs on untrusted data, mandating security-focused reviews for networking and IPC layers, and integrating static analysis or linters that automatically flag CWE-502 patterns in new code changes.

Find out what's already
exploitable in your codebase.