How to use from
llama.cpp
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh
# Start a local OpenAI-compatible server with a web UI:
llama serve -hf salvepilo/llama-cpp-gemma3-divzero-poc
# Run inference directly in the terminal:
llama cli -hf salvepilo/llama-cpp-gemma3-divzero-poc
Install from WinGet (Windows)
winget install llama.cpp
# Start a local OpenAI-compatible server with a web UI:
llama serve -hf salvepilo/llama-cpp-gemma3-divzero-poc
# Run inference directly in the terminal:
llama cli -hf salvepilo/llama-cpp-gemma3-divzero-poc
Use pre-built binary
# Download pre-built binary from:
# https://github.com/ggerganov/llama.cpp/releases
# Start a local OpenAI-compatible server with a web UI:
./llama-server -hf salvepilo/llama-cpp-gemma3-divzero-poc
# Run inference directly in the terminal:
./llama-cli -hf salvepilo/llama-cpp-gemma3-divzero-poc
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git
cd llama.cpp
cmake -B build
cmake --build build -j --target llama-server llama-cli
# Start a local OpenAI-compatible server with a web UI:
./build/bin/llama-server -hf salvepilo/llama-cpp-gemma3-divzero-poc
# Run inference directly in the terminal:
./build/bin/llama-cli -hf salvepilo/llama-cpp-gemma3-divzero-poc
Use Docker
docker model run hf.co/salvepilo/llama-cpp-gemma3-divzero-poc
Quick Links

llama.cpp Gemma3 Integer Division-by-Zero PoC

Proof-of-concept for a division-by-zero vulnerability in llama.cpp's Gemma3 architecture loader.

Vulnerable file: src/models/gemma3.cpp:32

Files

  • poc_gemma3_divzero.gguf โ€” 235-byte malicious GGUF (no tensors, triggers SIGFPE on x86_64)
  • reproducer.cpp โ€” standalone C++ reproducer (no llama.cpp build needed)

Quick test

# Standalone (no llama.cpp needed)
g++ -o reproducer reproducer.cpp -fsanitize=undefined -fno-sanitize-recover=all
./reproducer
# Expected: runtime error: division by zero

# With llama.cpp
./llama-cli -m poc_gemma3_divzero.gguf -p 'hello'
# Expected on x86_64: Floating point exception (exit 136)

Root cause

When block_count=62 (โ†’ LLM_TYPE_27B) and attention.head_count is absent from the GGUF, n_head(0) returns 0 and the expression n_embd / n_head(0) is integer division-by-zero.

Reported via Huntr bug bounty program.

Downloads last month
17
GGUF
Model size
0 params
Architecture
gemma3
Hardware compatibility
Log In to add your hardware

We're not able to determine the quantization variants.

Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support