OpenClaw: HGRCPATH, CARGO_BUILD_RUSTC_WRAPPER, RUSTC_WRAPPER, and MAKEFLAGS missing from exec env denylist — RCE via build tool env injection (GHSA-cm8v-2vh9-cxf3 class)
Trusted env-proxy handling in guarded fetch performed target DNS resolution/pinning before checking whether an operator-configured proxy should own name resolution, putting the sink in fetchWithSsrFGuard's dispatcher-selection path.
src/infra/net/fetch-guard.ts
The fix moves resolvePinnedHostnameWithPolicy() so it only runs on non-env-proxy paths; this file contains the vulnerable branch ordering and dispatcher selection sink.
src/infra/net/fetch-guard.ssrf.test.ts
The added regression test documents the intended boundary: trusted proxy mode should use DNS pinning only when no proxy env var is configured.