HLE: harden storage and xpackage against path traversal and malformed inputs (fixes #1375) #2318
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!2318
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/2318/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@Xvania7 on GitHub · 2026-11-25 10:28 UTC · original
Xvania7:fix/issue-1375-hle-storage-hardening→main· +471 −11 · 4 files · 1 commits · closed without mergingSummary
Rebased
test/hle-storage-hardening(324dc7b) cleanly ontomain(940d32f) as requested in #1375.crates/victory-hle/src/modules/files.rs: resolves.and..for short title paths as well as verbatim paths so traversal cannot escape the mounted drive root.crates/victory-hle/src/modules/xpackage.rs: guardsestimate_downloadnull pointers before writing*confirm = falseand validates malformed/truncated package identifiers.crates/victory-hle/src/modules/storage.rs&runtime.rs: storage quota checks and unit tests.Tests
cargo test -p victory-hle --lib— 149 passed, 0 failedcargo clippy -p victory-hle --all-targets -- -D warnings— 0 warningscargo xtask policy— 182 files ok@Xvania7 on GitHub · 2026-11-25 10:55 UTC · original
Thanks for catching that! Locked
crate::runtime::TEST_TITLE_LOCKinthe_installation_is_complete_and_aloneand amended (a1f8e1d). Re-rancargo test -p victory-hle --lib xpackage5x under default parallel threads (4/4 each),cargo test -p victory-hle --lib(149/149),cargo clippy -p victory-hle --all-targets -- -D warnings(0 warnings), andcargo xtask policy(182 files ok).@Marvisak on GitHub · 2026-11-25 15:26 UTC · original
Automated triage for the maintainers.
Merge candidate (worth a look). On
main,files::translateresolved.and..(stopping at the root) only for long paths, inverbatim; short paths went to the host as they were, so a title path likeX:\..\filewas resolved by Win32 to the parent of the mounted folder. This PR moves that resolution intonormalize_partsand uses it whenever the tail has a..part, so short paths behave like long ones. It also stopsestimate_downloadinxpackage.rsfrom writing*confirmbefore failing on a nullbytes. I checked the new branch against the existingX:nameand verbatim-prefix handling and the vtable offsets the new tests call; the tests take a newTEST_TITLE_LOCKaround the global title. The xpackage tests mostly pin existing behaviour and could be trimmed. Linked issue #1375 is confirmed. CI: passing.Generated by Claude Code
@Marvisak on GitHub · 2026-11-25 22:08 UTC · original
Automated triage for the maintainers, second look (a review against current
main, with builds and tests where they could change the verdict).Closing in favour of #182 for the traversal fix (the bug is real). Here the
has_traversalbranch drops a trailing separator, soX:\a\..\b\becomes<root>\band a file opened with a trailing backslash succeeds where Windows fails, and it also rewrites\\?\-prefixed paths, which #182 deliberately leaves alone. The xpackage null guard changes behaviour only for a null out pointer, and most of the new tests pin existing behaviour.If this is mistaken, reply here with what was missed and it will be looked at again. Thank you for the contribution.
Pull request closed