fix(core,experiments): path traversal in ImageCommand and rand RUSTSEC-2026-0097#2939
Merged
fix(core,experiments): path traversal in ImageCommand and rand RUSTSEC-2026-0097#2939
Conversation
…C-2026-0097 Closes #2937: handle_image_as_string now rejects absolute paths alongside ../traversal sequences, matching the fix applied to the CLI channel in #2933. Closes #2929: zeph-experiments upgrades from rand 0.8.5 (RUSTSEC-2026-0097, unsound) to rand 0.10.1 via workspace = true. Updated gen_range -> random_range (RngExt trait). Removed small_rng feature flag (no longer exists in rand 0.10). Migrated serde, serde_json, thiserror, and tracing to workspace references.
This was referenced Apr 13, 2026
Update handle_image_command_missing_file_sends_error to use a relative path (absolute paths are now rejected before the fs read). Add two new regression tests: absolute path rejection and parent-dir traversal rejection in ImageCommand handler.
… path TempDir::new_in(cwd) + strip_prefix(cwd) produces a relative path that passes the absolute-path traversal guard added in the previous commit.
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
handle_image_as_stringinzeph-corenow rejects absolute paths (e.g./etc/passwd) alongside../traversal sequences. Mirrors the fix applied to the CLI channel in CLI channel /image handler bypasses ImageCommand path traversal protection #2933/fix(bootstrap,channels,core): unused import and CLI image path traversal #2938.zeph-experimentsupgraded fromrand 0.8.5(RUSTSEC-2026-0097, unsound) torand 0.10.1viaworkspace = true. Updatedgen_range→random_range(RngExttrait). Removedsmall_rngfeature (dropped in rand 0.10). Migratedserde,serde_json,thiserror,tracingto workspace references.Test plan
cargo build -p zeph-core -p zeph-experimentspassescargo nextest run -p zeph-experiments --lib— 123 tests passcargo +nightly fmt --checkpasses/image /etc/passwdreturnsInvalid image path: path traversal not allowedcargo deny check advisoriesno longer reports RUSTSEC-2026-0097