diff --git a/TODO.md b/TODO.md index 7a94b31..17bc31e 100644 --- a/TODO.md +++ b/TODO.md @@ -51,28 +51,73 @@ Worth adding at the same time: ## Frontend -### No CSP, so scripted EPUBs run against the app origin +### Scripted EPUBs run against the app origin -EPUB files may contain JavaScript. foliate-js renders each section in an iframe from a -**same-origin** `blob:` URL and cannot sandbox it — `allow-scripts` is required, and -blob URLs inherit the embedder's origin — so script inside a book can reach `/api/*` -with the session cookie attached. foliate's own README says not to use it without a -Content Security Policy blocking scripts. +**This is a regression from the foliate-js migration, not a pre-existing gap.** -The obvious policy is `kit.csp` in `svelte.config.js` with `script-src: ['self']`, and -deliberately no `default-src` (it would also cover `style-src`/`img-src`/`font-src` and -kill both the book's own blob: assets and the inline `