Upstream : https://github.com/zusam/zusam
GitHub Security Advisory : GHSA-96fx-5rqv-jfxh
CISA NVD Reference : CVE-2024-51492
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:L/A:L — Base Score 8.8 (High)
Affected versions : <= 0.5.5


Product brief

Zusam (/tsuˈzam/) is a free and open-source way to self-host private forums for groups of friends. Composed of a server written in PHP exposing a REST API and a lightweight webapp, Zusam is extensible and easy to install. The goal is to make a stable, extensible, lightweight and user-friendly way to self-host private social groups.


Vulnerability Summary

Specially crafted SVG files uploaded to the service as images allow for unrestricted script execution on (raw) image load. With certain payloads, theft of the target user’s long-lived session token is possible.

Note that Zusam, at the time of writing, uses a user’s static API key as a long-lived session token, and these terms can be used interchangeably on the platform. This session token/API key remains valid indefinitely, so long as the user doesn’t expressly request a new one via their Settings page.


Basic Proof of Concept

<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" onload="alert(localStorage.getItem('apiKey'));">
  <rect width="100%" height="100%" fill="white"/>
  <text x="10" y="20" font-size="16" fill="black">Reference: https://pfeister.dev</text>
</svg>

Remediation

Administrators of affected versions should upgrade to 0.5.6 or higher.
When this is not possible, administators should intercept responses and add proper CSP headers to block inline script execution.