Back to Blog
Web & App Security2026-11-24Suraj Disoja

CVE-2026-66911: stored XSS through Zimbra attachment Content-Location

While testing a client's Zimbra Collaboration deployment, TrustFoundry found a stored XSS flaw in the Classic Web Client. A sender-controlled attachment Content-Location value beginning with javascript: passed the Classic Web Client's URL check because it also contained an allowed-looking URL later in the string. The client then used the full value as the attachment filename link's href. When the recipient clicked that link, the browser executed attacker-controlled JavaScript in the authenticated webmail page. The issue is tracked as CVE-2026-66911.

Zimbra says it fixed this issue in Collaboration 10.1.21, released on 24 September 2026. CERT Polska's advisory lists versions before 10.1.21 as affected.

Advisory detailStatus
IdentifierCVE-2026-66911
TypeStored cross-site scripting in an attachment link
TrustFoundry severityHigh
Attacker prerequisiteAbility to deliver a crafted email attachment
Victim actionOpen the message in the Classic client and click the attachment name
Observed resultJavaScript executed in the signed-in webmail origin
Vendor fixZimbra Collaboration 10.1.21

Why an attachment header mattered

An attachment can carry a MIME Content-Location header. It normally describes where related content is located; it is still data supplied by whoever created the email. It must not automatically become a trusted browser navigation target.

The code path we reviewed carries this header through the server's SOAP response, the Classic client's attachment model, and its link renderer.

Source: the MIME header enters the client

In the server source we reviewed, zm-mailbox/store/src/java/com/zimbra/cs/service/mail/ToXML.java reads the MIME header and adds it to the SOAP response (lines 2765–2767):

String cl = mp.getHeader("Content-Location", null);
if (cl != null) {
    el.addAttribute(MailConstants.A_CONTENT_LOCATION, StringUtil.stripControlCharacters(cl));
}

Removing control characters does not validate the URL scheme. The Classic client then copies the SOAP cl value into the attachment model in ZmMimePart.js (line 266):

this.contentLocation = this.cl = node.cl;

Selection: a substring match keeps the original value

ZmMailMsg.js defines its URL pattern without a start anchor (line 126):

ZmMailMsg.URL_RE = /((telnet:)|((https?|ftp|gopher|news|file):\/\/)|(www\.[\w\.\_\-]+))[^\s\xA0\(\)\<\>\[\]\{\}\'\"]*/i;

These selected lines from the same file show the check and what it does with a match (lines 2244, 2259, and 2299):

useCL = attach.contentLocation && (attach.relativeCl || ZmMailMsg.URL_RE.test(attach.contentLocation));
var url = useCL ? attach.contentLocation : this.getUrlForPart(attach);
props.url = url;

The regex can match an allowed-looking substring inside a value beginning with javascript:. The code then selects the entire original contentLocation, not the substring that matched.

Sink: the attachment name becomes a browser link

In ZmMailMsgView.js, getMainAttachmentLinkHtml passes the attachment URL to the link builder (lines 2363 and 2366):

params1.href = params.att.url;
return ZmMailMsgView.getAttachmentLinkHtml(params1);

getAttachmentLinkHtml then writes that value to the link's href (lines 2308–2309):

var href = params.href || (params.jsHref && "javascript:;");
html[i++] = href ? "href='" + AjxStringUtil.encodeQuotes(AjxStringUtil.htmlEncode(href)) + "' " : "";

The HTML encoding protects the markup's attribute syntax, but it does not make a javascript: URL safe. Another check in ZmMailMsgView.js (line 2347) changes whether the link opens in a new tab when its value begins with javascript:; it does not reject that value as the href. Clicking the attachment name can therefore execute script in the authenticated webmail page.

What we validated

We used controlled test mailboxes and an inert browser marker. After the crafted message was imported and forwarded within the authorized environment, clicking its attachment name changed the page title and a DOM marker. That demonstrated JavaScript execution in the authenticated Zimbra page without reading mailbox contents or extracting credentials.

Our live validation established the attachment-link and browser-execution chain. It did not establish external SMTP delivery in that environment. CERT Polska's public description separately describes the unauthenticated remote-sender scenario: a crafted email reaches the victim, who clicks the attachment name in the Classic client.

Impact and boundaries

Script running in the webmail origin can potentially make same-origin requests and access data or actions available to the user's session. That could include reading mailbox data, modifying mail state, or sending messages, depending on the account's permissions and the application's other controls. Our proof established code execution in the page; it did not demonstrate data theft or account takeover.

The interaction requirement is important. Merely receiving the message did not trigger the demonstrated behavior. The user had to click the attachment name.

Fix and verification

Administrators should upgrade to Zimbra Collaboration 10.1.21 or a later supported release. Zimbra's release notes identify the Content-Location attachment XSS fix.

The underlying design lesson is to avoid using sender-supplied MIME metadata directly as an attachment navigation URL. A safer design generates a trusted, same-origin URL for the stored attachment. If external Content-Location values must be supported, validate the complete normalized URI against an explicit scheme allowlist before assigning it to a browser URL property. HTML encoding remains necessary for safe markup construction, but it is not URL-scheme validation.

After upgrading, a harmless test attachment with an unsafe Content-Location scheme should not produce an executable attachment link. Ordinary attachment download and preview behavior should continue to work.

Research and disclosure

TrustFoundry identified and validated this issue during a penetration test for a Zimbra customer. We shared the finding with the customer, who handled the vendor disclosure.

CERT Polska independently discovered the same issue. Its CVE advisory acknowledges Suraj Disoja (TrustFoundry) as an independent discoverer, and Zimbra's advisory credits Suraj and CERT.PL for CVE-2026-66911.

References

This is the day job

Authorization flaws are the most common serious issue we find in application testing, and they are exactly the kind of bug a scanner reports clean on.

Engagements today run on Hexecution, the platform we built ourselves, so findings reach clients as they are approved instead of in a PDF at the end.