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

Open
github-bot wants to merge 1 commit from github-bot/gh-529 into main AGit
Owner

@⁠pug205gti6 on GitHub · 2026-11-25 02:00 UTC · original
pug205gti6:pr/484-hle-media → main · +143 −12 · 1 files · 1 commits · open

…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.
**@⁠pug205gti6** on GitHub · 2026-11-25 02:00 UTC · [original](https://github.com/fxceless/victory-fork/pull/529) `pug205gti6:pr/484-hle-media` → `main` · +143 −12 · 1 files · 1 commits · open …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.
- 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.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:45:31 +00:00
Author
Owner

@⁠Revens2 on GitHub · 2026-11-25 07:37 UTC · original

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.

**@⁠Revens2** on GitHub · 2026-11-25 07:37 UTC · [original](https://github.com/fxceless/victory-fork/pull/529#issuecomment-7156061256) 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.
Author
Owner

@⁠Headache3318 on GitHub · 2026-11-25 09:22 UTC · original

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.

**@⁠Headache3318** on GitHub · 2026-11-25 09:22 UTC · [original](https://github.com/fxceless/victory-fork/pull/529#issuecomment-7158238105) 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 can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/529/head:github-bot/gh-529'
git switch 'github-bot/gh-529'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-529'
git switch 'github-bot/gh-529'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-529'
git switch 'github-bot/gh-529'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-529'
git switch 'main'
git merge --squash 'github-bot/gh-529'
git switch 'main'
git merge --ff-only 'github-bot/gh-529'
git switch 'main'
git merge 'github-bot/gh-529'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.