The vulnerability is an arbitrary local file read due to a lack of URI scheme validation in Streamlink's HLS and DASH parsers. A malicious remote playlist (.m3u8) or manifest (.mpd) could include segment URIs with the 'file://' scheme. The Streamlink client, when processing this manifest, would then attempt to read the specified local file and write its contents to the output stream.
The analysis of the commits between the vulnerable version (8.3.0) and the patched version (8.4.0) reveals the exact fix. The developers introduced a new utility function, is_insecure_scheme, to explicitly forbid transitions from remote schemes (like 'http' or 'https') to local ones ('file').
This check was then implemented in the core parsing logic for both HLS and DASH streams:
- For HLS, the
M3U8Parser.uri function, which resolves all URIs within a playlist, was modified to use is_insecure_scheme and raise an error if an invalid scheme is detected.
- For DASH, the fix was applied in multiple places. The
MPDNode.base_url property was updated to validate schemes when resolving BaseURL tags. Furthermore, the methods responsible for generating the final segment URLs (SegmentBase.segments and SegmentTemplate.segments) were updated to use a new, secure make_url function that performs the scheme validation.
Therefore, the identified vulnerable functions are the ones that, prior to the patch, processed or constructed these URIs without validation. During exploitation, these functions would appear in a runtime profile as they handle the malicious 'file://' URIs from the attacker-controlled manifest.