CVE-2024-32980: Spin sdk Spin Applications With Specific Configuration Vulnerability

CRITICAL
Advisory Identifier: GHSA-f3h7-gpjj-wcvh
CVSS 9.1
CWE-610
Published
Advisory Summary

CVE-2024-32980 is a CRITICAL (CVSS 9.1) spin applications with specific configuration vulnerability (CWE-610: Externally Controlled Reference to a Resource in Another Sphere) affecting Spin sdk libraries in the crates.io ecosystem. The issue involves spin applications with specific configuration vulnerable to potential network sandbox escape. Remediation is available by upgrading affected packages to version 2.4.3.

CVE-2024-32980 at a Glance

CVE Identifier CVE-2024-32980
GHSA Identifier GHSA-f3h7-gpjj-wcvh
Severity CRITICAL
CVSS v3.1 Base Score 9.1
CWE Classification CWE-610: Externally Controlled Reference to a Resource in Another Sphere
Affected Product Spin sdk
Package Ecosystem crates.io
Published Date
Last Updated

Security Impact

CVSS: 9.1

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2024-32980

To remediate this vulnerability, upgrade all affected Spin sdk dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

spin-sdk fixed: 2.4.3
Upgrade spin-sdk to 2.4.3
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for spin-sdk

How to Check if You Are Affected

To determine whether your application is affected by CVE-2024-32980, inspect your project dependencies for Spin sdk:

inspect dependencies for spin-sdk

Analyze the terminal output to locate any version of Spin sdk in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.4.3), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-610: Externally Controlled Reference to a Resource in Another Sphere, where the product uses an externally controlled name or reference that resolves to a resource that is outside of the intended control sphere. In Spin sdk, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact Some 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 as ```toml allowed_outbound_hosts = ["http://self", "https://self"] ``` and code such as ```rust let res: Response = spin_sdk::http::send( Request::new(Method::Get, "/") // Note: the request URI does not contain a URL authority ).await?; ``` Then 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 as ```shell curl -H"Host: google.com:80" localhost:3000 # Assuming the application is served on localhost:3000 ``` > Note: If using a SDK that does not use `wasi:http/outgoing-handler`, the port can be omitted from the URL. #### Vulnerable Configurations The following conditions need to be met for an application to be vulnerable: 1. 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. 2. The Spin application's component handling the incoming request is configured with an `allowed_outbound_hosts` list containing `"self"`. 3. 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 vulnerable Fermyon'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. ### Workarounds For 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: 1. Ensure that outgoing requests always sanitize the `Host` header 2. Ensure that outgoing requests always provide the hostname in the URL and use that hostname in the `allowed_outbound_hosts` list instead of `self` 3. 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

CVE-2024-32980 Affected Spin sdk Versions

1 component(s)
Fixed Versions:
2.4.3
Product / Package Ecosystem Affected Versions Fixed Version
spin-sdk
crates.io
< 2.4.3
2.4.3

References

Frequently Asked Questions

What is CVE-2024-32980?
CVE-2024-32980 is a security vulnerability in Spin sdk involving Spin applications with specific configuration vulnerable to potential network sandbox escape under CWE-610: Externally Controlled Reference to a Resource in Another Sphere.
Which Spin sdk versions are affected?
Affected versions include releases prior to 2.4.3 across affected packages: spin-sdk.
What version fixes CVE-2024-32980?
Upgrading to 2.4.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is spin-sdk affected?
Yes, spin-sdk is affected in releases prior to 2.4.3. Upgrade your dependency to 2.4.3 or later.
What is the CVSS score of CVE-2024-32980?
CVE-2024-32980 has a CVSS v3.1 base score of 9.1 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N.
What CWE is associated with CVE-2024-32980?
CVE-2024-32980 is classified under CWE-610: Externally Controlled Reference to a Resource in Another Sphere (The product uses an externally controlled name or reference that resolves to a resource that is outside of the intended control sphere.).
How can I check crates.io dependencies for CVE-2024-32980?
Run the dependency tree command: 'inspect dependencies for spin-sdk'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-f3h7-gpjj-wcvh",
  "modified" : "2024-05-08T17:50:49Z",
  "published" : "2024-05-08T17:50:49Z",
  "aliases" : [ "CVE-2024-32980" ],
  "summary" : "Spin applications with specific configuration vulnerable to potential network sandbox escape",
  "details" : "### Impact\nSome 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.\n\nIf an application's manifest contains a component with configuration such as\n```toml\nallowed_outbound_hosts = [\"http://self\", \"https://self\"]\n```\n\nand code such as\n```rust\n let res: Response = spin_sdk::http::send(\n        Request::new(Method::Get, \"/\") // Note: the request URI does not contain a URL authority\n ).await?;\n```\n\nThen 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 as\n```shell\ncurl -H\"Host: google.com:80\" localhost:3000 # Assuming the application is served on localhost:3000\n```\n\n> Note: If using a SDK that does not use `wasi:http/outgoing-handler`, the port can be omitted from the URL.\n\n#### Vulnerable Configurations\n\nThe following conditions need to be met for an application to be vulnerable:\n1. 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.\n2. The Spin application's component handling the incoming request is configured with an `allowed_outbound_hosts` list containing `\"self\"`.\n3. In reaction to an incoming request, the component makes an outbound request whose URL doesn't include the hostname/port.\n\nIf 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.\n\n#### Setups known not to be vulnerable\n\nFermyon's [Fermyon Cloud](https://developer.fermyon.com/cloud/index) serverless product and applications hosted on it are known not to be vulnerable.\n\n\n### Patches\n_Has the problem been patched? What versions should users upgrade to?_\nSpin version 2.4.3 is being released with this advisory going public.\n\n### Workarounds\nFor deployments of Spin, a workaround is to ensure that the `Host` header is sanitized to match the application a request is routed to.\n\nFor individual applications, multiple workarounds exist:\n1. Ensure that outgoing requests always sanitize the `Host` header\n2. Ensure that outgoing requests always provide the hostname in the URL and use that hostname in the `allowed_outbound_hosts` list instead of `self`\n3. 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\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "spin-sdk"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.4.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/fermyon/spin/security/advisories/GHSA-f3h7-gpjj-wcvh"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-32980"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/fermyon/spin/commit/b3db535c9edb72278d4db3a201f0ed214e561354"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/fermyon/spin"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-610" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-05-08T17:50:49Z",
    "nvd_published_at" : "2024-05-08T15:15:10Z"
  }
}