Repository navigation
test: refuse LeRobot playlist segments that point outside the cache - #802
Closed
cursor[bot] wants to merge 1 commit into
Closed
cursor[bot] wants to merge 1 commit into
cursor[bot] wants to merge 1 commit into
Conversation
The new tests fail while a dataset playlist can open a video outside the download cache and have it published as the episode.
6 tasks done
Contributor
|
Tracking the fix and regression coverage in #805. |
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.
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_datasetdownloads the object named byvideo_pathand 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 lerobotuses 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/orprepared-manifest.json.Validation
The tests fail while the vulnerability is present:
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.pypasses.Checklist
uv run ruff check --fix,uv run ruff format, anduv run ty check.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.