Spin applications with specific configuration vulnerable to potential network sandbox escape
ImpactSome specifically configured Spin applications that use `self` requests without a specified URL authority can be induced to make requests to arbitrary hosts via the `Host` HTTP header.If an application's manifest contains a component with configuration such asand code such asThen that application can be induced to send an outgoing request to another host (leading the app to process the response assuming it comes from another component in the same application). This can be induced with a request such asNote: If using a SDK that does not use `wasi:http/outgoing-handler`, the port can be omitted from the URL.Vulnerable ConfigurationsThe following conditions need to be met for an application to be vulnerable:The environment Spin is deployed in routes requests to the Spin runtime based on the request URL instead of the `Host` header, and leaves the `Host` header set to the original value by the client.The Spin application's component handling the incoming request is configured with an `allowed_outbound_hosts` list containing `"self"`.In reaction to an incoming request, the component makes an outbound request whose URL doesn't include the hostname/port.If all of these conditions apply, then Spin will use the inbound request's `Host` header to determine the `authority` part of the URL if none is explicitly provided in the request's URL.Setups known not to be vulnerableFermyon's [Fermyon Cloud](https://developer.fermyon.com/cloud/index) serverless product and applications hosted on it are known not to be vulnerable.Patches_Has the problem been patched? What versions should users upgrade to?_
Spin version 2.4.3 is being released with this advisory going public.WorkaroundsFor deployments of Spin, a workaround is to ensure that the `Host` header is sanitized to match the application a request is routed to.For individual applications, multiple workarounds exist:Ensure that outgoing requests always sanitize the `Host` headerEnsure that outgoing requests always provide the hostname in the URL and use that hostname in the `allowed_outbound_hosts` list instead of `self`When using Spin 2.4, use [application-internal service chaining](https://developer.fermyon.com/spin/v2/http-outbound#local-service-chaining) for intra-application requests