Repository navigation
Conversation
Dukestar69
left a comment
There was a problem hiding this comment.
Verified against origin/main (63bcca4):
cargo test -p victory-hle --lib modules::media:: -- --test-threads=1: 7/7 passed (includinglocalhost_and_object_prefix_file_urls_are_refusedandthe_host_reads_localhost_and_object_prefix_share_urls_as_shares).cargo clippy -p victory-hle --all-targets -- -D warnings: clean.cargo xtask policy: 191 files ok.
Cleanly closes the localhost and \??\ UNC share bypasses in media.rs.
Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
|
Automated triage for the maintainers. Merge candidate. This makes the URL rule in CI: Generated by Claude Code |
fuzeofficlal
left a comment
There was a problem hiding this comment.
Verified afd63d5e locally on Windows 11 x64:
cargo clippy --all-targets --locked -- -D warnings: clean (3.14s).cargo test -p xtask --locked policy::tests::repository_passes_policy: 1 passed, 0 failed (0.34s).cargo test -p victory-hle --locked: 156 passed, 0 failed (154lib including all 7modules::media::tests+1fidelityfx +1no_dll_planting,5.00s).rustfmt --edition 2024 --check crates/victory-hle/src/modules/media.rs: clean.
The added effective and \??\ checks close the submitted file://localhost///..., file://localhost/\\..., file://localhost/%5C%5C..., and file:///%3F%3F/UNC/... cases. However, for non-drive file: URLs (media.rs:92-116), local() validates decoded Rust views (whole/path) and then returns Ok(with_nul(url)), handing the original raw UTF-16 URL to Media Foundation to re-parse (for example with mixed encoded separators or namespace combinations). Please validate the host-converted path (or hand Media Foundation the exact normalized local path that passed the check) consistently across both resolver entry points, and expand the Windows conversion coverage for mixed separators and percent-encoded slashes.
Thanks for the thorough review and local verification! That's a good point about validating/passing the host-normalized path rather than the raw UTF-16 URL. Since this PR is intentionally kept minimal and already marked as a merge candidate, I'd prefer to keep it focused on closing the |
Summary
Closes two remaining UNC share bypasses in
media::local(crates/victory-hle/src/modules/media.rs) following up on #207:file://localhost/...with extra leading separators:this_machine == truepreviously skippedshare(&whole)completely. Becauseshlwapi.dll!PathCreateFromUrlWconsumes only a single leading separator afterlocalhost, URLs such asfile://localhost///server/share/a.mp4,file://localhost/\\server/share/a.mp4, andfile://localhost/%5C%5Cserver/share/a.mp4resolve to remote UNC paths (\\server\share\a.mp4/\\\server\share\a.mp4) and were allowed through.media::localnow strips one leading separator whenthis_machineis set and still runsshare(...)on the remainder, keepingfile://localhost//server/share/a.mp4(\server\share\a.mp4) local.\??\object-manager prefixes infile:URLs: URLs likefile:///%3F%3F/UNC/server/share/a.mp4decode to\??\UNC\server\share\a.mp4inPathCreateFromUrlWwithout starting with two separators.media::localnow rejects decoded\??\paths unless followed by a drive letter, strippingUNC\case-insensitively when extracting the host.Testing
localhost_and_object_prefix_file_urls_are_refused(verified failing before the fix and passing after) and Windows oracle testthe_host_reads_localhost_and_object_prefix_share_urls_as_sharesagainstshlwapi.dll!PathCreateFromUrlW.rustfmt --edition 2024 --check crates/victory-hle/src/modules/media.rs— passedcargo clippy --workspace --all-targets -- -D warnings— passedcargo check --workspace --all-targets— passedcargo xtask policy— passed (asset policy: 191 files ok)cargo test -p victory-hle --locked— passed (154lib +fidelityfx+no_dll_planting)Coordination & AI disclosure