# CVE-2024-39687: Fedify vulnerable to allowing access to internal network resources

> An attacker can exploit Fedify to send requests to internal network resources via crafted ActivityPub URLs, potentially accessing sensitive internal data.

- **Severity:** High 7.2 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:N/A:L`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 5 Jul 2024
- **Updated:** 2 Aug 2024
- **Also known as:** GHSA-p9cg-vqcc-grcx

## What is CVE-2024-39687?

CVE-2024-39687 is a high-severity server-side request forgery vulnerability in dahlia fedify, published on 5 Jul 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

Fedify is a TypeScript library for building federated server apps powered by ActivityPub and other standards. At present, when Fedify needs to retrieve an object or activity from a remote activitypub server, it makes a HTTP request to the `@id` or other resources present within the activity it has received from the web. This activity could reference an `@id` that points to an internal IP address, allowing an attacker to send request to resources internal to the fedify server's network. This applies to not just resolution of documents containing activities or objects, but also to media URLs as well. Specifically this is a Server Side Request Forgery attack. Users should upgrade to Fedify version 0.9.2, 0.10.1, or 0.11.1 to receive a patch for this issue.

Weakness: CWE-918 (Server-Side Request Forgery)

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

6 open source packages ship an affected version, including @fedify/fedify.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `@fedify/fedify` | npm | All versions | 0.9.2 |
| `@fedify/fedify` | npm | All versions | 0.9.2 |
| `@fedify/fedify` | npm | From 0.10.0 | 0.10.2 |
| `@fedify/fedify` | npm | From 0.10.0 | 0.10.2 |
| `@fedify/fedify` | npm | From 0.11.0 | 0.11.2 |
| `@fedify/fedify` | npm | From 0.11.0 | 0.11.2 |

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

Upgrade @fedify/fedify to a fixed version for your release line: 0.9.2, 0.10.2 or 0.11.2.

## Is CVE-2024-39687 being exploited?

There is no known exploitation of CVE-2024-39687 in the wild and no public exploit code.

## Fix prompt for AI coding agents

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

What it is: CVE-2024-39687 is a high-severity server-side request forgery vulnerability in dahlia fedify, published on 5 Jul 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2024-39687 in the wild and no public exploit code.

Affected packages and fixed versions:
- @fedify/fedify (npm): affected all versions; fixed in 0.9.2
- @fedify/fedify (npm): affected all versions; fixed in 0.9.2
- @fedify/fedify (npm): affected from 0.10.0; fixed in 0.10.2
- @fedify/fedify (npm): affected from 0.10.0; fixed in 0.10.2
- @fedify/fedify (npm): affected from 0.11.0; fixed in 0.11.2
- @fedify/fedify (npm): affected from 0.11.0; fixed in 0.11.2

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-39687/ (Markdown: https://insights.sbomify.com/CVE-2024-39687/index.md)
```

## Sources

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

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