HLE: reject null handle in WinHttpSetOption proxy path and expand net.rs tests (1 -> 17) #1141
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#1141
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@geiyiliyabumo on GitHub · 2026-11-24 16:08 UTC · original
Summary
Fixes a null-handle check in
WinHttpSetOption(WINHTTP_OPTION_PROXY) incrates/victory-hle/src/modules/net.rsand expands deterministic synthetic unit tests from 1 to 17 passing tests.Because we have been tracking our branches per issue, this CI-green branch is ready on my fork (and now that
pull_request_creation_policyisall, ready for PR):geiyiliyabumo/VIctory@test/hle-net-auditgeiyiliyabumo/VIctory@d30bed4(based onmainffe310e)Changes (
crates/victory-hle/src/modules/net.rs)WinHttpSetOptionpreviously returned1(success) forWINHTTP_OPTION_PROXYeven whenhandle.is_null(); it now forwards null handles to the host to refuse.ConnectEx/WSASendMsgHLE routing, proxy auto-detection failure,WinHttplocal-only enforcement,bind(0.0.0.0)narrowing to loopback, connect vetting by address/name, and non-local datagram dropping.Verification (Windows 11 x64 MSVC)
rustfmt --edition 2024 --check crates/victory-hle/src/modules/net.rs: PASScargo xtask policy: PASS (154 files ok)cargo clippy -p victory-hle --all-targets --locked -- -D warnings(default +--features diagnostics): PASS (0 warnings)cargo test -p victory-hle --locked -- net::: 17 passed, 0 failedAI-assisted; synthetic tests only, no game files.
@pickles976 on GitHub · 2026-11-24 16:09 UTC · original
Justification from the sibling runtime for why the null-rejection belongs at the entry, not in the proxy branch body only: in ivall/xcl's offline mode (
XCL_NETWORK=0)WinHttpConnectreturns a null handle by design (the deliberate-offline shim,netoff.rs— connect stubs to null so the title's network paths fail cleanly), which means in that mode every subsequentWinHttp*call arrives with a null handle — the null path is not an attacker corner there, it is the happy path. A runtime whose offline/network-disabled mode is a supported configuration has to treat "option call on null handle" as a designed-for input returning the documented failure, never as an unreachable state. Our equivalent surface (only Connect/SendRequest bound; everything else to arg-blind stubs) is safe by construction today, but if we ever expand the shim table your fix is the pattern to copy — handle check first, branch second.@Marvisak on GitHub · 2026-11-25 10:07 UTC · original
Automated triage for the maintainers.
Confirmed on
main:WinHttpSetOptionincrates/victory-hle/src/modules/net.rsreturns success forWINHTTP_OPTION_PROXYbefore looking at the handle, so a null handle is accepted there, while every other option goes to the host, which refuses it. It is minor, since the proxy is ignored either way, but the success return is wrong. Open pull request #1213 by the same author carries the fix and the added tests, so review can continue there.Generated by Claude Code