Commit Graph

15 Commits

Author SHA1 Message Date
1f665dcb11 Authenticate browser media with durable HttpOnly login cookies
Adapted cookie, origin, URL validation and secret handling from MikaelKW/nodecast-tv-plus. Protect API roles, revoke logins across restart, preserve existing accounts, and isolate transcode sessions by account.

Co-authored-by: Mikael <mikaelkwessel@gmail.com>
2026-10-12 16:53:15 -07:00
788d43a4cb Apply AAC remux filters only to matching audio tracks
Adapted from MikaelKW/nodecast-tv-plus commit 25f7cb636a07a3efb2c409ff182920ae0fbe01bd.

Co-authored-by: Mikael <mikaelkwessel@gmail.com>
2026-10-12 16:11:34 -07:00
9fff0474e1 fix(remux): preserve encrypted HLS and test protocol restrictions
Allow nested crypto for encrypted HTTP HLS while rejecting top-level protocol wrappers and local-file access. Replace the HLS-only http_persistent option with HTTP multiple_requests across probe/remux/transcode paths, fixing the raw HTTP regression introduced by #124. Add real FFmpeg regression tests and PR CI.
2026-10-12 15:41:13 -07:00
138efd6007 fix(remux): validate stream URL scheme and restrict ffmpeg protocols (CWE-78)
The /api/remux endpoint passed the user-supplied 'url' query parameter
straight to 'ffmpeg -i <url>'. spawn() with an argv array prevented shell
injection, but ffmpeg itself accepts a wide set of protocol handlers
(file://, concat:, subfile:, data:, pipe:, crypto:, async:, cache:, ...)
that read from the local filesystem or compose existing protocols.
Because the resulting ffmpeg stdout is piped directly back to the
response, an attacker who could call /api/remux could read arbitrary
local files (e.g. ?url=file:///etc/passwd, concat:file://...).

Apply two layers of defence at the entry point only:

1. validateStreamUrl(): reject anything that is not a syntactically valid
   http:// or https:// URL, and reject any string containing control
   characters before parsing (so CR/LF/NUL cannot be silently stripped).

2. Pass -protocol_whitelist http,https,tls,tcp,hls to ffmpeg so that even
   if a future code path forwarded a different URL, ffmpeg would refuse
   to open file/concat/subfile/pipe/data/crypto/async/cache inputs.

Legitimate http/https stream URLs (including ports, userinfo, queries,
and HLS playlists) continue to work; only non-network schemes and
malformed inputs are rejected with HTTP 400.
2026-10-12 15:37:03 -07:00
f5e2c77d25 Fix ffmpeg redirects. Fix max resolution setting. 2026-04-24 15:19:19 -06:00
2c34359b2c feat: Implement hardware-accelerated HLS transcoding with granular controls, smart stereo downmixing, and robust support for MKV and 10-bit HEVC playback. 2026-01-17 03:07:16 -08:00
2a03cad213 feat: add -seekable 0 to fix 405 errors and configurable User-Agent presets for stream requests 2026-01-17 00:45:55 -08:00
8d36a2c07e feat: add subtitle extraction and display for MKV/container streams 2026-01-10 12:35:39 -08:00
346a0519e9 feat: added smart auto-transcoding with probe-based routing and MKV/remux support 2026-01-10 00:35:42 -08:00
ca87a5f143 Misc fixes for syncService, remux and proxy 2026-01-04 00:18:58 -08:00
024b847d05 Increased stream analyze duration to 0.5 seconds 2026-01-01 16:16:39 -08:00
9fb8df7255 Improve FFmpeg startup speed and stream resilience 2026-01-01 11:52:47 -08:00
2531f1786f Improved ffmpeg error resilience for ad stitched streams 2026-01-01 00:33:10 -08:00
a90ac32a3b Added FFmpeg system 2025-12-31 09:52:26 -08:00
c037ef6862 Added experimental force remux setting to remux raw ts streams to mp4 container 2025-12-30 15:27:19 -08:00