/

CVE-2026-78147

Severity:

HIGH RISK

(7.3)

Unsafe Deserialization (CWE-502) in llama.cpp RPC Server

CVE-2026-78147

Deferred

Vulnerability type

Category:

Unsafe Deserialization

CWE:

CWE-20, CWE-502

Impact:

Remote Deserialization Abuse

Severity:

HIGH RISK

(7.3)

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

A high-severity vulnerability in the ggml-RPC Server component of llama.cpp allows remotely supplied op or op_params values to reach a deserialization path without sufficient validation. Under deployments that expose the RPC server to untrusted clients, an attacker may trigger unintended object or state reconstruction and potentially compromise service availability or integrity.

Affected context

The issue occurs in the ggml-RPC Server implementation, specifically in deserialize_tensor within ggml/src/ggml-rpc/ggml-rpc.cpp. Risk is higher when the RPC endpoint is reachable by untrusted or insufficiently authenticated clients and when operation identifiers or operation parameters are accepted without strict schema and semantic validation. This issue is distinct from changes that only reject a null buffer during node creation, because those checks do not validate op or op_params.

Exploit preconditions

  • Attack surface: Network-accessible ggml-RPC Server endpoint
  • Required access: Ability to submit RPC data containing controllable operation fields
  • Trigger point: Tensor or operation deserialization through deserialize_tensor
  • Why exploitation is possible: Operation identifiers and parameters may reach deserialization logic without adequate type, range, or semantic validation

Why this happens

The underlying bug combines insufficient input validation with an unsafe deserialization boundary. Data supplied through op and op_params is processed in a context where the server does not sufficiently constrain the expected operation, parameter structure, or allowable values before reconstruction occurs. This maps to CWE-20: Improper Input Validation and CWE-502: Deserialization of Untrusted Data, because externally influenced data is accepted by a deserialization routine without a sufficiently restrictive contract.

Potential impact

  • A remote attacker may trigger unintended deserialization behavior
  • The service could experience crashes or denial of service
  • Process memory or internal model-operation state could be affected
  • Application integrity could be weakened through unexpected operation handling
  • In configurations with broader privileges, compromise could extend to accessible local resources

General mitigation guidance

Mitigation generally centers on reducing trust in RPC inputs and enforcing a narrow, explicit protocol contract.

Common defensive patterns include:

  • Restricting deserialization to safe, non-executable data representations
  • Allowlisting supported operation identifiers and parameter types
  • Applying strict length, range, encoding, and structural validation before deserialization
  • Rejecting unknown, malformed, or semantically inconsistent operation parameters
  • Placing RPC services behind authentication, authorization, and network segmentation
  • Running the server with least privilege and limiting access to sensitive resources
  • Treating parser and validation failures as contained request errors rather than process-fatal conditions

How teams detect issues like this

Detection programs commonly look for deserialization routines that consume network-controlled fields without preceding validation.

Useful approaches include:

  • Static analysis for RPC or socket input flowing into deserialization functions
  • Code review checks for allowlists covering operation names, parameter schemas, and numeric bounds
  • Tests using malformed, truncated, oversized, unknown, and type-conflicting operation values
  • Runtime monitoring for repeated deserialization failures, abnormal request patterns, and unexpected server restarts
  • Policy enforcement requiring authentication and restricted network exposure for RPC endpoints
  • Automated security review tools that identify untrusted data flows into parser and reconstruction logic

Sources

SourceLink
github.comgithub.com/ggml-org/llama.cpp/
github.comgithub.com/ggml-org/llama.cpp/issues/25289
vuldb.comvuldb.com/cve/CVE-2026-78147
vuldb.comvuldb.com/submit/882534
vuldb.comvuldb.com/vuln/394534
vuldb.comvuldb.com/vuln/394534/cti

Frequently asked

questions

Yes, the reported attack path is remote when an attacker can reach the ggml-RPC Server and submit data that controls the relevant operation fields. Practical exploitability depends on network exposure and access controls.

Authentication requirements depend on the deployment. An exposed endpoint with weak or absent authentication presents greater risk, while strict authorization can limit who reaches the vulnerable processing path.

Treat RPC input as untrusted, validate op and op_params against a strict allowlisted schema, and use a safe deserialization format that cannot construct unintended objects or states.

Define explicit protocol contracts, test parser boundaries with malformed inputs, restrict RPC network access, apply least privilege, and require code review or automated analysis for untrusted-data deserialization flows.

Find out what's already
exploitable in your codebase.