Repository navigation
hle: confine virtual-drive paths and harden storage/package inputs - #1447
Closed
kunalkhude99 wants to merge 1 commit into
Closed
kunalkhude99 wants to merge 1 commit into
kunalkhude99 wants to merge 1 commit into
Conversation
Summary: - Normalize short virtual-drive paths containing `..` so traversal stops at the mounted drive root, while preserving intra-folder relative paths and mixed slash handling. - Reject a null `bytes` out-pointer in `XPackageEstimateDownload` before any side effects. - Add synthetic coverage for path traversal, quota saturation/overflow, unmounted drives, malformed package identifiers/sizes, and concurrent title-state tests. Root cause: Short title paths were concatenated directly onto the host folder behind a virtual drive. A path such as `X:..\secret.dat` therefore resolved above the sandbox. `estimate_download` also wrote `*confirm = false` before validating the `bytes` pointer, and tests sharing the global `Title` state could clobber each other under a multi-threaded runner. Fix: - Reuse `normalize_parts` in `files::translate` for any short path containing `..`; each `..` pops a component and stops at the drive root. Long paths already used the normalized `\\?\` form. - Add the null guard in `estimate_download` before writing outputs. - Serialize tests that mutate `runtime::Title` with `TEST_TITLE_LOCK`. Testing: - cargo test -p victory-hle - cargo clippy -p victory-hle --all-targets -- -D warnings - cargo xtask policy Fixes Marvisak#1375
Owner
|
Automated triage for the maintainers. Closing because another open pull request covers the same change. See #182. Its real fix ( If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution. |
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:
..so traversal stops at the mounted drive root, while preserving intra-folder relative paths and mixed slash handling.bytesout-pointer inXPackageEstimateDownloadbefore any side effects.Root cause:
Short title paths were concatenated directly onto the host folder behind a virtual drive. A path such as
X:..\secret.dattherefore resolved above the sandbox.estimate_downloadalso wrote*confirm = falsebefore validating thebytespointer, and tests sharing the globalTitlestate could clobber each other under a multi-threaded runner.Fix:
normalize_partsinfiles::translatefor any short path containing..; each..pops a component and stops at the drive root. Long paths already used the normalized\\?\form.estimate_downloadbefore writing outputs.runtime::TitlewithTEST_TITLE_LOCK.Testing:
Fixes #1375