# CVE-2024-32980: Spin contains a potential network sandbox escape for specifically configured Spin applications

> Attackers can bypass network sandbox restrictions in Spin applications to make requests to arbitrary hosts via manipulated Host headers.

- **Severity:** Critical 9.1 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 8 May 2024
- **Updated:** 2 Aug 2024
- **Also known as:** GHSA-f3h7-gpjj-wcvh

## What is CVE-2024-32980?

CVE-2024-32980 is a critical server-side request forgery vulnerability in fermyon spin, published on 8 May 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

Spin is the developer tool for building and running serverless applications powered by WebAssembly. Prior to 2.4.3, 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. 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 its original value; 2. The Spin application's component handling the incoming request is configured with an `allow_outbound_hosts` list containing `"self"`; and 3. In reaction to an incoming request, the component makes an outbound request whose URL doesn't include the hostname/port. Spin 2.4.3 has been released to fix this issue.

Weakness: CWE-610 (Externally Controlled Reference to a Resource in Another Sphere)

## Which versions are affected by CVE-2024-32980?

2 open source packages ship an affected version, including spin-sdk.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `spin-sdk` | crates.io | All versions | 2.4.3 |
| `spin-sdk` | crates.io | All versions | 2.4.3 |

## How do I fix CVE-2024-32980?

Upgrade spin-sdk to 2.4.3 or later.

## Is CVE-2024-32980 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-32980 exists.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-32980 and fix it if it is affected.

What it is: CVE-2024-32980 is a critical server-side request forgery vulnerability in fermyon spin, published on 8 May 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-32980 exists.

Affected packages and fixed versions:
- spin-sdk (crates.io): affected all versions; fixed in 2.4.3
- spin-sdk (crates.io): affected all versions; fixed in 2.4.3

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2024-32980/ (Markdown: https://insights.sbomify.com/CVE-2024-32980/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2024-32980
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2024-32980
- OSV: https://osv.dev/vulnerability/CVE-2024-32980

---
From sbomify Insights: https://insights.sbomify.com/CVE-2024-32980/
Summaries are generated and may contain mistakes; the official description above is the record.
