Net: the IP helper's echo requests and address resolution reach loopback only #2860
No reviewers
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!2860
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2860"
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?
@miatson on GitHub · 2026-11-25 22:36 UTC · original
miatson:net-iphlpapi-traffic-loopback-only→main· +460 −1 · 2 files · 1 commits · openProblem
net.rskeeps the title to loopback ("a console without a network cable"), but onlyfor the ways out of Winsock and WinHTTP.
iphlpapi.dllis in the defaultHostPolicyand passes through whole, and it sends packets of its own that never go through Winsock:
IcmpSendEcho,IcmpSendEcho2,IcmpSendEcho2Ex,Icmp6SendEcho2),to any address, with any payload;
SendARP,ResolveIpNetEntry2,ResolveNeighbor).This is the kind of path #510 kept
rpcrt4.dllout of the host policy for: networktraffic
modules::netnever sees.Reproduced on
main(13f91ca): the title'siphlpapi.dll!IcmpSendEchoimport resolvesto the host's own function (
Provenance::Host), and an echo request through it to themachine's own LAN address is answered.
Change
net.rsnow also servesiphlpapi.dll, for those seven calls only. Each one checks thedestination with the existing
loopback()rule: loopback goes to the host's function asbefore; anything else fails before a packet is sent, as with no network:
IP_DEST_NET_UNREACHABLE(also the async forms: the lasterror isn't
ERROR_IO_PENDING, so nothing waits on the event or APC);SendARP,ResolveIpNetEntry2andResolveNeighborreturnERROR_BAD_NET_NAME, what anunanswered resolution reports. Null arguments are left for the host to refuse.
Everything else in
iphlpapi.dll(adapters, routes, notifications,IcmpCreateFile, ...)is still the host's. Blocked destinations are logged once, as the other refusals are.
Tests
ip_helper_traffic_is_vetted_here: the seven calls resolve to ours (Provenance::Hle)through
HleResolver;GetAdaptersAddresses,IcmpCreateFile,IcmpCloseHandlestay the host's.a_title_echo_request_reaches_loopback_only: end to end, through the functions as thetitle binds them. 127.0.0.1 answers; the machine's own LAN address doesn't.
ip_helper_arp_stays_on_the_machine,ip_helper_neighbor_resolution_stays_on_the_machine:resolving the machine's own LAN address (which the host resolves) is refused.
ip_helper_ipv6_echo_reaches_loopback_only:[::1]answers; the machine's own IPv6 addressis refused when it has one.
The tests aim at the machine's own addresses, which the host would answer, so they can't
pass for the wrong reason. On
main, the first two fail (Some(Host); the echo request isanswered). As a negative control, with the loopback check disabled, the echo, ARP and
neighbor tests fail (answered / resolved with
NO_ERROR) and pass with it. The tests thatneed a network skip without one; on the test machine there was no IPv6 route, so only the
IPv6 loopback half ran.
cargo clippy --workspace --all-targets [--all-features] --locked -- -D warningsis clean,rustfmt --checkis clean for both files, andcargo test --workspace --lockedpasses(784 passed, 0 failed).
Tested on
mainat13f91caNotes
a way out rather than changing observed behavior.
ole32, certificatefetching in
crypt32) are out of scope here.Written with the help of Claude Code.
@Marvisak on GitHub · 2026-11-26 04:24 UTC · original
Automated triage for the maintainers.
Needs work. Needs the maintainer's decision, since it touches the offline
netmodule (it tightens it) and its tests send ICMP echo to the machine's own address. RoutingIcmpSendEcho*,Icmp6SendEcho2,SendARP,ResolveIpNetEntry2andResolveNeighborthrough the existingloopback()check closes a real way off the machine. One problem: adding"iphlpapi.dll"to thenetmodule'sdllsserves every export of that module foriphlpapi.dll, including the ws2_32 ordinals#2,#4and#20, so aniphlpapi.dllimport by ordinal would bind tobind,connectorsendto. Please register the IP helper exports in their ownHleModulethat serves onlyiphlpapi.dll.CI: not run yet on this head.
Generated by Claude Code
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.