Repository navigation
fix(id): make sanitize_file_name enforce job-directory containment - #1597
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 9 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Fixes #1595.
sanitize_file_name(pkgs/id/src/world_compile.rs) checkedname.split('.').all(|part| part != "." && part != "..")— a condition that can never be false, since split parts are maximal non-dot runs and can never equal.or... Every traversal name (..,../evil.roc,/etc/passwd) passed the guard at the staging write site; containment rested solely on validate_spec's charset allowlist.Fix: the name must be exactly one
Component::NormalperPath::components()— refusing parent references, separators, roots, and empty names — plus a direct unit test (sanitize_file_name_refuses_traversal) covering traversal names and flat-name controls.Verification (laptop, real crate):
cargo test --lib world_compile: 22 passed / 0 failed (21 existing + 1 new)cargo fmt -- --check src/world_compile.rs: cleanNeed help on this PR? Tag
@codesmith-botwith what you need.