Skip to content

test: refuse LeRobot playlist segments that point outside the cache - #802

Closed
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/lerobot-playlist-segment-tests-c877
Closed

cursor[bot] wants to merge 1 commit into
mainfrom
cursor/lerobot-playlist-segment-tests-c877

Conversation

@cursor

@cursor cursor Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Summary

Adds tests that import a LeRobot dataset whose camera file is an HLS playlist naming a video outside the download cache. The tests fail on purpose until the importer refuses that playlist before ffmpeg or ffprobe opens the segment. No production code is changed here.

Why

import_lerobot_dataset downloads the object named by video_path and passes that local path to ffmpeg and ffprobe with no protocol allowlist. A publisher-controlled playlist can name another local file. The whole-file path publishes that file as the episode. The windowed path (seek before -i, then rebased packet times) opens it as well. hflow import lerobot uses the same function and does not open media itself.

These tests are the spec for a later fix. They stay red until the import refuses the playlist without opening the outside file and without publishing landing/ or prepared-manifest.json.

Validation

The tests fail while the vulnerability is present:

uv run pytest tests/test_lerobot_playlist_segments.py -q

All four cases fail today because the outside file is opened:

  • test_lerobot_import_does_not_open_playlist_segments_outside_the_cache[False-file-url]
  • test_lerobot_import_does_not_open_playlist_segments_outside_the_cache[False-relative]
  • test_lerobot_import_does_not_open_playlist_segments_outside_the_cache[True-file-url]
  • test_lerobot_import_does_not_open_playlist_segments_outside_the_cache[True-relative]

uv run ruff check tests/test_lerobot_playlist_segments.py passes.

Checklist

  • I added or updated outcome-focused tests for changed business logic.
  • I updated documentation for changed behavior, flags, formats, or requirements.
  • I ran uv run ruff check --fix, uv run ruff format, and uv run ty check.
  • I ran the relevant pytest suite.
  • I did not add recordings, generated media, credentials, private URLs, or runtime artifacts.
  • I preserved stored-data compatibility or documented an explicit version change.
Open in Web Open in Cursor 

Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

The new tests fail while a dataset playlist can open a video outside
the download cache and have it published as the episode.
@kstonekuan

Copy link
Copy Markdown
Contributor

Tracking the fix and regression coverage in #805.

@kstonekuan kstonekuan closed this Nov 20, 2026
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