Skip to main content
Menu
Advisories

Microsandbox domain deny rule bypass via direct-IP TLS connection

GHSA-XGG5-HJWQ-2GW8Published Updated GitHub

Description

Microsandbox domain and suffix deny rules could be bypassed for TLS traffic when default egress was set to allow. A process in the sandbox could connect directly to an IP address and send a TLS SNI matching the denied hostname, without first resolving it through the sandbox DNS path, and the connection was allowed.

Allow and deny rules shared one domain matching helper. For SNI-based Destination::Domain and Destination::DomainSuffix checks, it required both a hostname match and a prior DNS-cache binding between the destination IP and that hostname. That binding is correct for allow rules, since it stops a guest from spoofing SNI for an unrelated IP. For deny rules it meant a missing binding made the rule a non-match, so evaluation fell through to default_egress: Allow.

Impact

An attacker who can execute code inside a sandbox could open TLS connections to a domain the operator explicitly denied. This weakens domain blocklists used to block exfiltration destinations, internal services reachable by IP, or policy-controlled SaaS endpoints.

This is not a host escape and does not by itself grant code execution outside the sandbox.

Affected configurations

The issue affects versions before 0.5.0 when all of the following are true:

  • the sandbox uses permissive default egress (--net-default allow);
  • the policy relies on a domain or suffix deny rule, such as deny@evil.com or deny@*.evil.com;
  • untrusted or attacker-controlled code can run inside the sandbox and connect directly to an IP address that serves the denied hostname over TLS.

Sandboxes using default-deny egress with hostname allow rules are not affected by this issue, because allow rules already required the DNS-cache binding.

Patches

Upgrade to 0.5.1 or later (0.5.0 where available).

  • 0.5.0 makes SNI domain matching action-aware: deny rules match on the SNI alone, while allow rules still require the DNS-cache binding.
  • 0.5.0 was not published to npm and was yanked from crates.io, so npm and Rust users should use 0.5.1.

Workarounds

If you cannot upgrade, use default-deny egress with explicit allow rules instead of relying on domain deny rules.

References

Remediation

Upgrade each package to the patched version listed in the package metadata above.

Affected versions

References

GitHub · superradcompany/microsandbox