CVE-2024-39687: Server Side Request Forgery (SSRF) attack in Fedify
Summary 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.
Published Jul 5, 2024 · Updated Nov 18, 2024
Affected packages
@fedify/fedify
- Ecosystem
- npm
- Affected
- < 0.9.2
- Fixed in
- 0.9.2
- Check
npm ls @fedify/fedify
@fedify/fedify
- Ecosystem
- npm
- Affected
- >= 0.10.0, < 0.10.2
- Fixed in
- 0.10.2
- Check
npm ls @fedify/fedify
@fedify/fedify
- Ecosystem
- npm
- Affected
- >= 0.11.0, < 0.11.2
- Fixed in
- 0.11.2
- Check
npm ls @fedify/fedify
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Summary
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. You can learn more about SSRF attacks via CWE-918
Details
When Fedify makes a request at runtime via the DocLoader [1] [2], the fetch API does not first check the URI's to assert that it resolve to a public IP address. Additionally, any downstream software of Fedify that may fetch data from URIs contained within Activities or Objects maybe be at risk of requesting non-public resources, and storing those, exposing non-public information to the public.
Additionally, in many cases the URIs are not asserted to be either strictly HTTPS or HTTP protocols, which could lead to further attacks, and there is no check that the URI contains a hostname part. Whilst the `fetch()` specification may provide some safety here, along with underlying fetch implementations, there is still potential for attacks through using data: URIs, or just attacking some other protocol entirely, e.g., FTP or CalDav.
[1] https://github.com/dahlia/fedify/blob/main/runtime/docloader.ts#L141 [2] https://github.com/dahlia/fedify/blob/main/runtime/docloader.ts#L175
Deno-specific Attack Vectors
In Deno specifically, the fetch() API allows accessing local filesystem, I'm not sure how Deno's Permissions model may prevent attacks utilising file: URIs.
Fetch also supports fetching from file URLs to retrieve static files. For more info on static files, see the filesystem API documentation.
ActivityPub Security Considerations
This is also noted in the ActivityPub spec in Section B.3 Security Considerations, however, there it is more limited in scope.
Other Implementations
It may be acceptable to allow a server operator to allow access to given non-public IP addresses, for instance in Mastodon they allow requests to non-public IP addresses, i.e., localhost in development and those in the ALLOWED_PRIVATE_ADDRESSES environment variable.
PoC
I'm not sure a PoC is necessary given this is a reasonably well known vulnerability vector.
Impact
This impacts server operates, as resources that are internal to their network may find themselves being improperly accessed or potentially even attacked or exposed to the public.
Notes for resolution:
When implementing public IP address validation, be careful of CWE-1389 and CWE-1286 both of which recently caused a CVE to be filed against the popular node.js ip package, although this package was not originally intended for security purposes.
Credited to ThisIsMissEm.
References
- https://github.com/dahlia/fedify/security/advisories/GHSA-p9cg-vqcc-grcx
- https://nvd.nist.gov/vuln/detail/CVE-2024-39687
- https://github.com/dahlia/fedify/commit/30f9cf4a175704a04c874f3ea88414c5f1e00b28
- https://github.com/dahlia/fedify/commit/c641e976089dd913f649889c1bfb016df04e86ba
- https://github.com/dahlia/fedify/releases/tag/0.11.1
- https://github.com/advisories/GHSA-p9cg-vqcc-grcx
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More npm vulnerabilities
All npm entriesCVE-2026-50131
Fedify has an incomplete SSRF mitigation after GHSA-p9cg-vqcc-grcx: validatePublicUrl allows special-use IPv4 ranges
high8.6Jul 14, 2026CVE-2026-42462
Fedify has an LD-Signature Bypass via JSON-LD Named-Graph Restructuring
high7.0May 26, 2026CVE-2026-34148
Fedify affected by resource exhaustion caused by unbounded redirect following during remote key/document resolution
high7.5Apr 7, 2026CVE-2025-68475
Fedify has ReDoS Vulnerability in HTML Parsing Regex
high7.5Dec 22, 2025CVE-2025-54888
@fedify/fedify has Improper Authentication and Incorrect Authorization
high8.7Aug 8, 2025CVE-2025-23221
Infinite loop and Blind SSRF found inside the Webfinger mechanism in @fedify/fedify
medium5.4Jan 21, 2025
