1.7 KiB
1.7 KiB
id, title, status, assignee, created_date, labels, dependencies, references, priority
| id | title | status | assignee | created_date | labels | dependencies | references | priority | |
|---|---|---|---|---|---|---|---|---|---|
| ML-5 | Document Last.fm OAuth callback trust boundary | To Do | 2026-04-20 08:48 |
|
low |
Description
GitHub: created 2026-04-16 · updated 2026-04-16
Summary
GET /auth/last_fm/callback?token=X is unauthenticated by design (OAuth flow requires it) but triggers storage of a session key in the encrypted secrets table. The trust model is not captured in comments, so future reviewers may re-flag it.
Evidence
lib/music_library_web/controllers/last_fm_controller.ex:7lib/music_library_web/router.ex:55(route outside:logged_inpipe)
Attack surface: cannot forge a valid token (Last.fm validates), but a malicious caller could consume LastFm.get_session/1 rate-limit quota. Acceptable given the threat model.
Fix
Add a short @moduledoc or inline comment in last_fm_controller.ex explaining:
- Why this endpoint is unauthenticated (OAuth flow cannot carry session cookies across the Last.fm redirect)
- What protects it (Last.fm-validated token, rate limiter, single-user scope)
- What the failure modes look like (invalid token → store nothing, error logged)
Similarly in router.ex:55, a brief comment noting the deliberate exception from :logged_in.
Acceptance Criteria
last_fm_controller.exhas a comment documenting the trust boundaryrouter.ex:55notes the deliberate pipeline exemption
- #1
last_fm_controller.exhas a comment documenting the trust boundary - #2
router.ex:55notes the deliberate pipeline exemption