Skip to main content
Menu
Advisories

Egress allowlist bypass: Host/SNI check fails open on malformed HTTP/1 request lines

GHSA-GJ24-29J2-3X78Published Updated GitHub

Description

On intercepted TLS connections, microsandbox checks that the HTTP request authority matches the TLS SNI. This stops a sandbox from connecting to an allowed hostname and then addressing the request to a different backend behind it (domain fronting).

For HTTP/1, this check was skipped when the request line could not be parsed. A sandbox could send a malformed request line, for example one preceded by an empty line, that microsandbox passed through unchecked but a tolerant upstream server still accepted.

HTTP/2 was not affected.

Impact

An attacker who can execute code inside a sandbox may be able to reach an unlisted backend through an allowed hostname, when that hostname is served by shared infrastructure that routes requests by HTTP Host, such as a CDN, reverse proxy, or multi-tenant platform. This bypasses hostname-based egress allow rules for intercepted HTTPS traffic.

Where a secret is configured for the allowed host, the secret could also be substituted into a request carrying a different Host. The sandbox does not learn the secret value and the connection still terminates at the allowed host's server, so disclosure depends on the same shared-infrastructure condition.

Destinations that do not route by Host are not exploitable this way. DNS pinning and the filtering of private, loopback, link-local, and metadata addresses are not affected. This is not a host escape.

Affected configurations

The issue affects versions 0.5.3 through 0.6.8 when all of the following are true:

  • TLS interception is enabled for the destination
  • untrusted or attacker-controlled code can run inside the sandbox
  • an allowed hostname is served by infrastructure where the connection hostname and the HTTP/1 Host can differ

It applies whether or not secrets are configured.

Patches

Fixed in 0.6.9. HTTP/1 requests on intercepted connections that cannot be parsed are now blocked instead of forwarded. The fix also requires exactly one Host header, rejects malformed header lines, and checks an absolute-form request target against the SNI.

Workarounds

Before upgrading, avoid allowlisting hostnames on shared infrastructure for sandboxes that run untrusted code, or disable networking for those sandboxes.

References

Remediation

Upgrade the affected packages to 0.6.9 or later.

Affected versions

References

GitHub · superradcompany/microsandbox