You need to agree to share your Hugging Face information to access this model

This repository is publicly accessible, but you have to accept the conditions to access its files and content.

Log in or Sign Up to review the conditions and access this model content.

GGUF GLM4 nextn_predict_layers Load-Time Abort PoC

This repository contains a minimal private-report proof of concept for a llama.cpp GGUF model-file validation issue.

The malformed sample is a 288-byte structurally valid GGUF file. It is accepted by the low-level llama-gguf reader, but llama-simple aborts during GLM4 hparameter loading because glm4.nextn_predict_layers is equal to glm4.block_count.

Files

  • files/make_minimal_glm4_nextn.py: Generates the control and abort GGUF samples.
  • files/glm4_nextn_valid_metadata.gguf: Control sample with nextn_predict_layers=1.
  • files/glm4_nextn_assert_metadata.gguf: Abort sample with nextn_predict_layers=4 and block_count=4.
  • files/glm4_nextn_gguf_read_output.txt: Low-level GGUF reader output.
  • files/glm4_nextn_valid_llama_simple_output.txt: Control loader output.
  • files/glm4_nextn_assert_llama_simple_output.txt: Abort loader output.
  • files/glm4_nextn_valid_rc.txt: Control exit code.
  • files/glm4_nextn_assert_rc.txt: Abort exit code.

Reproduction

Build llama.cpp at commit a9883db8ee021cf16783016a60996d41820b5195:

cmake -S . -B build -DLLAMA_BUILD_TESTS=OFF -DLLAMA_BUILD_EXAMPLES=ON -DLLAMA_BUILD_SERVER=OFF -DGGML_METAL=OFF -DGGML_ACCELERATE=OFF
cmake --build build --target llama llama-gguf llama-simple --parallel 4

Run:

python3 files/make_minimal_glm4_nextn.py
./build/bin/llama-gguf files/glm4_nextn_assert_metadata.gguf r
./build/bin/llama-simple -m files/glm4_nextn_assert_metadata.gguf

Expected vulnerable behavior:

src/models/glm4.cpp:9: GGML_ASSERT(hparams.nextn_predict_layers < hparams.n_layer && "nextn_predict_layers must be < n_layer") failed

This repository is intended only for private vulnerability review.

Downloads last month
4
GGUF
Model size
0 params
Architecture
glm4
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