Repository navigation
fix: security and ownership fixes from an audit - #55
Merged
Merged
Conversation
Silo artwork links that Python's URL parser and requests read differently (https://evil\@silo/) are no longer fetched, so the API key can't follow one to another host; storage on other hosts is checked against the usual CAs. Images over 12.5 million pixels are refused before decoding. A config.yml holding the key that others can read is made owner-only on load. Two list slugs no longer share a cache file, and an empty answer from mdblist keeps the saved copy. A pending create only claims a collection for a day, and only one holding titles CineSets sent, so a user's own collection with the same name is never taken, emptied and later deleted; a create that hands back someone else's collection is refused the same way. The dashboard's sessions have ids, and signing out ends one for good, copied cookie included. Request headers have a 15 s deadline and open connections are capped at 64, so trickling clients can't lock everyone out. The scheduler treats a job with nothing picked as done and times jobs from their start; --all can't be mixed with --only, --group or --unpicked. The Claude review runs Claude with read-only tools and no GitHub token, and a separate step without the API key posts its JSON, refusing anything that looks like a key. Also a .dockerignore, time zone data in the image, systemd hardening and an accurate warning about root cron jobs.
Contributor
|
The fixes look sound, and the Silo origin check, ownership claims and session handling hold up. I found one regression in the scheduler: a failed job that ran for over an hour is now retried straight away.
|
Timing every run from its start made a job that failed after more than an hour due again the moment it ended (found by the Claude review on #55). Finished runs are still timed from their start, so they don't drift.
…torage checks The note that config.yml was made owner-only now goes to stderr, so output other programs read (a run's printed results) stays clean. The Silo storage test now checks the rule this PR introduces: server.verify applies to Silo's own address, and storage elsewhere is always verified.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
Fixes from a full audit of CineSets: the web dashboard, the server clients and outbound fetches, the deployment files and workflows, and the engine and CLI logic. Each finding was checked against the code, most by reproducing it, before it was fixed. Nothing critical was found.
Ownership (the core promise)
pendingrecord with no expiry. A later run could claim a user's own collection with the same name, replace its titles, and delete it when its season ended. A pending create now only claims a collection for a day, and only one holding nothing but the titles CineSets sent. Records from before this change claim nothing (the usual "already exists, run adopt" message covers them). A create that hands back an existing collection, as Emby does, is checked the same way.Silo and outbound fetches
urlparse, which reads some malformed links differently from the library that actually connects. A link Silo passed through could therefore have sent the key elsewhere (Silo's own link filtering currently blocks the example case). Links the two parsers disagree on, or with credentials, spaces or other schemes, are no longer fetched at all, and IPv6 addresses still work.server.verify(off, or a CA file) now applies only to Silo itself. Artwork storage on another host is checked against the usual certificate authorities.config.ymlholding the API key that other users can read (copied by hand from the example, say) is made owner-only when it's loaded, with a note.user@list.json. Two slugs likea__b/canda/b__cused to share a file, so one list could be served the other's titles. Copies saved under the old names are still read until they're replaced.Dashboard
web.json. A copied cookie stops working at sign-out, and other devices stay signed in. Old-style cookies no longer count, so everyone signs in once after updating.Scheduler and CLI
--allcan't be combined with--only,--groupor--unpicked.remove --only m-x --allused to remove everything CineSets made.Workflows and deployment
ghcommands took any extra flags, and itsReadtool could read the process environment. Text in a pull request could therefore have led it to post the API key or send it to another host. Now:/proc,/sysor/etc. It answers with JSON..dockerignore, sodocker build .in a working install doesn't sendconfig.yml,data/orvenv/to the builder.TZline in the compose example. Seasonal collections go by the local date, which was always UTC in the container. CI checks thatTZtakes effect.UMask=0077,PrivateDevices, kernel and cgroup protection, no capabilities, IP and Unix sockets only).install.sh's warning about root cron jobs now says what the risk is: root runsrun.sh, a file the folder's owner can change. It no longer claims those jobs "stop without doing anything".constraints.txtno longer says Dependabot updates it.Not changed in this PR (repository settings, for the owner):
CLAUDE_CODE_OAUTH_TOKENandANTHROPIC_WORKSPACE_IDsecrets.How I tested it
main(checked for the ownership and Silo ones) and passes here:test_ownership.py: an old, expired or foreign-titled pending create claims nothing and leaves the user's collection alone; a create that hands back someone else's collection is refused.test_silo.py: hostile artwork links are never fetched or given the key; storage on another host is verified even withverify: false.test_web_security.py: sign-out ends that session even for a copied cookie while another device stays signed in; old-style cookies are refused; a client trickling its headers is hung up on; connections beyond the cap are closed and the dashboard still answers.test_scheduler.py: a job with nothing picked is done; finished jobs are timed from their start; a long failed job waits its hour from its end.test_lists_cache.py: separate cache files for look-alike slugs; old cache names still read; an empty answer keeps the saved copy.test_catalog_config.py: a key-holding config is made owner-only (one without a key is left alone);--allwith a narrower choice is refused.test_mosaic.py: a 30-million-pixel image is refused before decoding.ruff check .andshellcheckare clean.gh(a normal review, one containing a key-like string, and plain text), and checked the failure step keeps a message to one line.TZcheck), and the reworked Claude review.Release notes
AI disclosure (required)
AI tools used and what they did:
I designed and directed this change (an audit split into dashboard, clients, deployment and engine reviews, every finding checked against the code before fixing, and fixes that keep CineSets' ownership rules strict rather than convenient) and used Claude Opus to help run the audit and write the code, tests and docs.
Checklist
fix: keep posters on Jellyfin 12.