1 Safety
liquibyte edited this page 2026-11-19 16:23:32 -06:00

Safety

A project, a folder of Markdown notes or an import can come from anyone, and so can the pictures its notes name. This page explains how Skein keeps a hostile picture away from your files: the jailed worker that decodes every picture, the checks on what comes back, what happens on a system without the jail, and what else Skein does to keep your work safe.

1. Why pictures are decoded in a jail

To show a picture, a program has to take apart every byte of a PNG, JPEG, GIF or BMP file. That code is complicated, and a file made on purpose to hit a bug in it could make the program do something it was never meant to do, with all your rights: read your files, change them, or send them away.

Skein therefore never decodes a picture itself. It reads the picture file and hands its bytes to a separate process, the worker, which is locked in a jail: a set of rules, enforced by the Linux kernel, that leaves it nothing worth stealing and no way to send anything out or change anything. If a hostile picture did take over the worker, it would find itself in an empty room. And because a worker that a picture has taken over could answer anything, Skein checks every answer before it draws it.

Skein reads a picture file and sends its bytes to the jailed worker; the worker decodes them and sends back pixels; Skein checks the answer before drawing it in the Document panel, the Relationships tab or an Image field

The red border is the jail. The worker talks only to Skein, over a private connection that the jail leaves open.

2. Which pictures go through the worker

  • The images of a document in the Document panel (![](picture.png), or Insert Image).
  • Any image on the page of the Inspector's Relationships tab.
  • The thumbnail of an Image field on the Inspector's Properties tab.

There is no other way: Skein has no setting to decode pictures without the jail.

3. What the jail allows and forbids

The jail is made from two features of the Linux kernel, Landlock and seccomp. They need no administrator rights and nothing to install. The jail is all or nothing: if any part of it cannot be set up, the worker does not run at all.

Area The worker
Reading files None. Skein reads the picture file and sends the worker its bytes.
Writing Nothing, anywhere: no file can be made, changed, renamed, emptied or deleted, and it may not make a file of any size. Only /dev/null can be written to.
Network No connections of any kind: no internet, no local network, no local sockets, so also no way to reach your desktop (the X server) or D-Bus.
Other programs Cannot start a program, make a new process, send a signal, or look into the memory of another process.
The kernel No access to kernel features that are not needed for decoding, such as mounting, namespaces, the kernel keyring, io_uring or bpf.
Limits At most 2 GiB of memory and 16 open files, no core dumps. It gets nothing from Skein but its connection: no open files, and no terminal.

4. The checks on what comes back

  • A picture larger than 16384 pixels on a side is refused.
  • The answer must have the size Skein asked for at most (a thumbnail box, or the picture as it is), and exactly the number of pixels that size needs. Skein checks the size before it sets aside memory for the answer.
  • Every request has 5 seconds. A worker that takes longer, ends, or answers nonsense is stopped, and the next picture starts a new one. A worker that only fails to decode a picture goes on with the next one.
  • The worker ends when Skein ends.

5. A system without the jail

The jail needs Linux 5.13 or later on an x86-64 or ARM64 processor, with Landlock and seccomp turned on in the kernel. On any other system, and when the jail cannot be set up, Skein shows no picture at all rather than decode one outside the jail: an image in a document shows as an outlined box with its path beside it, and an Image field's thumbnail shows only a thin outline. Skein gives no message about it. Everything else works as usual.

6. Other protections

  • Links run nothing. A click on a link opens a program only for an address that starts with http://, https:// or mailto:, and then only through xdg-open, with no shell. Any other link only selects an object, or says that it leads nowhere.
  • Your project file is changed only when you save. Until a save or autosave, every change is held back, so a crash leaves the file as it was at the last save; see Projects and Saving. Each File > Save also keeps backup copies of the project file: three at first, set with Settings > General > "Backups to keep (one per Save)". Autosave makes no backup copies.
  • A new project is not lost by Save. Until you save it, a new project is kept only in memory; Save, also in the question asked when you quit or leave it, asks for a file name, and cancelling that cancels the quit. Autosave leaves such a project alone, so its * stays.
  • Markdown files are written only when you save, and Skein asks before anything would drop edits not saved yet, Close File included. A note's file is written to a temporary file beside it and then put in place in one step, so it is never left half written. A project made with Save Folder As Project never writes to the Markdown files.
  • Escape never quits. It closes a dialog, a list or the Find bar; Skein quits only with File > Quit, Ctrl+Q or the window's close button.
  • Failures are told. A save, Save As, autosave, restore, import or export that fails, and a file that is not a Skein project, are named in a message in the window.

7. Known limitations

  • Only pictures are decoded in the jail. Skein itself reads the Markdown of documents, the project database, the files of the importers (CSV, XML and JSON) and its own icons.
  • Skein does not say when the jail is not available; pictures are simply not shown.