Challenges
GGUF v3: model provenance metadata
Artificial Intelligence
Medium
ML file formats: analysing the GGUF v3 binary header and the KV metadata table
Solves: 3
GGUF v3: model provenance metadata
Author: CyberSamSU
Points
55
The tiny.gguf model file intended for local LLM launchers (llama.cpp, Ollama) was submitted for expert examination. The file is built in the GGUF v3 (little-endian) binary format:
- Header: 4-byte magic (
"GGUF"),uint32version (3),uint64number of tensors (tensor_count),uint64number of metadata pairs (kv_count). - String (
gguf_str):uint64length + UTF-8 bytes (no trailing zero byte). - Each KV entry:
key(gguf_str) +value_type(uint32) + value. - Value types (
value_type):0=UINT8(1B),1=INT8(1B),2=UINT16(2B),3=INT16(2B),4=UINT32(4B),5=INT32(4B),6=FLOAT32(4B),7=BOOL(1B),8=STRING(gguf_str),9=ARRAY(uint32 elem_type + uint64 len + elementlar),10=UINT64(8B),11=INT64(8B),12=FLOAT64(8B).
The model's real provenance record is protected with a single-byte XOR in the ARRAY<UINT8> field named custom.provenance. The XOR key is the first byte of the SHA-256 hash (SHA256(general.name)[0]) of the general.name metadata string. (Note that decoy fake flags are placed in the tokenizer.chat_template and custom.canary_blob fields.) Read the GGUF KV table, decrypt the custom.provenance field and find the BAYROQ{GGUF_META_...} flag (the last 16 characters are lowercase hex).
Attached files
tiny.gguf
Log in to download
Theory: learn the topic
To submit a flag, log in.