CVE-2024-52791: Github.com/t2bot/matrix media repo Denial of Service Vulnerability

MODERATE
Advisory Identifier: GHSA-gp86-q8hg-fpxj
CVSS 5.3
CWE-789
Published
Advisory Summary

CVE-2024-52791 is a MODERATE (CVSS 5.3) denial of service vulnerability (CWE-789: Memory Allocation with Excessive Size Value) affecting Github.com/t2bot/matrix media repo libraries in the Go ecosystem. The issue involves matrix-media-repo (mmr) allows a denial of service through memory exhaustion. Remediation is available by upgrading affected packages to version 1.3.8.

CVE-2024-52791 at a Glance

CVE Identifier CVE-2024-52791
GHSA Identifier GHSA-gp86-q8hg-fpxj
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-789: Memory Allocation with Excessive Size Value
Affected Product Github.com/t2bot/matrix media repo
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 5.3

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability Low (A:L)

How to Fix CVE-2024-52791

To remediate this vulnerability, upgrade all affected Github.com/t2bot/matrix media repo dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/t2bot/matrix-media-repo fixed: 1.3.8
Upgrade github.com/t2bot/matrix-media-repo to 1.3.8
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/t2bot/matrix-media-repo

How to Check if You Are Affected

To determine whether your application is affected by CVE-2024-52791, inspect your project dependencies for Github.com/t2bot/matrix media repo:

inspect dependencies for github.com/t2bot/matrix-media-repo

Analyze the terminal output to locate any version of Github.com/t2bot/matrix media repo in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.3.8), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-789: Memory Allocation with Excessive Size Value, where the product allocates memory based on an untrusted, large size value, but it does not ensure that the size is within expected limits, allowing arbitrary amounts of memory to be allocated. In Github.com/t2bot/matrix media repo, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact 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. ### Patches This is fixed in [MMR v1.3.8](https://github.com/t2bot/matrix-media-repo/releases/tag/v1.3.8). ### Workarounds 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.

CVE-2024-52791 Affected Github.com/t2bot/matrix media repo Versions

1 component(s)
Fixed Versions:
1.3.8
Product / Package Ecosystem Affected Versions Fixed Version
github.com/t2bot/matrix-media-repo
Go
< 1.3.8
1.3.8

References

Frequently Asked Questions

What is CVE-2024-52791?
CVE-2024-52791 is a security vulnerability in Github.com/t2bot/matrix media repo involving matrix-media-repo (MMR) allows a denial of service through memory exhaustion under CWE-789: Memory Allocation with Excessive Size Value.
Which Github.com/t2bot/matrix media repo versions are affected?
Affected versions include releases prior to 1.3.8 across affected packages: github.com/t2bot/matrix-media-repo.
What version fixes CVE-2024-52791?
Upgrading to 1.3.8 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/t2bot/matrix-media-repo affected?
Yes, github.com/t2bot/matrix-media-repo is affected in releases prior to 1.3.8. Upgrade your dependency to 1.3.8 or later.
What is the CVSS score of CVE-2024-52791?
CVE-2024-52791 has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L.
What CWE is associated with CVE-2024-52791?
CVE-2024-52791 is classified under CWE-789: Memory Allocation with Excessive Size Value (The product allocates memory based on an untrusted, large size value, but it does not ensure that the size is within expected limits, allowing arbitrary amounts of memory to be allocated.).
How can I check Go dependencies for CVE-2024-52791?
Run the dependency tree command: 'inspect dependencies for github.com/t2bot/matrix-media-repo'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-gp86-q8hg-fpxj",
  "modified" : "2025-08-20T17:40:17Z",
  "published" : "2025-01-16T19:07:43Z",
  "aliases" : [ "CVE-2024-52791" ],
  "summary" : "matrix-media-repo (MMR) allows a denial of service through memory exhaustion",
  "details" : "### Impact\nMMR 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.\n\n### Patches\nThis is fixed in [MMR v1.3.8](https://github.com/t2bot/matrix-media-repo/releases/tag/v1.3.8).\n\n### Workarounds\nForward 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.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/t2bot/matrix-media-repo"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.3.8"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 1.3.7"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/t2bot/matrix-media-repo/security/advisories/GHSA-gp86-q8hg-fpxj"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-52791"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/t2bot/matrix-media-repo"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/t2bot/matrix-media-repo/releases/tag/v1.3.8"
  }, {
    "type" : "WEB",
    "url" : "https://pkg.go.dev/vuln/GO-2025-3398"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-789" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-01-16T19:07:43Z",
    "nvd_published_at" : "2025-01-16T20:15:32Z"
  }
}