Security Hardening, Storage Limits & HTML in Notes
⚠️ Before updating: The first start hashes the tokens of all existing shares and notes, so an older release started on the same database afterwards no longer opens them. Back up the data directory first if you might go back. An uploads directory or bucket shared by several instances is no longer supported, since each instance now removes the blobs its own database does not name.
✨ Features
- server: The new
STORAGE_MAX_SIZE caps the space all stored files of an instance may take, on the filesystem and on S3. An upload that does not fit is refused before any data is sent. (#88) Thanks @MicLieg (#118)
- server: The server warns at startup when
STORAGE_MAX_SIZE is set without an upload quota or below the maximum file size. (#88) Thanks @MicLieg (#118)
- server:
/api/config reports storageLow while the storage limit has less room left than the maximum file size, without revealing the used or free space. (#88) Thanks @MicLieg (#118)
- web: An upload refused for lack of free storage shows a translated message of its own, apart from the file size errors. (#88) Thanks @MicLieg (#118)
- web: The upload page and the page for sending files into a file request show a notice while the instance is low on storage, so a large upload may be refused even below its size limit. (#88) Thanks @MicLieg (#118)
- web: Markdown blocks in notes render the HTML that GitHub allows, like
<details>, <kbd> or <br>, and filter out everything else such as scripts, styles, forms, iframes and event handlers. (#119)
🔒 Security
- server: A single-request upload that stopped sending its body could hold its reserved quota and its connection indefinitely. Its body now has to bring 1 MiB in every 10 minutes, like chunked and WebSocket uploads, or the upload is ended. (#88) Thanks @MicLieg (#118)
- server: The WebSocket upload refuses an empty frame and a frame under 64 KiB that does not end the upload, since a stream of empty frames grew the heap past every memory limit and crashed the server without any login. Thanks @simonerni (GHSA-vhxm-g864-hhqr)
- server: Shares and notes store only SHA-256 hashes of their access tokens like file requests do, and the first start replaces the tokens of existing rows. A copy of the database could download, burn and delete every live share and note before. Thanks @simonerni (GHSA-mw3x-r52w-m8fm)
- server: The database, its log, the blobs and their directories are readable by the server's user only, and existing directories get the stricter mode on start. Thanks @simonerni (GHSA-mw3x-r52w-m8fm)
- server: Deleted shares, notes and request uploads leave the SQLite log at once, so a burned note no longer stays in a later backup of the data directory until the log wraps around. Thanks @simonerni (GHSA-q6pj-x27g-57qg)
- server: Blobs of uploads that a restart or a crash cut off are removed at start and then hourly, and on S3 such multipart uploads are aborted. They stayed for good before, and a file request sender could store more than the request allowed. Thanks @simonerni (GHSA-q6pj-x27g-57qg)
- server: A share whose blob cannot be deleted keeps its record until the blob is gone, in the cleanup and when the owner deletes it. The record went first and the blob stayed with nothing left that would remove it. Thanks @simonerni (GHSA-q6pj-x27g-57qg)
- server: A login started by the command line client waits on a page of the instance until the user allows it, so a web page can no longer start one in a signed-in browser and hand the session to a program on a port of its choice. Thanks @simonerni (GHSA-8m5x-35mm-7jmw)
- server: Logout ends a session for good, also a copy of its token that a command line client holds. It only cleared the browser cookie before. Thanks @simonerni (GHSA-8m5x-35mm-7jmw)
- server: The server refuses to start with the placeholder of
.env.example as OIDC_SESSION_SECRET. Thanks @simonerni (GHSA-8m5x-35mm-7jmw)
- web: Plaintext that a closed, reloaded or crashed tab left in the browser storage of a Safari download is removed the next time SkySend opens, whatever its age. It stayed until the next download before, often for good. Thanks @simonerni (GHSA-jmxh-4vpm-vwfc)
- web: The streaming download hands the download worker only the file key and no longer broadcasts the key of the link to every tab and frame of the instance. Thanks @simonerni (GHSA-jmxh-4vpm-vwfc)
- web: A page asks before a command line client is signed in, with the account and the port it waits on. Thanks @simonerni (GHSA-8m5x-35mm-7jmw)
- client:
auth logout ends the session on the server too instead of only removing the stored token. Thanks @simonerni (GHSA-8m5x-35mm-7jmw)
- docker: The entrypoint sets
umask 077, so nothing the server creates on a bind mount is readable by other accounts of the host. Thanks @simonerni (GHSA-mw3x-r52w-m8fm)
📝 Documentation
- docs: Documented
STORAGE_MAX_SIZE with its startup warnings, the 507 answer of the upload routes, the storageLow field of /api/config and the 408 for a stalled single-request upload. (#88) Thanks @MicLieg (#118)
- docs: The backup guide takes the database with
sqlite3 .backup under umask 077 instead of a plain copy of the running files, and no longer claims hashed tokens for releases that stored them as they were. Thanks @simonerni (GHSA-mw3x-r52w-m8fm)
- docs: The backup guide and the
UPLOADS_DIR reference explain the orphan sweep, which makes the uploads directory and the bucket belong to one instance. Thanks @simonerni (GHSA-q6pj-x27g-57qg)
- docs: The threat model explains what My Links keeps in the browser and no longer claims that everything stored before stays encrypted against modified code. Thanks @simonerni (GHSA-jmxh-4vpm-vwfc)
- docs: The CLI reference describes the new confirmation of
auth login and what auth logout ends. Thanks @simonerni (GHSA-8m5x-35mm-7jmw)
- docs: The first steps guide lists which HTML a Markdown block renders and what it removes. (#119)
- docs: The environment variable reference now says that
FILE_MAX_SIZE limits a whole upload, so several files sent at once count together.
🧪 Tests
- web: The crafted note tests send HTML attacks through a Markdown block, including SVG event handlers,
javascript: links, forms, iframes, inline styles and mutation XSS, and check that GitHub's allowed HTML still renders.
- infra: An end-to-end test runs a server with a small
STORAGE_MAX_SIZE and checks the notice that storage is low and the translated refusal on the upload page and the request upload page.
🐳 Docker
- Image:
skyfay/skysend:v3.4.0
- Also tagged as:
latest, v3
- Platforms: linux/amd64, linux/arm64