HLE/media: block mixed-slash UNC, NT object, and backslash file: URL … #529

Open
pug205gti6 wants to merge 1 commit from upstream-pr/529 into main
pug205gti6 commented 2026-11-25 02:00:15 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by pug205gti6 on 2026-11-25T02:00:15Z.


…bypasses

  • Reject all two-separator UNC/device prefixes (\/, /\, \\.\, //?/) and NT object namespace prefixes (\??\, /??/) in media::local(), allowing only verbatim drive paths (\\?\X:...).
  • Handle case-insensitive UNC\/UNC/ prefix stripping when reporting the refused host.
  • Normalize two-separator authorities in file: URLs and refuse backslash, extra-slash, percent-encoded UNC/NT, and drive-less localhost SMB forms (file://\host\share, file:\\host\share, file:////host/share, file:///%5c%5chost/share, file://localhost/share) instead of falling through with the unmodified URL.
  • Add synthetic unit tests covering all bypass forms and valid local controls.
<!-- greyfinch-sync:fxceless/victory-fork:issue:6595408014 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/529). Originally posted by [pug205gti6](https://github.com/pug205gti6) on 2026-11-25T02:00:15Z. --- …bypasses - Reject all two-separator UNC/device prefixes (`\/`, `/\`, `\\.\`, `//?/`) and NT object namespace prefixes (`\??\`, `/??/`) in `media::local()`, allowing only verbatim drive paths (`\\?\X:...`). - Handle case-insensitive `UNC\`/`UNC/` prefix stripping when reporting the refused host. - Normalize two-separator authorities in `file:` URLs and refuse backslash, extra-slash, percent-encoded UNC/NT, and drive-less `localhost` SMB forms (`file://\host\share`, `file:\\host\share`, `file:////host/share`, `file:///%5c%5chost/share`, `file://localhost/share`) instead of falling through with the unmodified URL. - Add synthetic unit tests covering all bypass forms and valid local controls.
Revens2 commented 2026-11-25 08:09:01 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by Revens2 on 2026-11-25T07:37:02Z.


Duplicate of #484: @AscilCH opened this patch 37 minutes earlier, and gh pr diff returns the same bytes for both (+143/-12 on 1 file(s), same title).

Please continue in #484 so the review history and any test data stay in one place.
Thanks.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7156061256 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/529#issuecomment-7156061256). Originally posted by [Revens2](https://github.com/Revens2) on 2026-11-25T07:37:02Z. --- Duplicate of #484: @AscilCH opened this patch 37 minutes earlier, and `gh pr diff` returns the same bytes for both (+143/-12 on 1 file(s), same title). Please continue in #484 so the review history and any test data stay in one place. Thanks.
Headache3318 commented 2026-11-25 10:11:10 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by Headache3318 on 2026-11-25T09:22:15Z.


Independent verification: PR #529 (actually HLE/media URL bypass fix) cherry-picks cleanly onto main (8dd30ab), no conflicts. Build: success. Tests: compile successfully but cannot execute on this Linux machine (Windows test binary needs Wine/Proton, both timed out). Native Linux tests fail due to pre-existing victory-gpu/victory-loader build issues (E0425 host_resource) — not caused by this PR. Modifies only crates/victory-hle/src/modules/media.rs with 3 new unit tests. Machine: Arch Linux, kernel 7.3.5-arch1-1, 3x RTX 4090 driver 620.73.04, Proton, AI-assisted.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7158238105 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/529#issuecomment-7158238105). Originally posted by [Headache3318](https://github.com/Headache3318) on 2026-11-25T09:22:15Z. --- Independent verification: PR #529 (actually HLE/media URL bypass fix) cherry-picks cleanly onto main (8dd30ab), no conflicts. Build: success. Tests: compile successfully but cannot execute on this Linux machine (Windows test binary needs Wine/Proton, both timed out). Native Linux tests fail due to pre-existing victory-gpu/victory-loader build issues (E0425 host_resource) — not caused by this PR. Modifies only crates/victory-hle/src/modules/media.rs with 3 new unit tests. Machine: Arch Linux, kernel 7.3.5-arch1-1, 3x RTX 4090 driver 620.73.04, Proton, AI-assisted.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/529:upstream-pr/529'
git switch 'upstream-pr/529'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/529'
git switch 'upstream-pr/529'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/529'
git switch 'upstream-pr/529'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/529'
git switch 'main'
git merge --squash 'upstream-pr/529'
git switch 'main'
git merge --ff-only 'upstream-pr/529'
git switch 'main'
git merge 'upstream-pr/529'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
fxceless/victory-fork!529
No description provided.