{"id":"CVE-2023-41318","aliases":["CVE-2023-41318","GHSA-5crw-6j7v-xc72","GO-2023-2053"],"related":[],"kind":"vulnerability","state":"published","title":"Unsafe media served inline on download endpoints in matrix-media-repo","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### Impact\nA malicious user can upload an SVG image containing JavaScript to their server. When matrix-media-repo is asked to serve that media via the `/_matrix/media/(r0|v3)/download` endpoint, it would be served with a `Content-Disposition` of `inline`. This can allow JavaScript to run in the browser if a client links to the `/download` endpoint directly.\n\nServer operators which do not share a domain between matrix-media-repo and other services are not affected, but are encouraged to upgrade regardless.\n\n### Patches\nhttps://github.com/turt2live/matrix-media-repo/commit/77ec2354e8f46d5ef149d1dcaf25f51c04149137 and https://github.com/turt2live/matrix-media-repo/commit/bf8abdd7a5371118e280c65a8e0ec2b2e9bdaf59 fix the issue. Operators should upgrade to v1.3.0 as soon as possible.\n\n### Workarounds\nThe `Content-Disposition` header can be overridden by the reverse proxy in front of matrix-media-repo to always use `attachment`, defeating this issue at the cost of \"worse\" user experience when clicking download links.\n\n### References\nhttps://developer.mozilla.org/en-US/docs/Web/SVG/Element/script","format":"markdown","source":"ghsa"},{"lang":"en","text":"matrix-media-repo: Unsafe media served inline on download endpoints in github.com/turt2live/matrix-media-repo","format":"markdown","source":"go"},{"lang":"es","text":"Matrix-media-repo es un repositorio de medios multidominio altamente personalizable para el ecosistema de chat de Matrix. En las versiones afectadas, un atacante podría cargar un contenido malicioso en el repositorio de contenidos, que luego se entregaría con \"Content-Disposition: inline\" al descargarlo. Esta vulnerabilidad podría aprovecharse para ejecutar scripts incrustados en contenido SVG. Los commits `77ec235` y `bf8abdd` solucionan el problema y se incluyen en la versión 1.3.0. Los operadores deben actualizar a la versión 1.3.0 lo antes posible. Los operadores que no puedan actualizar deben anular el encabezado \"Content-Disposition\" devuelto por Matrix-media-repo como workaround.","source":"nvd"}],"published":"2023-09-08T13:18:23.000Z","modified":"2026-09-10T03:49:57.874Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:N/A:N","score":4.1,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:N/A:N","score":4.1,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:N/A:N","score":4.1,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N","score":5.4,"rating":"MEDIUM"}],"cwes":["CWE-79"],"affected":[{"ranges":[{"version":"< 1.3.0","status":"affected"}],"vendor":"turt2live","product":"matrix-media-repo","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"1.3.0"}],"ecosystem":"Go","package":"github.com/turt2live/matrix-media-repo","purl":"pkg:golang/github.com/turt2live/matrix-media-repo","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"1.3.0"}],"ecosystem":"Go","package":"github.com/turt2live/matrix-media-repo","purl":"pkg:golang/github.com/turt2live/matrix-media-repo","source":"go"},{"ranges":[{"status":"affected","fixed":"1.3.0"}],"vendor":"turt2live","product":"matrix-media-repo","cpe":"cpe:2.3:a:turt2live:matrix-media-repo:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/turt2live/matrix-media-repo/security/advisories/GHSA-5crw-6j7v-xc72","tags":["advisory","vendor-advisory","web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/turt2live/matrix-media-repo/commit/77ec2354e8f46d5ef149d1dcaf25f51c04149137","tags":["fix","patch","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/turt2live/matrix-media-repo/commit/bf8abdd7a5371118e280c65a8e0ec2b2e9bdaf59","tags":["fix","patch","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://developer.mozilla.org/en-US/docs/Web/SVG/Element/script","tags":["third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2023-41318","tags":["advisory"],"sources":["ghsa","go"]},{"url":"https://github.com/turt2live/matrix-media-repo","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2024-09-26T13:57:19.688Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2023-41318","url":"https://www.cve.org/CVERecord?id=CVE-2023-41318","licence":"CVE Terms of Use","modified":"2024-09-26T14:03:33.058Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-5crw-6j7v-xc72","url":"https://github.com/advisories/GHSA-5crw-6j7v-xc72","licence":"CC-BY-4.0","modified":"2026-09-10T03:49:57.874Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2023-2053","url":"https://pkg.go.dev/vuln/GO-2023-2053","licence":"CC-BY-4.0","modified":"2026-03-03T04:54:09.480Z"},{"source":"nvd","name":"NVD","id":"CVE-2023-41318","url":"https://nvd.nist.gov/vuln/detail/CVE-2023-41318","licence":"Public domain","modified":"2026-06-17T06:21:44.677Z"}],"updatedAt":"2026-11-25T22:58:27.771Z","epss":{"score":0.00516,"percentile":0.45447,"date":"2026-12-02T12:00:21.000Z"}}