CVE-2024-52791 Denial of service through memory exhaustion in Matrix Media Repo
Attackers can cause denial of service in Matrix Media Repo by sending large JSON responses that exhaust server memory during parsing.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2024-52791?
CVE-2024-52791 is a medium-severity denial of service vulnerability in t2bot matrix-media-repo, published on 16 Jan 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
Matrix Media Repo (MMR) is a highly configurable multi-homeserver media repository for Matrix. MMR makes requests to other servers as part of normal operation, and these resource owners can return large amounts of JSON back to MMR for parsing. In parsing, MMR can consume large amounts of memory and exhaust available memory. This is fixed in MMR v1.3.8. Users are advised to upgrade. For users unable to upgrade; forward proxies can be configured to block requests to unsafe hosts. Alternatively, MMR processes can be configured with memory limits and auto-restart. Running multiple MMR processes concurrently can help ensure a restart does not overly impact users.
Weakness: CWE-789
Which versions are affected by CVE-2024-52791?
3 open source packages ship an affected version, including github.com/t2bot/matrix-media-repo. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
github.com/t2bot/matrix-media-repo Go | All versions | 1.3.8 |
github.com/t2bot/matrix-media-repo Go | All versions | 1.3.8 |
github.com/t2bot/matrix-media-repo Go | All versions | 1.3.8 |
Products include T2bot Matrix-Media-Repo.
How do I fix CVE-2024-52791?
Upgrade github.com/t2bot/matrix-media-repo to 1.3.8 or later.
Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.
Is CVE-2024-52791 being exploited?
There is no known exploitation of CVE-2024-52791 in the wild and no public exploit code.
Other vulnerabilities in t2bot matrix-media-repo
- CVE-2024-56515 Untrusted file formats can be thumbnailed, invoking potentially further untrusted decoders in Matrix Media Repo
- CVE-2024-36402 Unauthenticated writes to the media repository allow planting of problematic content in Matrix Media Repo
- CVE-2024-36403 Denial of service/high operating costs through unauthenticated downloads in Matrix Media Repo
- CVE-2024-52602 Server-Side Request Forgery (SSRF) on redirects and federation in Matrix Media Repo
Sources
Also known as GHSA-gp86-q8hg-fpxj, GO-2025-3398.