--- cve: CVE-2026-137835 cna: Rapid7 credit: Jonah Burgess (Rapid7) severity: "Critical (Rapid7)" cvss_v3_1: "9.3 CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N" cwe: "CWE-79" affected_versions: "10.1.0 through 10.1.22 with the Attach Mail Zimlet enabled" fixed_versions: "No confirmed fix" --- # CVE-2026-137835: Unauthenticated Stored XSS in the Classic Attach Mail Picker ## Summary An unauthenticated sender can place HTML in an email’s RFC `From` display name. The decoded value reaches a sink in the bundled Attach Mail Zimlet. Its message-row renderer appends the raw name to HTML, and opening the **Attach Mail** picker from a new message in Zimbra Classic executes the stored payload while the picker automatically populates Inbox. ## Prerequisites and Scope Normal email delivery must preserve the display name. The recipient must use Classic with the `com_zimbra_attachmail` Zimlet enabled, and the message must remain in the searched folder, normally Inbox, when they open the **Attach Mail** picker from a new message in Zimbra Classic. A matching contact or gateway rewrite may replace the stored display name. ## Technical Analysis ### The MIME display name reaches the participant model In 10.1.20, `zimbrastore.jar`'s `com.zimbra.cs.service.mail.ToXML.encodeEmail()` decodes and sanitizes the personal part, then serializes it as the SOAP `p` attribute: ```java if (!StringUtil.isNullOrEmpty((String)pa.personalPart)) { pa.personalPart = ZInternetHeader.decode((String)pa.personalPart); pa.personalPart = StringUtil.sanitizeString((String)pa.personalPart); } el.addAttribute("p", pa.personalPart); // [0] decoded display name ``` At `[0]`, the server exports the attacker-controlled decoded name. XML attribute escaping protects the SOAP transport but does not encode the value for a later HTML context. The deployed Classic participant parser in `ZmMailItem.js` then constructs the address object here: ```javascript var contactList = AjxDispatcher.run("GetContacts"), contact = contactList && contactList.getContactByEmail(node.a), fullName = contact && contact.getFullNameForDisplay(false); // unless it's just the start of the email address (ZBUG-2236) if (node.p && node.a && node.a.startsWith(fullName + "@")) { fullName = node.p; } var addr = new AjxEmailAddress(node.a, type, fullName || node.p, node.d, node.isGroup, node.isGroup && node.exp); // [1] participant-model fallback ``` When the sender does not match an address-book contact, `fullName` is empty and `[1]` falls back to the attacker-controlled `node.p` display name. The Attach Mail renderer consumes the resulting `AjxEmailAddress`. #### Attach Mail executes during automatic message listing The deployed `com_zimbra_attachmail` Zimlet's `attachmail.js` registers the stock **Mail** attachment action. Its `_showTreeView()` method contains: ```javascript this._currentQuery = this._getQueryFromFolder("2"); //this.treeView.setSelected("2"); setTimeout(AjxCallback.simpleClosure(this.treeView.setSelected, this.treeView, 2), 100); // [2] Inbox selected automatically ``` At `[2]`, the dialog automatically selects Inbox. The selection listener then searches that folder: ```javascript if (ignoreEvent || ev.detail == DwtTree.ITEM_SELECTED) { var item = this.treeView.getSelected(); document.getElementById(AttachMailTabView.ELEMENT_ID_SEARCH_FIELD).value = ["in:\"", item.getSearchPath(),"\""].join(""); var query = this._getQueryFromFolder(item.id); this.executeQuery(query); // [3] message search this._tabAttachMailView.focus(); } ``` At `[3]`, the search populates the message list without a further row selection. Its row renderer builds the relevant sender row as follows: ```javascript var fragment = item.fragment ? AjxStringUtil.htmlEncode(item.fragment.slice(0, 80)) : ""; // [4] fragment encoded var from = item.getAddress("FROM"); if (from.name != "") { from = from.name; // [5] decoded display name } else { from = from.address; } // ... row setup omitted ... var subject = item.subject ? AjxStringUtil.htmlEncode(item.subject.slice(0, 32)) : ZmMsg.noSubject; // [6] subject encoded // ... subject and date row omitted ... htmlArr[idx++] = " "; htmlArr[idx++] = from; // [7] sender inserted raw htmlArr[idx++] = ""; ``` At `[4]` and `[6]`, the Zimlet HTML-encodes neighboring attacker-controlled fields. `[5]` chooses the decoded name, and `[7]` inserts it raw. Core `DwtListView.js` then receives the assembled row: ```javascript div.innerHTML = htmlArr.join(""); // [8] row parsed as HTML return div; ``` `[8]` commits the row as active HTML, so the automatic population at `[2]` and `[3]` executes the handler during the initial render. ## Exploitation PoC: [classic_attachmail_from_xss.py](../pocs/CVE-2026-137835/classic_attachmail_from_xss.py). The standalone SMTP PoC sends a conventional message with a quoted display-name payload from a fresh address at an attacker-controlled domain: ```shell python3 pocs/CVE-2026-137835/classic_attachmail_from_xss.py \ --target mail.lab.local \ --recipient victim@lab.local \ --sender fresh-attachmail@attacker.example \ --javascript 'alert(document.domain)' ``` The PoC prints the generated subject followed by: ``` [*] trigger: Classic -> New Message -> Attach -> Mail ``` After normal SMTP mail delivery: ![The crafted sender is stored in a normally delivered Inbox message](../assets/CVE-2026-137835/classic-crafted-sender-inbox.png) Opening **New Message > Attach > Mail** automatically executed the stored display name while the picker populated its Inbox rows. ![The Classic composer offers Mail in its attachment menu](../assets/CVE-2026-137835/classic-attach-mail-menu.png) ![Opening Attach Mail executes the stored sender payload](../assets/CVE-2026-137835/classic-attach-mail-xss.png) ## Impact The message does not need to be opened: rendering the Attach Mail picker is enough. The payload runs in the authenticated Classic application and can read mail, send messages, and modify mailbox state. Where the separate delegation flaw is present, the [persistent-access chain](../chains/xss_to_persistent_mailbox_access.md) can retain that access after the browser session ends. This scores [**9.3 Critical**](https://www.first.org/cvss/calculator/3.1#CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N). ## Patch Status No fixed release has been established through ZCS 10.1.22. ## Indicators of Compromise (IoCs) The [message inspector](../detections/mail_and_calendar.md#address-and-share-invitation-xss) decodes the affected MIME, address and share fields. Preserve the original message and investigate subsequent mailbox actions if execution is suspected.