Instructions to use salvepilo/llama-cpp-scores-oob-poc with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use salvepilo/llama-cpp-scores-oob-poc with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="salvepilo/llama-cpp-scores-oob-poc", filename="poc_scores_oob.gguf", )
output = llm( "Once upon a time,", max_tokens=512, echo=True ) print(output)
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use salvepilo/llama-cpp-scores-oob-poc with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf salvepilo/llama-cpp-scores-oob-poc # Run inference directly in the terminal: llama-cli -hf salvepilo/llama-cpp-scores-oob-poc
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf salvepilo/llama-cpp-scores-oob-poc # Run inference directly in the terminal: llama-cli -hf salvepilo/llama-cpp-scores-oob-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-scores-oob-poc # Run inference directly in the terminal: ./llama-cli -hf salvepilo/llama-cpp-scores-oob-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-scores-oob-poc # Run inference directly in the terminal: ./build/bin/llama-cli -hf salvepilo/llama-cpp-scores-oob-poc
Use Docker
docker model run hf.co/salvepilo/llama-cpp-scores-oob-poc
- LM Studio
- Jan
- Ollama
How to use salvepilo/llama-cpp-scores-oob-poc with Ollama:
ollama run hf.co/salvepilo/llama-cpp-scores-oob-poc
- Unsloth Studio
How to use salvepilo/llama-cpp-scores-oob-poc with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for salvepilo/llama-cpp-scores-oob-poc to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for salvepilo/llama-cpp-scores-oob-poc to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for salvepilo/llama-cpp-scores-oob-poc to start chatting
- Docker Model Runner
How to use salvepilo/llama-cpp-scores-oob-poc with Docker Model Runner:
docker model run hf.co/salvepilo/llama-cpp-scores-oob-poc
- Lemonade
How to use salvepilo/llama-cpp-scores-oob-poc with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull salvepilo/llama-cpp-scores-oob-poc
Run and chat with the model
lemonade run user.llama-cpp-scores-oob-poc-{{QUANT_TAG}}List all available models
lemonade list
Install from WinGet (Windows)
winget install llama.cpp
# Start a local OpenAI-compatible server with a web UI:
llama-server -hf salvepilo/llama-cpp-scores-oob-poc# Run inference directly in the terminal:
llama-cli -hf salvepilo/llama-cpp-scores-oob-pocUse 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-scores-oob-poc# Run inference directly in the terminal:
./llama-cli -hf salvepilo/llama-cpp-scores-oob-pocBuild 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-scores-oob-poc# Run inference directly in the terminal:
./build/bin/llama-cli -hf salvepilo/llama-cpp-scores-oob-pocUse Docker
docker model run hf.co/salvepilo/llama-cpp-scores-oob-pocYAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
llama-cpp-scores-oob-poc
Heap Buffer Over-Read via Mismatched Tokenizer Array Lengths in GGUF
This repository contains a proof-of-concept (PoC) demonstrating a heap buffer over-read vulnerability in llama.cpp caused by mismatched tokenizer array lengths in a crafted GGUF model file.
Vulnerability Summary
When loading a GGUF model, llama.cpp reads tokenizer metadata arrays (such as token scores and token types) and assumes their lengths match the vocabulary size. A specially crafted GGUF file can provide arrays with fewer elements than the declared vocabulary size, causing llama.cpp to read beyond the bounds of the allocated heap buffer when accessing token scores.
This results in a heap buffer over-read, which may lead to information disclosure or a crash.
Files
| File | Description |
|---|---|
poc_scores_oob.gguf |
Crafted GGUF model file that triggers the vulnerability |
poc_scores_oob.py |
Python script used to generate the malicious GGUF file |
Reproduction
# Build llama.cpp, then run with the crafted model:
./llama-cli -m poc_scores_oob.gguf -p "test"
Disclaimer
This PoC is provided for security research and responsible disclosure purposes only. Do not use it for malicious purposes.
- Downloads last month
- 15
We're not able to determine the quantization variants.
Install from brew
# Start a local OpenAI-compatible server with a web UI: llama-server -hf salvepilo/llama-cpp-scores-oob-poc# Run inference directly in the terminal: llama-cli -hf salvepilo/llama-cpp-scores-oob-poc