You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
security: Egress proxy allowlists CloudFront-fronted hosts but tunnels CONNECT without checking the TLS SNI #1595
From the pre-1.0 security audit (spore-host/spore-host#649, 2026-11-11), audit id instance-9. Verified: plausible, severity low (reviewer said low).
Where:pkg/egressproxy/proxy.go:275 (at origin/main on 2026-11-11)
Evidence
target() checks only the CONNECT authority against Allowlist (awscli.amazonaws.com, efa-installer.amazonaws.com, allowlist.go:49-52). tunnel() then copies bytes blindly ('TLS is never terminated or inspected'). The vetted address is the CDN edge, which serves any distribution chosen by the ClientHello SNI.
Scenario
Code on a --no-public-ip instance in the clients SG sends CONNECT awscli.amazonaws.com:443 and then a ClientHello with SNI=.cloudfront.net. SNI and Host match, so domain-fronting protections do not apply. CloudFront serves the attacker's distribution through the proxy, which gives exfiltration and C2 from a subnet the user chose to keep off the internet, despite the package doc's 'Nothing else is reachable'.
Verifier
spawn pkg/egressproxy/proxy.go target() checks only the CONNECT authority against Allowlist (allowlist.go:48-52 includes awscli.amazonaws.com and efa-installer.amazonaws.com), then tunnels opaque bytes. No SNI is inspected (grep finds no ServerName or ClientHello parsing). Exploitability depends on those hosts resolving to shared CloudFront edges that will serve another distribution by SNI, which needs a live check. The attacker must already be running code on the instance. Such an instance also has VPC endpoints (an S3 endpoint can exfiltrate to an attacker bucket unless endpoint policies restrict it), so the incremental exposure is small.
Suggested fix
Peek the first TLS record in tunnel() and require the SNI to equal the CONNECT host, refusing a missing or mismatched SNI and ECH outer names. Alternatively, fetch the two artifacts as pinned-checksum objects from an S3 VPC endpoint instead of proxying CDN hosts.
Deployed-state check
From a host in the clients SG, run CONNECT awscli.amazonaws.com:443 and then openssl s_client -servername <other>.cloudfront.net through the tunnel, and confirm the other distribution's content is served.
Activity
Egress proxy: the ClientHello must name the CONNECT host (#1595)
Egress proxy: the ClientHello must name the CONNECT host (#1595) (#1618)