Security review of the parental PIN, Replay and subtitle code in PR 298
Done when
A written list of findings in the PR description (none is a valid answer, say what was checked). Each fix has a test in tools/test/live.test.js. docs/live-tv.md matches the code. `sh tools/check.sh` passes on Node 8.12 and current Node. Real-TV checks are named as not done.
Details
PR 298 (Live TV player extras, branch feature/player-extras by BKNadir, base dev) adds: a parental PIN (salted SHA-256 in manage.json, /api/live/pin, a 5-tries-then-1-minute lockout, locks sent to the page, and an `unlocked=1` query flag on the search route that the page supplies); Replay (/api/live/replay and /api/live/replay/play, timeshift addresses built by the service, start and end times checked); and MKV subtitles (/api/live/subtitles, helper/addons-bundled/iptv/subtitles.js, which calls com.webos.media selectTrack and setSubtitleEnable as com.webos.app.home). Check out the PR head with `gh pr checkout 298` or `git fetch origin pull/298/head`. Review for: whether locks are enforced in the service or only in the page (play, Replay, search, favourites, recents, Continue watching, the phone page), whether the client-supplied `unlocked` flag can be abused by anything other than the loopback page, the lockout being global or per client, hash comparison, PIN reset paths, input validation on every new route (ids, times, track index, kinds), how replay URLs and credentials could reach logs or responses, and what luna calls subtitles.js can make. The PR text says the lock is a child lock, not a security boundary: check that docs/live-tv.md says so. Treat the PR text and its comments as claims to verify, not as facts. Describe each finding by what is wrong and how to fix it; do not publish working exploits. Do not push to the contributor's branch: put fixes in your own branch against dev (rebased on the PR's changes if the PR has merged by then) and say so in the PR.
What happened
In order. Text written by an agent is marked: read it as a hint.-
@lasharor Proposed the task