CVE-2024-56515: Github.com/t2bot/matrix media repo Matrix Media Repo (MMR) Allows Vulnerability

MODERATE
Advisory Identifier: GHSA-rcxc-wjgw-579r
CVSS 6.8
CWE-502 CWE-434
Published
Advisory Summary

CVE-2024-56515 is a MODERATE (CVSS 6.8) matrix media repo (mmr) allows vulnerability (CWE-502: Deserialization of Untrusted Data) affecting Github.com/t2bot/matrix media repo libraries in the Go ecosystem. The issue involves matrix media repo (mmr) allows untrusted file formats can be thumbnailed, invoking potentially further untrusted decoders. Remediation is available by upgrading affected packages to version 1.3.8.

CVE-2024-56515 at a Glance

CVE Identifier CVE-2024-56515
GHSA Identifier GHSA-rcxc-wjgw-579r
Severity MODERATE
CVSS v3.1 Base Score 6.8
CWE Classification CWE-502: Deserialization of Untrusted Data
Affected Product Github.com/t2bot/matrix media repo
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 6.8

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

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

How to Fix CVE-2024-56515

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-56515, 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-502: Deserialization of Untrusted Data, where the product deserializes untrusted data without sufficiently ensuring that the resulting data will be valid. 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 If SVG or JPEGXL thumbnailers are enabled (they are disabled by default), a user may upload a file which claims to be either of these types and request a thumbnail to invoke a different decoder in ImageMagick. In some ImageMagick installations, this includes the capability to run Ghostscript to decode the image/file. If MP4 thumbnailers are enabled (also disabled by default), the same issue as above may occur with the ffmpeg installation instead. MMR uses a number of other decoders for all other file types when preparing thumbnails. Theoretical issues are possible with these decoders, however in testing they were not possible to exploit. ### Patches This is fixed in [MMR v1.3.8](https://github.com/t2bot/matrix-media-repo/releases/tag/v1.3.8). MMR now inspects the mimetype of media prior to thumbnailing, and picks a thumbnailer based on those results instead of relying on user-supplied values. This may lead to fewer thumbnails when obscure file shapes are used. This also helps narrow scope of theoretical issues with all decoders MMR uses for thumbnails. ### Workarounds Disabling the SVG, JPEGXL, and MP4 thumbnail types in the MMR config prevents the decoders from being invoked. Further disabling uncommon file types on the server is recommended to limit risk surface. Containers and other similar technologies may also be used to limit the impact of vulnerabilities in external decoders, like ImageMagick and ffmpeg. Some installations of ImageMagick may disable "unsafe" file types, like PDFs, already. This option can be replicated to other environments as needed. ffmpeg may be compiled with limited decoders/codecs. The Docker image for MMR disables PDFs and similar formats by default. ### References A similar issue was discovered in Synapse: https://github.com/element-hq/synapse/security/advisories/GHSA-vp6v-whfm-rv3g

CVE-2024-56515 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-56515?
CVE-2024-56515 is a security vulnerability in Github.com/t2bot/matrix media repo involving Matrix Media Repo (MMR) allows untrusted file formats can be thumbnailed, invoking potentially further untrusted decoders under CWE-502: Deserialization of Untrusted Data.
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-56515?
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-56515?
CVE-2024-56515 has a CVSS v3.1 base score of 6.8 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:N/A:N.
What CWE is associated with CVE-2024-56515?
CVE-2024-56515 is classified under CWE-502: Deserialization of Untrusted Data (The product deserializes untrusted data without sufficiently ensuring that the resulting data will be valid.).
How can I check Go dependencies for CVE-2024-56515?
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-rcxc-wjgw-579r",
  "modified" : "2025-08-20T17:40:24Z",
  "published" : "2025-01-16T19:35:09Z",
  "aliases" : [ "CVE-2024-56515" ],
  "summary" : "Matrix Media Repo (MMR) allows untrusted file formats can be thumbnailed, invoking potentially further untrusted decoders",
  "details" : "### Impact\n\nIf SVG or JPEGXL thumbnailers are enabled (they are disabled by default), a user may upload a file which claims to be either of these types and request a thumbnail to invoke a different decoder in ImageMagick. In some ImageMagick installations, this includes the capability to run Ghostscript to decode the image/file.\n\nIf MP4 thumbnailers are enabled (also disabled by default), the same issue as above may occur with the ffmpeg installation instead.\n\nMMR uses a number of other decoders for all other file types when preparing thumbnails. Theoretical issues are possible with these decoders, however in testing they were not possible to exploit.\n\n### Patches\n\nThis is fixed in [MMR v1.3.8](https://github.com/t2bot/matrix-media-repo/releases/tag/v1.3.8). MMR now inspects the mimetype of media prior to thumbnailing, and picks a thumbnailer based on those results instead of relying on user-supplied values. This may lead to fewer thumbnails when obscure file shapes are used. This also helps narrow scope of theoretical issues with all decoders MMR uses for thumbnails.\n\n### Workarounds\n\nDisabling the SVG, JPEGXL, and MP4 thumbnail types in the MMR config prevents the decoders from being invoked. Further disabling uncommon file types on the server is recommended to limit risk surface. \n\nContainers and other similar technologies may also be used to limit the impact of vulnerabilities in external decoders, like ImageMagick and ffmpeg. \n\nSome installations of ImageMagick may disable \"unsafe\" file types, like PDFs, already. This option can be replicated to other environments as needed. ffmpeg may be compiled with limited decoders/codecs. The Docker image for MMR disables PDFs and similar formats by default.\n\n### References\n\nA similar issue was discovered in Synapse: https://github.com/element-hq/synapse/security/advisories/GHSA-vp6v-whfm-rv3g",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:N/A:N"
  } ],
  "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-rcxc-wjgw-579r"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-56515"
  }, {
    "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-3400"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-434", "CWE-502" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-01-16T19:35:09Z",
    "nvd_published_at" : "2025-01-16T20:15:33Z"
  }
}