harden(421,559): percent-encode access_token in IPTV URLs, redact from logs, no-store on tokened manifests #574

Merged
timothy merged 2 commits from feat/421-559-access-token-hardening into main 2026-07-23 18:31:00 +02:00
2 Commits
Author SHA1 Message Date
timothyandClaude Opus 4.8 26ec6ac5d8 docs(decisions): [decisions-edit] authorize the #552 record prose edit
PR Gates / CI image pin matches docker/ci (pull_request) Successful in 12s
PR Gates / Docs update reminder (pull_request) Successful in 13s
PR Gates / decisions lifecycle (pull_request) Successful in 22s
Build ErsatzTV Image / API docs in sync (OpenAPI + endpoint index) (pull_request) Successful in 16s
Build ErsatzTV Image / Formatting (changed .cs conform to .editorconfig) (pull_request) Successful in 17s
Build ErsatzTV Image / EF migration integrity (SQLite + MySql) (pull_request) Successful in 6m3s
Build ErsatzTV Image / Functional E2E (curl contracts) (pull_request) Successful in 15m43s
Build ErsatzTV Image / Build & test (.NET) (pull_request) Successful in 20m26s
Build ErsatzTV Image / Build & push image (amd64) (pull_request) Has been skipped
The prior commit updated the "deferred hardening" bullet of the
`security.iptv-browser-token` (#552) record — marking it RESOLVED and pointing to the new
`security.iptv-access-token-transport` record — plus its Rule/Signals lines. That is a
rationale-prose edit of an existing decision (exactly what #559's done-when asked for:
"fold into the deferred-hardening note under security.iptv-browser-token"), so it needs
the [decisions-edit] marker for the lifecycle validator. No record heading renamed, no
record removed; the #552 key/status/heading are unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-23 08:32:54 +02:00
timothyandClaude Opus 4.8 a372742eb0 harden(421,559): percent-encode access_token in IPTV URLs, redact from logs, no-store on tokened manifests
PR Gates / decisions lifecycle (pull_request) Failing after 12s
PR Gates / CI image pin matches docker/ci (pull_request) Successful in 21s
PR Gates / Docs update reminder (pull_request) Successful in 21s
Build ErsatzTV Image / Build & test (.NET) (pull_request) Successful in 7m24s
Build ErsatzTV Image / API docs in sync (OpenAPI + endpoint index) (pull_request) Successful in 22s
Build ErsatzTV Image / Formatting (changed .cs conform to .editorconfig) (pull_request) Successful in 19s
Build ErsatzTV Image / Functional E2E (curl contracts) (pull_request) Successful in 5m25s
Build ErsatzTV Image / EF migration integrity (SQLite + MySql) (pull_request) Successful in 15m51s
Build ErsatzTV Image / Build & push image (amd64) (pull_request) Has been skipped
#421 — a token containing a double-quote/ampersand could break out of the quoted M3U
`url-tvg="..."`/`tvg-logo="..."` attributes or split the query. Percent-encode
(`Uri.EscapeDataString`) at every site the token is interpolated into an M3U/HLS/XMLTV
URL: `ChannelPlaylist.ToM3U`, `IptvController.AccessTokenQuery`,
`FFmpegLibraryProcessService.WrapSegmenter`, and the XMLTV twin
`GetChannelGuideHandler` (percent-encode then XML-escape). No-op for a normal base64url
JWT, so the M3U/XMLTV goldens are byte-identical.

#559 — (1) Serilog logged the full `?access_token=<jwt>` query on any 5xx/Error `/iptv`
request. `IncludeQueryInRequestPath = false` + a new `RequestLogScrubber` enriching
`RequestPathScrubbed` (masks the token to `***`, keeps other params) that the message
template now references. (2) Token-bearing dynamic manifests (`channels.m3u`,
`xmltv.xml`, the `.m3u8` HLS manifests, and their token-bearing 302 Locations) now return
`Cache-Control: private, no-store`.

Independent cold review (2 rounds) clean. Live-E2E verified: no-store header on
m3u/xmltv/m3u8, token percent-encoded in url-tvg, and the request log rendering
`access_token=***` with the raw token absent. Decision record
`security.iptv-access-token-transport` added; resolves the deferred-hardening note under
`security.iptv-browser-token`.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-23 08:30:18 +02:00