Commit 378cefc
Document verifyTokenLoose JWT-in-URL tradeoff in READMEs
Background security review flagged verifyTokenLoose for putting bearer
JWTs in URLs (leak via access logs, browser history, Referer header
from rendered EPUB/PDF content, intermediate proxies). The pattern is
deliberate — it exists because plain <img>/<embed>/<iframe>/<a download>
tags can't set Authorization headers — and accepted for small
self-hosted single-user-base deployments behind a single reverse proxy.
Documenting the tradeoff explicitly so future consumers don't take the
pattern as "fine":
- authentication/README.md: full "known tradeoff" section with the
asset-scoped-capability-token migration path (POST asset-token
endpoint returns short-lived sub-scoped JWT, asset route verifies
res === expected + exp, Referrer-Policy: no-referrer).
- bookshelf/README.md: shorter security note pointing to the
authentication docs, plus a concrete callout that EPUB/PDF content
is exactly the kind of payload that can leak the token-bearing URL
via Referer.
Code unchanged in this commit — see authentication 0.3.0 / bookshelf
0.2.0 if/when the scoped-token migration is taken on.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>1 parent a966d7c commit 378cefc
2 files changed
Lines changed: 33 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
29 | 52 | | |
30 | 53 | | |
31 | 54 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
90 | 100 | | |
91 | 101 | | |
92 | 102 | | |
| |||
0 commit comments