HLE: allow rpcrt4.dll in default host policy #510
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/510"
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 pushkarreddyy on 2026-11-24T04:20:26Z.
Problem
During startup and runtime, titles importing RPC and UUID functionality (such as
UuidCreate) cause the loader to log:as reported in #417. On Windows PC and console, standard RPC runtime functions live in
rpcrt4.dll.Fix
Add
"rpcrt4.dll"toHostPolicy::default().allow, allowing standard host RPC/UUID functions to resolve. Added unit testhost_policy_allows_rpcrt4.No game files used.
Imported from Marvisak/VIctory. Originally posted by pushkarreddyy on 2026-11-24T04:50:52Z.
### Technical Verification & Implementation Details
Context & Root Cause
In
crates/victory-hle/src/host.rs,DEFAULT_HOST_DLLSlists system DLLs safe for host passthrough when running in the default host policy. Previously, onlyws2_32.dllandbcrypt.dllwere included. Windows RPC runtime (rpcrt4.dll) is standard on Windows and required by system services and game titles for COM/RPC operations, UUID generation (UuidCreate), and object marshalling. Without it, symbol resolution fails when games call RPC functions.Changes & Diff
"rpcrt4.dll"toDEFAULT_HOST_DLLS.default_policy_allows_rpcrt4testing case-insensitive matching ("RPCRT4.DLL").Git Log Line & Verification
ext 756a1f0 HLE: allow rpcrt4.dll in default host policy crates/victory-hle/src/host.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+)cargo xtask policy(Rule #1 compliance, zero game assets).rustfmt --edition 2024.Imported from Marvisak/VIctory. Originally posted by pushkarreddyy on 2026-11-24T06:24:02Z.
### Call for Testing & Maintainer Review
Community members testing game initialization or HLE modules on Windows 10/11: verification and feedback on this PR is warmly welcome!
cargo xtask policypassing).@Marvisak: Ready for maintainer review and merge when convenient!
Imported from Marvisak/VIctory. Originally posted by mercuryVM on 2026-11-24T07:16:15Z.
Review: CHANGES_REQUESTED
Tested
756a1f0on Windows 11, RTX 5070, MSVC:cargo test --workspace --no-fail-fastpasses (265 passed, 0 failed).The change does what it says, but allowing
rpcrt4.dllwholesale widens the network surface. I'd rather not take it as is.ws2_32.dllandwinhttp.dllare allowed only becausemodules::netoverrides the title's imports from them and refuses off-machine traffic (the comment on thews2_32line says so). That override only catches the title's own import table.rpcrt4.dllbrings the RPC client runtime:RpcStringBindingCompose/RpcBindingFromStringBindingwithncacn_ip_tcporncacn_http, then calls. rpcrt4 opens those sockets through its ownws2_32imports, whichmodules::netnever sees. With this change, a title RPC call to a remote endpoint would bypass the loopback-only rule.ole32is already allowed and can in principle reach DCOM the same way, so the hole isn't brand new. Still, adding the RPC runtime directly makes it the easy path.Suggested alternative for #417: implement the few functions titles actually import from rpcrt4 as HLE (
UuidCreate→BCryptGenRandomwith the version 4 bits set,UuidToStringA/W,RpcStringFreeA/W). Refuse the rest, as today. If the full DLL really is needed, add a comment on this line noting the bypass and thatmodules::netdoes not cover it.AI-assisted (Claude Code).
Imported from Marvisak/VIctory. Originally posted by pushkarreddyy on 2026-11-24T07:32:18Z.
Thank you @mercuryVM for the thorough security and network architecture review!
You make a crucial architectural point: allowing
rpcrt4.dllwholesale bypassesmodules::net's loopback-only intercept onws2_32.dll, opening remote socket paths viancacn_ip_tcpandncacn_http.I completely agree that the proper, sandboxed approach is implementing the specific imported UUID functions in HLE (
UuidCreateviaBCryptGenRandomwith RFC 4122 v4 bits,UuidToStringA/W, andRpcStringFreeA/W) rather than opening up the entire host RPC runtime.Closing this PR in favor of targeted HLE implementations. Thanks again!
Pull request closed