CVE-2024-52791 Denial of service through memory exhaustion in Matrix Media Repo

Medium 5.3 Published Updated

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.

PackageAffectedFixed in
github.com/t2bot/matrix-media-repo GoAll versions1.3.8
github.com/t2bot/matrix-media-repo GoAll versions1.3.8
github.com/t2bot/matrix-media-repo GoAll versions1.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.

Sources

Also known as GHSA-gp86-q8hg-fpxj, GO-2025-3398.

Is CVE-2024-52791 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free