--- 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++] = "