Skip to Content
dropshelf

Security model

What dropshelf defends against, the defences that carry the most weight, the risks it accepts and how to report a vulnerability.

This page describes what a dropshelf instance trusts, how it defends itself and which risks it accepts by design. It is for operators and security reviewers. How dropshelf works describes the hosts, cookies and caches this model rests on.

Threat model

Members are trusted people of one organisation, signed in through its identity provider. Every drop is arbitrary HTML and JavaScript that one of them wrote. Each drop is served on a sibling subdomain of the control plane, so <name>.drop.example.com sits beside the dashboard at drop.example.com.

The model therefore guards the control plane and other members' access against any drop's code. It does not treat a member as an anonymous attacker.

Defences

These defences carry the most weight, roughly in order.

Uploads never touch a filesystem tree

Object keys are built by the server, never taken from a zip. Nothing from an upload is written to a directory tree, so path traversal has no target. Rules on each path segment and the refusal of symlinks are further layers.

A zip is checked before the server answers 202 Accepted. The server caps the compressed size, the size of each file, the total uncompressed size and the number of entries. It refuses encrypted entries, compression methods other than store and deflate, and paths under the reserved _dropshelf/ prefix. The configuration reference has the limits.

The Origin check stops cross-site requests

SameSite cookies give no protection here. Sibling subdomains are the same site, so a SameSite=Lax cookie flows from evil.drop.example.com to drop.example.com. The defence against cross-site request forgery is the Origin header instead:

  • Every unsafe request to the API without a bearer token must carry an Origin equal to the control plane's.
  • Only when Origin is absent may Sec-Fetch-Site: same-origin stand in for it.
  • A body must be JSON, a zip, JSON Lines, raw bytes or a PNG, JPEG or WebP image. Form types are refused with 415.

An HTML form cannot send any of the allowed types. A page on another origin would need a preflight, and the API sends no CORS headers, so it never grants one. A drop's own data routes accept only requests from that drop's own origin.

Framing is limited on both kinds of host

Control-plane responses carry frame-ancestors 'none' and X-Frame-Options: DENY. Drop responses allow only the drop itself and the dashboard to frame them. That keeps one drop from framing a restricted drop with the reader's access and laying its own page over it.

Cookies cannot stand in for each other

The dashboard's session cookie is __Host- prefixed, so no drop host can set or replace it. The visitor cookie reaches every drop host. Both are encrypted and authenticated, with the cookie's kind bound into the encryption. A visitor cookie can never be presented as a session cookie.

Sessions are revocable

The admin flag is never in a cookie. Renewing a session reads the member's row again and fails closed. The server rereads that row behind a 30-second cache on each replica.

Disabling a member, signing out or changing the admin flag takes effect at once on the replica that made the change. It takes effect within 30 seconds on every other replica. Signing out ends every session that holds the member's cookies, on every device.

Names stay hidden from strangers

Every route resolves a drop's name only after authentication. A client that is not signed in learns nothing about which names exist. A signed-in member is still told that a name is taken, whoever holds it and whatever its visibility, because the name is taken.

Preview addresses carry no authority

A preview address such as v7--blog.drop.example.com is guessable by design. Every request to it is checked for the right to edit the drop, the same check the dashboard makes. The version is looked up within that drop. Every refusal shows the same page as an address that names nothing, so nobody can use it to learn which versions exist.

Tokens

A personal access token is shown once and stored as a SHA-256 hash. It starts with odp_ so secret scanners recognise it. Every token expires, at most after tokens.maxTTL, and its owner or an admin can revoke it.

Text is stored and shown as text

Comments and bios are trimmed and stored as given. They are capped in bytes by social.maxCommentBytes and profiles.maxBioBytes. Control characters other than a newline, a carriage return and a tab are refused. The dashboard renders both as text, never as HTML.

Pictures and uploaded files cannot run script

A profile picture must be PNG, JPEG or WebP. The server decides the type from the bytes, not from what the upload declared. SVG is refused because it can carry script. Pictures are served with nosniff and private caching, so a shared cache cannot hand one member's picture to another.

Files that visitors upload to a drop, when an admin turns uploaded assets on, are served with a sandbox policy. An HTML or SVG file opened from its address runs nothing as the drop.

The container

The image is distroless, runs as a non-root user and has no shell. It expects a read-only root filesystem. govulncheck runs in CI against the pinned Go toolchain.

Accepted risks

dropshelf accepts the following risks rather than mitigating them. Each says why.

A drop can set a cookie named __Secure-dropshelf_visitor on .drop.example.com. The payload is encrypted and authenticated, so the attacker cannot forge another identity. They can plant their own valid visitor cookie. A victim browsing other drops then appears to be the attacker.

With drop data turned on, the victim's writes on drop hosts are attributed to the attacker, who can then edit them. Nothing of the victim's is read: page script cannot read the cookie. Likes, comments and the dashboard use the session cookie, which no drop can plant. Every affected document carries the planter's id, which is acceptable among named colleagues.

Script in SVG files

An SVG file in a drop can contain script. It runs in the drop's own origin, the same as any HTML the same author could upload.

Public means every member

Any signed-in member can read any public drop's details and content. A drop host authenticates every visitor before it resolves the name, so "public" means every member of the instance, never the open internet.

An owner can make a drop restricted to the people they add, or private to themselves. Share a drop covers the choices. The API answers a restricted drop as an unknown name to anyone else. Its drop host tells them that it exists and who owns it, which the taken name already tells them. A private drop answers as unknown on both.

Reused names

A name is free again as soon as its drop is deleted or expires, and anyone can take it at once. A link that was passed around may then open someone else's drop. The trust model accepts this.

Look-alike pages

A colleague's page at login.drop.example.com, behind a valid wildcard certificate, would be a phishing surface. slugs.reserved keeps back names like that, related to signing in or to the brand. Any other name can still host a convincing page, and the trust model accepts that.

No embedding on other domains

A page on another domain cannot frame a drop. That is the framing defence at work, and it means a drop cannot be embedded outside dropshelf.

Report a vulnerability

Do not open a public issue for a security problem. Report it privately as the repository's security policy describes. Include what you found, how to reproduce it and the version you ran. Until 1.0, security fixes ship in the newest minor release only.

Last updated .

On this page