HLE media: block UNC share bypasses for localhost and \??\ file URLs #3121
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!3121
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3121"
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?
@Arkenoz on GitHub · 2026-11-26 08:58 UTC · original
Arkenoz:fix/media-local-unc-bypasses→main· +76 −4 · 1 files · 1 commits · openSummary
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
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.