HLE/media: block mixed-slash UNC, NT object, and backslash file: URL bypasses #484
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/fxceless--victory-fork!484
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-484"
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?
@AscilCH on GitHub · 2026-11-25 01:23 UTC · original
AscilCH:fix/hle-media-local-url-unc-bypass→main· +143 −12 · 1 files · 1 commits · openProblem
media::local()incrates/victory-hle/src/modules/media.rsis supposed to block all non-local URLs and network shares before forwarding a URL to the host's Media Foundation source resolver. Several Windows-valid SMB/UNC path forms bypassed the filter and returnedOk(...)with the unmodified URL:\/evil.example\share\a.mp4and/\evil.example/share/a.mp4(only exact\\and//were checked).\??\UNC\evil.example\share\a.mp4(fell through to the relative-path branch).file:URL UNC forms:file://\evil.example\share\a.mp4(host_ofreturned""on the leading backslash),file:\\evil.example\share\a.mp4(strip_prefix("//")returnedNone),file:////evil.example/share/a.mp4, percent-encodedfile:///%5c%5cevil.example/share/a.mp4, and drive-lessfile://localhost/share/a.mp4— all hit!drive(&path)and returnedOk(with_nul(url)).Fix
\\,//,\/,/\) other than verbatim drive paths (\\?\X:...) and reject NT object prefixes (\??\,/??/).file:URLs (both/and\), refuse backslash/extra-slash/percent-encoded UNC or NT targets after the authority, and require a drive path forfile://localhost/....UNCprefix stripping when logging refused hosts.mixed_slash_nt_and_file_unc_bypasses_are_refused.Verification
cargo test -p victory-hle --locked media::tests: 3 passed, 0 failedcargo xtask policy: 169 files okcargo clippy -p victory-hle --all-targets --locked -- -D warnings: cleancargo clippy -p victory-hle --all-targets --all-features --locked -- -D warnings: clean(AI-assisted; synthetic unit tests only, no game data.)
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.