Skip to main content
Challenges Safetensors: header metadata
Artificial Intelligence Easy ML file formats: analysing the binary header and metadata of HuggingFace Safetensors Solves: 2

Safetensors: header metadata

Author: CyberSamSU
Points
15

A neural network model deployed to a production server was exported as the model.safetensors file. The developers gave up the pickle format and moved to the safe Safetensors format, but forgot to clean the training process configuration from the model header.

The Safetensors file format has the following structure:

  • The first 8 bytes: a 64-bit unsigned little-endian integer (uint64 LE) — the byte length of the JSON header N.
  • The next N bytes: a JSON object in UTF-8 format (the dtype, shape, data_offsets properties of the tensors and the __metadata__ dictionary).
  • The remaining bytes: the buffer of raw tensor data.

In the __metadata__.training_run field of the header, a compressed training log in the form base64(gzip(json)) is stored. Note that decoy fake flags are present in the tensor buffer and in the canary_notice field. Open the real training_run object and find the BAYROQ{SAFETENSORS_META_...} flag (the last 16 characters are lowercase hex).

Attached files
model.safetensors Log in to download
Hints 3
Opening a hint reduces the points you get for solving this challenge.
Hint 1 −1 pts Log in
Hint 2 −3 pts Log in
Hint 3 −4 pts Log in
To submit a flag, log in.

First solvers

1. Mirjaxon Qaxxarov 24.11.2026
2. Odam 25.11.2026