fix(fs): normalize VFS paths in HostMounts to prevent host traversal - #2281
Merged
Merged
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
bashkit | 442cd8a | Commit Preview URL | Aug 07 2026, 09:37 AM |
chaliy
force-pushed
the
2026-08-07-fix-host-mount-resolver-vulnerability
branch
from
August 7, 2026 09:24
e2b2463 to
29e2209
Compare
chaliy
force-pushed
the
2026-08-07-fix-host-mount-resolver-vulnerability
branch
from
August 7, 2026 09:36
29e2209 to
442cd8a
Compare
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.
Motivation
./..in the suffix returned bystrip_prefix, allowing a VFS path like/workspace/../secretsto map to a host path that the OS resolves outside the intended mount.Description
HostMounts::newby applyingnormalize_pathto eachHostMount.vfs_path.HostMounts::resolveby callingnormalize_pathon thevfs_pathbefore prefix matching and joining.parent_components_are_normalized_before_mount_selectionandmount_points_are_normalized_when_the_table_is_builtincrates/bashkit/tests/integration/host_mounts_tests.rs.TM-ESC-034inknowledge/foundations/vfs.mdandknowledge/security/threat-model.mdexplaining that mounts and lookups are normalized before matching.Testing
cargo test --features realfs -p bashkit --test integration host_mounts_testspassed (13 tests).cargo fmt --checkpassed.cargo clippy --features realfs -p bashkit --test integration -- -D warningspassed.just check-okfran and reported OKF v0.2 conformance (no failures reported).Codex Task