gnome-nifti-preview

Security

Threat model

A .nii or .nii.gz file can come from anywhere: a download, an archive, a shared folder, a public dataset. Selecting it in Files and pressing Space is enough for it to be read, so every file is treated as hostile. Reading one must never freeze the desktop, crash the previewer, or do anything but read.

The file is parsed by nifti-preview, a separate process started for each preview and stopped when it closes. GNOME Sushi only receives a few small JSON replies and RGB pixels from it.

What protects you

Bounded work and memory (backend):

Sandbox (backend, Linux, best effort on older kernels):

A memory bug in the code that parses the file, including the C library used for gzip, therefore cannot write to your files, run a program or reach the network. On a kernel without Landlock (before 5.13) the file restrictions are missing; the socket filter, the memory cap and no new privileges remain. NIFTI_PREVIEW_DEBUG=1 prints what was applied, and the hello line of the protocol reports it.

Terminal viewer (nitty):

Previewer side (GJS):

Thumbnails: GNOME Files runs gnome-nifti-preview-thumbnailer thumbnail in its own bubblewrap sandbox (only /usr, the file and the output; no network, no home folder). The program then opens its output and applies the sandbox above before it reads the file, with a lower memory cap (1 GB of voxel data) and a limit on the compressed data it inflates ([thumbnails] max-file-mb).

Installers:

Releases:

Checking a download

sha256sum -c gnome-nifti-preview.tar.gz.sha256     # or nitty.tar.gz.sha256
# public repository: also check where and how it was built
gh attestation verify gnome-nifti-preview.tar.gz --repo EloiNavet/gnome-nifti-preview

Reporting a vulnerability

Please do not open a public issue. Use Security → Report a vulnerability on the GitHub repository, so that the report stays private until a fix is released.