Deserialization of Untrusted Data
CVE-2024-56515
Summary
Matrix Media Repo (MMR) is a configurable multi-homeserver media repository for Matrix. A vulnerability exists in MMR where, if SVG or JPEGXL "thumbnailers" are enabled (disabled by default), a user could upload a file claiming to be one of these types and request a thumbnail, invoking a different decoder in ImageMagick. This could potentially lead to the execution of Ghostscript, depending on the ImageMagick configuration. Similarly, if MP4 "thumbnailers" are enabled (also disabled by default), FFmpeg could be invoked under the same conditions.MMR uses various decoders for other file types during thumbnail generation. While no exploits were found for these decoders during testing, theoretical risks remain. This issue affects MMR versions prior to v1.3.8, where the mimetype of media is now inspected prior to thumbnailing, ensuring "thumbnailers" are selected based on verified results rather than user-supplied values. This reduces risks and limits potential issues with obscure file types. Those unable to upgrade can mitigate the risk by disabling SVG, JPEGXL, and MP4 thumbnailing in the MMR configuration. Additionally, further risk reduction can be achieved by disabling uncommon file types on the server, using containers to isolate decoders like ImageMagick and ffmpeg, or restricting the capabilities of these tools. Some installations of ImageMagick and the MMR Docker image already disable "unsafe" file types, such as PDFs, by default.
- LOW
- NETWORK
- NONE
- UNCHANGED
- NONE
- LOW
- HIGH
- NONE
CWE-502 - Deserialization of Untrusted Data
Deserialization of untrusted data vulnerabilities enable an attacker to replace or manipulate a serialized object, replacing it with malicious data. When the object is deserialized at the victim's end the malicious data is able to compromise the victim’s system. The exploit can be devastating, its impact may range from privilege escalation, broken access control, or denial of service attacks to allowing unauthorized access to the application's internal code and logic which can compromise the entire system.
References
Advisory Timeline
- Published