Skip to content

fix(engine): playlist walk treats entries ffmpeg opens verbatim as leaving the folder - #8827

Merged
vanceingalls merged 2 commits into
mainfrom
11-24-playlist_walk_verbatim_entries
Nov 25, 2026
Merged

vanceingalls merged 2 commits into
mainfrom
11-24-playlist_walk_verbatim_entries

Conversation

@vanceingalls

Copy link
Copy Markdown
Collaborator

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

  • Unit tests added/updated
    • notMediaPayload.test.ts covers 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.
    • Each entry is refused in a top-level list and in a list three folders down. A media file sits at the name the entry would have if it were joined to the list's folder.
    • Fails without the fix: all 4 cases return false. I checked the top-level and nested assertions separately.
  • Ran the whole notMediaPayload.test.ts file locally on darwin. The only failure is refuses a list behind an ID3 tag, which also fails on main here: it asserts a log line that ffprobe 8.1.1 prints differently.
  • tsc for the engine and bun run lint both pass.
  • Manual testing performed
  • Documentation updated (if applicable): no user-visible change for valid projects.
  • Comments follow CONTRIBUTING.md "Comments"

🤖 Generated with Claude Code

vanceingalls and others added 2 commits November 24, 2026 23:55
…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>
@github-actions

Copy link
Copy Markdown
Contributor

Edit accuracy: accurate 273 (base branch 271), smooth 54 of those

The gate passes.
Smoothness is reported in the artifact, not gated. A case fails only if it fails 2 of 3 runs.

Newly passing (2)

  • seqscaletwice-scale-px-r0-nested-z100
  • seqscaletwice-scale-px-r0-root-z100

Not banked yet, reported and not gated (bank a full-grid run's baseline.json) (2)

  • seqscaletwice-scale-px-r0-nested-z100
  • seqscaletwice-scale-px-r0-root-z100

Quarantined, measured but not gated (0)

@jrusso1020 jrusso1020 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.ts at head: 178/178 pass.
  • Fails without the fix: with notMediaPayload.ts put back to main, 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=1 is refused at head and on main alike, 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

@vanceingalls
vanceingalls merged commit 3953e2d into main Nov 25, 2026
150 of 151 checks passed
@vanceingalls
vanceingalls deleted the 11-24-playlist_walk_verbatim_entries branch November 25, 2026 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants