Dataset Viewer

The dataset viewer is not available because its heuristics could not detect any supported data files. You can try uploading some data files, or configuring the data files location manually.

YAML Metadata Warning:empty or missing yaml metadata in repo card

Check out the documentation for more information.

llama.cpp GGUF Division-by-Zero DoS — Security Research PoC

Target: ggml-org/llama.cpp
File: ggml/src/gguf.cpp line 681
Severity: CVSS 5.3–6.5 (Medium)
Platform: x86_64 only (SIGFPE trap)

Summary

A crafted GGUF file with a tensor dimension of zero (ne[1] = 0) causes a division-by-zero in gguf.cpp at line 681:

INT64_MAX / info.t.ne[1]   // crashes when ne[1] == 0

The validation at line 672 only rejects negative dimensions (ne[j] < 0), allowing zero to pass through. On x86_64, the idivq instruction traps with SIGFPE (signal 8), killing the process. On ARM64, sdiv silently returns 0.

Root Cause

// gguf.cpp line 672 — current (vulnerable):
if (ne[j] < 0) { ... }   // zero passes

// Fix — change to:
if (ne[j] <= 0) { ... }  // zero rejected

Proof of Concept

  • poc_divzero.gguf — 65-byte malicious GGUF file with ne[1]=0
  • make_poc.py — script that generates the PoC

Loading the PoC on any x86_64 deployment crashes the process:

llama-gguf-split poc_divzero.gguf  # exits with signal 136 (SIGFPE) on x86_64

Impact

Any application loading untrusted GGUF files on x86_64 is vulnerable:

  • Ollama (Docker/server deployments)
  • llama.cpp server
  • LM Studio
  • GPT4All
  • text-generation-webui

Recommended Fix

Change ggml/src/gguf.cpp line 672 from ne[j] < 0 to ne[j] <= 0.


This repository contains security research materials for responsible disclosure.

Downloads last month
33