Repository navigation
fix(engine): playlist walk treats entries ffmpeg opens verbatim as leaving the folder - #8827
Merged
Merged
Conversation
…aving the folder The walk's scheme test stopped at a backslash, but ffmpeg reads a scheme up to the first `:` before any `/`, `?` or `#`, and FFmpeg 4.3 and earlier copy any name holding `://` as written. Either way ffmpeg opens the name as written instead of joining it to the list's folder. Such entries are now refused at every depth; http(s) entries are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Edit accuracy: accurate 273 (base branch 271), smooth 54 of thoseThe gate passes. Newly passing (2)
Not banked yet, reported and not gated (bank a full-grid run's baseline.json) (2)
Quarantined, measured but not gated (0) |
jrusso1020
approved these changes
Nov 25, 2026
jrusso1020
left a comment
Collaborator
There was a problem hiding this comment.
Reviewed at 4ee9f806 (the last commit only drops a comment; the code is unchanged from 39ac42b1).
Verdict: APPROVE.
OPENED_AS_WRITTEN(/^[^/?#]*:|:\/\//) replaces the old first-segment test. Like the old test it runs on the raw entry and the percent-decoded entry, after the http(s) early return. A backslash no longer ends the scheme scan, and any://counts. Every entry that matched the old test still matches, so this change only adds refusals.- Ran the whole
notMediaPayload.test.tsat head: 178/178 pass. - Fails without the fix: with
notMediaPayload.tsput back tomain, all 4 new cases fail. - Regression check: plain list-relative entries with their files present (
seg.ts,sub/seg.ts,sub\seg.ts,a b/seg%20x.ts) are still accepted at head.seg-1.ts?x=1is refused at head and onmainalike, so that behavior is unchanged.
Need ✅ · Size ✅ (+39/-3) · Reuse ✅ (same walker, same raw and decoded pass) · Simpler ✅ · Structure ✅
Risk: low. The test can only refuse more entries, and the only new refusals are an entry with a backslash before its first colon and an entry holding a non-http ://. Neither shape appears in a normal project.
— Rames
3 of 5 tasks
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.
What
Playlist walk: an entry ffmpeg opens as written, rather than joined to the list's folder, now counts as leaving the folder.
Why
ffmpeg resolves a playlist entry with URL rules. It reads a scheme up to the first
:before any/,?or#, and a backslash does not end it. FFmpeg 4.3 and earlier also copy any entry holding://as written. ffmpeg opens such an entry from its working directory instead of the list's folder. The walk's test stopped at a backslash, so it judged some of these entries as paths relative to the list.Related work
This follows #8014, #8782 and #8798, which fixed other cases in the same walker. A separate PR runs ffmpeg from an empty working directory.
How
notMediaPayload.ts: the scheme test no longer stops at\, and an entry containing://is refused. Both checks run on the raw entry and the percent-decoded entry, before any path resolution and at every depth. http(s) entries are unchanged.Test plan
notMediaPayload.test.tscovers four entries: a backslash before the colon with POSIX separators, the same with Windows separators, the same with the backslash and colon percent-encoded, and://after the first segment.false. I checked the top-level and nested assertions separately.notMediaPayload.test.tsfile locally on darwin. The only failure isrefuses a list behind an ID3 tag, which also fails onmainhere: it asserts a log line that ffprobe 8.1.1 prints differently.tscfor the engine andbun run lintboth pass.🤖 Generated with Claude Code