From f17260aca736e49d34fff20fec32c97b66047bf9 Mon Sep 17 00:00:00 2001 From: John Ferlito Date: Wed, 28 Oct 2026 11:31:34 +1100 Subject: [PATCH 1/2] docs: record ADR 0005 and tell redirect targets to protect themselves (#135) ADR 0005 records that the library sandboxes the bytes it delivers. The Storage page now says the library can't add headers to a redirect target, and what a redirecting backend or a CDN in front of S3 should do instead. --- .../0005-library-sandboxes-delivered-bytes.md | 59 +++++++++++++++++++ .../src/content/docs/strategies/storage.mdx | 9 +++ 2 files changed, 68 insertions(+) create mode 100644 docs/adr/0005-library-sandboxes-delivered-bytes.md diff --git a/docs/adr/0005-library-sandboxes-delivered-bytes.md b/docs/adr/0005-library-sandboxes-delivered-bytes.md new file mode 100644 index 0000000..54ca8d0 --- /dev/null +++ b/docs/adr/0005-library-sandboxes-delivered-bytes.md @@ -0,0 +1,59 @@ +# 5. The library sandboxes the bytes it delivers + +Date: 2026-10-28 + +## Status + +Accepted + +## Context + +Content and much Metadata come from depositors and nobody vets them. The +library served them on the API's origin under their own Content-Type and with +no other protective headers. So opening a deposited HTML or SVG file ran its +scripts on that origin, where they could reach cookies, same-origin pages and +any sign-in or admin UI the deployment hosts there. + +Browsers render inline PDFs, images and text under `Content-Security-Policy: +sandbox`. That holds in current Chrome and Firefox, and in Safari from 18.4; +Safari 17.4.1 to 18.3 won't show a PDF under it. Chrome won't play audio or +video opened directly under `sandbox`, because the media document refetches +the file from an opaque origin and fails CORS. It also won't play them under +`default-src 'none'` without `media-src`. A browser can't run script in a +media document, and `