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

MODERATE
Advisory Identifier: GHSA-vc2m-hw89-qjxf
CVSS 5.3
CWE-770
Published
Advisory Summary

CVE-2024-36403 is a MODERATE (CVSS 5.3) denial of service vulnerability (CWE-770: Allocation of Resources Without Limits or Throttling) affecting Github.com/t2bot/matrix media repo libraries in the Go ecosystem. The issue involves matrix-media-repo (mmr) allows denial of service/high operating costs through unauthenticated downloads. Remediation is available by upgrading affected packages to version 1.3.5.

CVE-2024-36403 at a Glance

CVE Identifier CVE-2024-36403
GHSA Identifier GHSA-vc2m-hw89-qjxf
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-770: Allocation of Resources Without Limits or Throttling
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-36403

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.5
Upgrade github.com/t2bot/matrix-media-repo to 1.3.5
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-36403, 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.5), 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-770: Allocation of Resources Without Limits or Throttling, where the product allocates a reusable resource or group of resources on behalf of an actor without imposing any intended restrictions on the size or number of resources that can 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 before version 1.3.5 is vulnerable to unbounded disk consumption, where an unauthenticated adversary can induce it to download and cache large amounts of remote media files. MMR's typical operating environment uses S3-like storage as a backend, with file-backed store as an alternative option. Instances using a file-backed store or those which self-host an S3 storage system are therefore vulnerable to a disk fill attack. Once the disk is full, authenticated users will be unable to upload new media, resulting in denial of service. For instances configured to use a cloud-based S3 storage option, this could result in high service fees instead of a denial of service. ### Patches MMR 1.3.5 introduces a new default-on "leaky bucket" rate limit to reduce the amount of data a user can request at a time. This does not fully address the issue, but does limit an unauthenticated user's ability to request large amounts of data. Operators should note that the leaky bucket implementation introduced in MMR 1.3.5 requires the IP address associated with the request to be forwarded, to avoid mistakenly applying the rate limit to the reverse proxy instead. To avoid this issue, the reverse proxy should populate the `X-Forwarded-For` header when sending the request to MMR. ### Workarounds Operators may wish to lower the maximum file size they allow and implement harsh rate limits, though this can still lead to a large amount of data to be downloaded. ### References https://en.wikipedia.org/wiki/Leaky_bucket#As_a_meter

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

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

References

Frequently Asked Questions

What is CVE-2024-36403?
CVE-2024-36403 is a security vulnerability in Github.com/t2bot/matrix media repo involving matrix-media-repo (MMR) allows denial of service/high operating costs through unauthenticated downloads under CWE-770: Allocation of Resources Without Limits or Throttling.
Which Github.com/t2bot/matrix media repo versions are affected?
Affected versions include releases prior to 1.3.5 across affected packages: github.com/t2bot/matrix-media-repo.
What version fixes CVE-2024-36403?
Upgrading to 1.3.5 (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.5. Upgrade your dependency to 1.3.5 or later.
What is the CVSS score of CVE-2024-36403?
CVE-2024-36403 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-36403?
CVE-2024-36403 is classified under CWE-770: Allocation of Resources Without Limits or Throttling (The product allocates a reusable resource or group of resources on behalf of an actor without imposing any intended restrictions on the size or number of resources that can be allocated.).
How can I check Go dependencies for CVE-2024-36403?
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-vc2m-hw89-qjxf",
  "modified" : "2025-01-17T15:39:25Z",
  "published" : "2025-01-16T19:05:12Z",
  "aliases" : [ "CVE-2024-36403" ],
  "summary" : "matrix-media-repo (MMR) allows denial of service/high operating costs through unauthenticated downloads",
  "details" : "### Impact\n\nMMR before version 1.3.5 is vulnerable to unbounded disk consumption, where an unauthenticated adversary can induce it to download and cache large amounts of remote media files.\n\nMMR's typical operating environment uses S3-like storage as a backend, with file-backed store as an alternative option. Instances using a file-backed store or those which self-host an S3 storage system are therefore vulnerable to a disk fill attack. Once the disk is full, authenticated users will be unable to upload new media, resulting in denial of service.\n\nFor instances configured to use a cloud-based S3 storage option, this could result in high service fees instead of a denial of service.\n\n### Patches\n\nMMR 1.3.5 introduces a new default-on \"leaky bucket\" rate limit to reduce the amount of data a user can request at a time. This does not fully address the issue, but does limit an unauthenticated user's ability to request large amounts of data.\n\nOperators should note that the leaky bucket implementation introduced in MMR 1.3.5 requires the IP address associated with the request to be forwarded, to avoid mistakenly applying the rate limit to the reverse proxy instead. To avoid this issue, the reverse proxy should populate the `X-Forwarded-For` header when sending the request to MMR.\n\n### Workarounds\n\nOperators may wish to lower the maximum file size they allow and implement harsh rate limits, though this can still lead to a large amount of data to be downloaded. \n\n### References\n\nhttps://en.wikipedia.org/wiki/Leaky_bucket#As_a_meter",
  "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.5"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/t2bot/matrix-media-repo/security/advisories/GHSA-vc2m-hw89-qjxf"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-36403"
  }, {
    "type" : "WEB",
    "url" : "https://en.wikipedia.org/wiki/Leaky_bucket#As_a_meter"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/t2bot/matrix-media-repo"
  }, {
    "type" : "WEB",
    "url" : "https://pkg.go.dev/vuln/GO-2025-3401"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-770" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-01-16T19:05:12Z",
    "nvd_published_at" : "2025-01-16T20:15:32Z"
  }
}