HLE: reject null handle in WinHttpSetOption proxy path and expand net.rs tests (1 -> 17) #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?
Imported from Marvisak/VIctory. Originally posted by geiyiliyabumo on 2026-11-24T16:08:41Z.
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.
Imported from Marvisak/VIctory. Originally posted by pickles976 on 2026-11-24T16:09:42Z.
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.Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T10:07:40Z.
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