[Bug]: Authenticated images are sent as publicly cacheable and immutable

Open
#107 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
Half a day
Newbie friendliness
74/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
rust
Domain
backend, security

Research direction

Start at the header construction in src/api/images.rs around line 16, where Cache-Control: public, max-age=604800, immutable is emitted, and check which image routes sit behind auth so only those switch to private. Read src/api/library.rs for the existing ?v=…&l=… versioning scheme, then apply it to the poster URLs built in src/automation/series.rs, src/automation/import.rs and src/api/automation.rs. Done means authenticated image responses are privately cacheable and the automation/notification URLs change when artwork does; note the report was from code reading, so confirm on a running server if you can.

Written by the indexing model from the issue text.

Description

bug

[!NOTE]
This issue was written by Claude (Claude Opus 5.5) from a code review session with @PhrolovaMoe. It was found by reading the code and hasn't been reproduced on a running server.

Version

0.40.0 (feat/desktop, 017a837b)

Area

Other

What happened?

Item art, season posters and stills are only for signed-in users with library access, but are sent with Cache-Control: public, max-age=604800, immutable (src/api/images.rs:16), so a shared cache or proxy may store and serve them to others. Also, the poster URLs built by automation and notifications (/api/images/item/{id}/poster, e.g. in src/automation/series.rs, src/automation/import.rs, src/api/automation.rs) have no ?v=, so after artwork changes browsers keep the old picture for a week.

Expected behavior

Private caching for authenticated images, and URLs that change when the artwork does.

Suggested fix

Use private, max-age=604800, immutable for everything behind auth, and add the same ?v=…&l=… versioning src/api/library.rs uses to the automation/notification URLs.

Dominant language
TypeScript
Stars
4
Forks
1
Avg merge
4h 49m
Merged PRs (30d)
5

Getting set up

  • Ships a Dockerfile or Docker Compose file
  • No pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from tinystream-dev/tinystream

All issues in tinystream-dev/tinystream

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.