{"id":"CVE-2023-41318","aliases":["EUVD-2023-2431","GHSA-5crw-6j7v-xc72","GO-2023-2053"],"status":"published","title":"Unsafe media served inline on download endpoints in matrix-media-repo","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.","severity":{"version":"3.1","score":4.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:N/A:N","level":"medium","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-09","score":0.00516,"percentile":0.44235,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-79"],"published":"2023-09-08T13:18:23Z","modified":"2026-10-28T02:30:54Z","fixes":[{"ecosystem":"Go","package":"github.com/turt2live/matrix-media-repo","fixed_in":["1.3.0"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"Go","package":"github.com/turt2live/matrix-media-repo","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.3.0"}]}]},{"source":"osv","ecosystem":"Go","package":"github.com/turt2live/matrix-media-repo","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"1.3.0"}]}]},{"source":"osv","ecosystem":"Go","package":"github.com/turt2live/matrix-media-repo","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"1.3.0"}]}]}],"products":[{"vendor":"t2bot","product":"matrix-media-repo"},{"vendor":"turt2live","product":"matrix-media-repo"}],"references":[{"url":"https://github.com/turt2live/matrix-media-repo/security/advisories/GHSA-5crw-6j7v-xc72","tags":["x_refsource_CONFIRM","x_transferred","Vendor Advisory","advisory","web"]},{"url":"https://github.com/turt2live/matrix-media-repo/commit/77ec2354e8f46d5ef149d1dcaf25f51c04149137","tags":["x_refsource_MISC","x_transferred","Patch","fix","web"]},{"url":"https://github.com/turt2live/matrix-media-repo/commit/bf8abdd7a5371118e280c65a8e0ec2b2e9bdaf59","tags":["x_refsource_MISC","x_transferred","Patch","fix","web"]},{"url":"https://developer.mozilla.org/en-US/docs/Web/SVG/Element/script","tags":["x_refsource_MISC","x_transferred","Third Party Advisory","web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2023-41318","tags":["advisory"]},{"url":"https://github.com/advisories/GHSA-5crw-6j7v-xc72"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/41xxx/CVE-2023-41318.json","tags":["advisory"]},{"url":"https://github.com/turt2live/matrix-media-repo","tags":["package"]}],"sources":{"cve":[{"id":"CVE-2023-41318","title":"Unsafe media served inline on download endpoints in matrix-media-repo","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.","status":"published","published":"2023-09-08T19:51:20.011Z","modified":"2024-09-26T14:03:33.058Z","cvss":[{"version":"3.1","score":4.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:N/A:N","level":"medium","assessor":"cna"}],"cwes":["CWE-79"],"updated_at":"2026-11-02T14:35:19.217111Z"}],"euvd":[{"id":"EUVD-2023-2431","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.","status":"published","published":"2023-09-08T19:51:20Z","modified":"2024-09-26T14:03:33Z","cvss":[{"version":"3.1","score":4.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:N/A:N","level":"medium"}],"updated_at":"2026-11-03T00:28:10.432496Z"}],"ghsa":[{"id":"GHSA-5crw-6j7v-xc72","title":"matrix-media-repo: Unsafe media served inline on download endpoints","description":"### 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\n\n","status":"published","published":"2023-09-08T13:18:23Z","modified":"2023-11-10T05:04:12Z","cvss":[{"version":"3.1","score":4.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:N/A:N","level":"medium"}],"cwes":["CWE-79"],"updated_at":"2026-11-02T14:37:19.438667Z"}],"nvd":[{"id":"CVE-2023-41318","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.","status":"published","published":"2023-09-08T20:15:14.693Z","modified":"2026-06-17T06:21:44.677Z","cvss":[{"version":"3.1","score":4.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:N/A:N","level":"medium","assessor":"secondary"},{"version":"3.1","score":5.4,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N","level":"medium","assessor":"primary"}],"cwes":["CWE-79"],"updated_at":"2026-11-02T14:08:28.268644Z"}],"osv":[{"id":"CVE-2023-41318","title":"Unsafe media served inline on download endpoints in matrix-media-repo","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.","status":"published","published":"2023-09-08T19:51:20.011Z","modified":"2026-10-28T02:30:54.838690375Z","cvss":[{"version":"3.1","score":4.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:N/A:N","level":"medium"}],"cwes":["CWE-79"],"updated_at":"2026-11-02T15:44:33.244128Z"},{"id":"GHSA-5crw-6j7v-xc72","title":"matrix-media-repo: Unsafe media served inline on download endpoints","description":"### 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\n\n","status":"published","published":"2023-09-08T13:18:23Z","modified":"2026-09-10T03:49:57.874197523Z","cvss":[{"version":"3.1","score":4.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:N/A:N","level":"medium"}],"cwes":["CWE-79"],"updated_at":"2026-11-02T15:46:38.213481Z"},{"id":"GO-2023-2053","title":"matrix-media-repo: Unsafe media served inline on download endpoints in github.com/turt2live/matrix-media-repo","description":"matrix-media-repo: Unsafe media served inline on download endpoints in github.com/turt2live/matrix-media-repo","status":"published","published":"2024-08-21T14:30:18Z","modified":"2026-03-03T04:54:09.480216Z","updated_at":"2026-11-02T15:47:01.185262Z"}]}}
