Skip to content

security: Egress proxy allowlists CloudFront-fronted hosts but tunnels CONNECT without checking the TLS SNI #1595

Closed

Description

@scttfrdmn

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:security

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions