Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2025-52559 Overview
CVE-2025-52559 is a stored cross-site scripting (XSS) vulnerability [CWE-79] in Zulip Server, an open-source team chat application. The flaw affects the /digest/ URL, which renders a preview of the weekly email digest. Topic names and channel names rendered on this preview page are not safely escaped, allowing an attacker to inject arbitrary HTML or JavaScript. The issue impacts versions 2.0.0-rc1 through versions prior to 10.4. Successful exploitation requires an authenticated user with permission to create channels or topics, and the victim must load the vulnerable /digest/ endpoint. Zulip Server 10.4 resolves the vulnerability.
Critical Impact
An authenticated attacker can inject script payloads via channel or topic names that execute in the browser of any user who visits the /digest/ preview page.
Affected Products
- Zulip Server versions 2.0.0-rc1 through 10.3
- Zulip Server self-hosted deployments exposing the /digest/ endpoint
- Fixed in Zulip Server 10.4
Discovery Timeline
- 2025-07-02 - CVE-2025-52559 published to NVD
- 2026-06-17 - Last updated in NVD database
Technical Details for CVE-2025-52559
Vulnerability Analysis
The /digest/ endpoint in Zulip Server renders a preview of the weekly email digest for the requesting user. During rendering, the server composes HTML that includes channel names, topic names, and message sender fields. The vulnerable code paths concatenated these user-controlled strings into HTML output without consistent escaping. An authenticated user who can create a channel or post a message under a crafted topic name can embed HTML markup that is reflected into the digest preview page. When another authenticated user loads /digest/, the injected markup executes in their browser session.
The vulnerability is scoped to the preview endpoint. The actual outbound digest emails are not affected because they use a different rendering pipeline. However, any administrator or user who browses the preview URL triggers the injected payload in the context of the Zulip origin.
Root Cause
The fix in commits 175ec1f3, 1a8429e3, and 6608c877 migrates the digest rendering code to use markupsafe.Markup and BeautifulSoup with explicit escaping. Previously, functions such as prepend_sender_to_message concatenated raw strings into HTML (f"<b>{sender}</b>: "), which treated attacker-controlled content as trusted markup. The patches update type signatures from str to Markup and route formatting through Markup(...).format(...) so that embedded HTML special characters are escaped.
Attack Vector
Exploitation requires network access to the Zulip Server, low-privileged authentication, and user interaction (loading the /digest/ URL). An attacker creates a channel or topic whose name contains an XSS payload. When a target user visits the digest preview, the payload executes with the privileges of that user's Zulip session, enabling session theft, message exfiltration, or forced actions against the Zulip API.
# Patch excerpt - zerver/lib/email_notifications.py
# Source: https://github.com/zulip/zulip/commit/1a8429e338ff53bdcc4b42e7e71b6fffdd84fcd1
def prepend_sender_to_message(
message_plain: str, message_html: Markup, sender: str
) -> tuple[str, Markup]:
message_plain = f"{sender}:\n{message_plain}"
message_soup = BeautifulSoup(message_html, "html.parser")
sender_name_soup = BeautifulSoup(
Markup("<b>{sender}</b>: ").format(sender=sender), "html.parser"
)
first_tag = message_soup.find()
if first_tag and first_tag.name == "div":
first_tag = first_tag.find()
if first_tag and first_tag.name == "p":
first_tag.insert(0, sender_name_soup)
else:
message_soup.insert(0, sender_name_soup)
return message_plain, Markup(BeautifulSoup.decode(message_soup))
The patch replaces direct f-string HTML construction with Markup(...).format(...), which escapes attacker-controlled values such as sender, channel names, and topic names.
Detection Methods for CVE-2025-52559
Indicators of Compromise
- Channel or topic names containing HTML tags such as <script, <img, onerror=, or javascript: URIs.
- Access log entries showing requests to /digest/ followed by anomalous outbound requests from authenticated browser sessions.
- Zulip audit log entries recording channel or topic creation with payload-like strings.
Detection Strategies
- Inspect the Zulip PostgreSQL zerver_stream and zerver_message tables for names and subjects that contain HTML control characters.
- Correlate /digest/ HTTP accesses with the user agent and session of the viewer to identify potential victims.
- Review Content Security Policy (CSP) violation reports from browsers accessing the Zulip origin for blocked inline script executions.
Monitoring Recommendations
- Enable Zulip Server access logging and forward it to a centralized logging platform for retention and search.
- Alert on channel or topic creation events where the name field contains angle brackets or script-like substrings.
- Monitor web application firewall (WAF) telemetry for responses from /digest/ that contain reflected XSS signatures.
How to Mitigate CVE-2025-52559
Immediate Actions Required
- Upgrade all Zulip Server deployments to version 10.4 or later.
- Audit existing channel and topic names for HTML or script content and rename or delete anomalous entries.
- Rotate active session tokens and API keys for any user whose session may have loaded a malicious /digest/ preview.
Patch Information
Zulip Server 10.4 contains the fixes delivered in commits 175ec1f3, 1a8429e3, and 6608c877. The patches re-implement digest HTML generation using markupsafe.Markup to enforce safe escaping of channel names, topic names, and sender fields. See the Zulip Security Advisory GHSA-vgf2-vw4r-m663 for the official vendor statement.
Workarounds
- Block access to the /digest/ URL at the reverse proxy or load balancer until the upgrade is completed.
- Restrict channel and topic creation privileges to trusted roles while remediation is pending.
- Enforce a strict Content Security Policy that disallows inline script execution on the Zulip origin.
# nginx example - deny access to the vulnerable digest preview endpoint
location ^~ /digest/ {
deny all;
return 403;
}
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

