Bind optimized HLS base/data segment tokens#603
Merged
Bladestar2105 merged 1 commit intoMay 7, 2026
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
baseanddatablobs, letting attackers combine headers/safety flags from one playlist with a URL from another to bypassisSafeUrland exfiltrate/internal-request sensitive data.Description
bindingId(b) in the HLS rewriting paths (proxyLiveandproxyTimeshift) and include it in both the encryptedbaseand per-segmentdatapayloads insrc/controllers/streamController.js.proxySegmentthat when abaseis supplied the decrypteddata.bmatches thebase.b, returning HTTP400on missing/mismatched binding, while keeping legacy single-payload (dataonly) behavior intact.tests/performance/segment_encryption.test.jsto include binding-aware optimized payloads and a negative test that ensures mismatched bindings are rejected.Testing
tests/performance/segment_encryption.test.jsto cover legacy, optimized, and mismatched-binding cases (new negative test asserts400for mismatch).npm exec vitest run tests/performance/segment_encryption.test.jsbut the run failed in this environment due to missing nativebetter-sqlite3bindings (better_sqlite3.node), so the test suite could not execute here.src/controllers/streamController.jsand the added assertions, preserving existing behaviors; please run CI (ornpm exec vitest ...) in an environment withbetter-sqlite3native bindings to verify tests pass.Codex Task