--- cve: CVE-2026-93646 cna: Rapid7 credit: Jonah Burgess (Rapid7) severity: "Critical (Rapid7)" cvss_v3_1: "9.8 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H" cwe: CWE-863 confirmed_vulnerable: ZCS 10.1.16 and 10.1.20 Network Edition; OnlyOffice 7.2.1 build 0; x86-64 affected_versions: ZCS 10.1.16 through 10.1.20 when OnlyOffice/Document Editing is enabled; exact introduced release unknown fixed_versions: ZCS 10.1.21 for the public `/zdocument` route --- # CVE-2026-93646: Editor JWT Accepted by OnlyOffice DocBuilder Enables NativeZip RCE ## Summary Zimbra exposes the OnlyOffice DocBuilder service through public HTTPS. An ordinary mailbox user can obtain a signed editor JWT by opening a supported document in their own Briefcase. An anonymous visitor can obtain a guest editor JWT by opening an existing supported public document. Either token is accepted by `/docbuilder`, which then executes an arbitrary attacker-supplied DocBuilder script. The exposed script API includes `CreateNativeZip()`, which reads, writes and deletes files using `zimbra`'s operating-system permissions. On the stock x86-64 installation, an attacker can plant a previously absent `libpthread.so.0` beside OnlyOffice's `x2t` converter. Calling `builderJS.SaveFile()` starts that converter with its executable directory at the front of the library search path, loading the planted library and executing an arbitrary command as `zimbra`. ## Prerequisites and Scope OnlyOffice/Document Editing and the public `/zdocument` proxy must be enabled. The anonymous route needs an existing supported public Briefcase document and either its public locator or its exact owner mailbox and a discoverable item ID. The ordinary-user route needs only a normal mailbox account. Direct access to OnlyOffice port 7084, a victim password, the JWT secret and victim interaction are not required. The demonstrated command-execution path uses the bundled ZCS 10.1.20 x86-64 converter layout. It reaches the `zimbra` service account, not root. Any transition to root is a separate local vulnerability. ## Technical Analysis ### Zimbra editor tokens do not identify an allowed operation `DocumentServlet.java` creates an editor JWT after a user or guest opens an accessible document: ```java private String encodeJwtToken(OnlyOfficeConfig config) { String secret = this.getDocServerExtension().getJwtSecret(); SecretKeySpec key = new SecretKeySpec(secret.getBytes(), SignatureAlgorithm.HS256.getJcaName()); JwtBuilder builder = Jwts.builder(); builder.claim("type", (Object)config.type); // [0] editor-session claims builder.claim("documentType", (Object)config.documentType); builder.claim("document", (Object)config.document); builder.claim("editorConfig", (Object)config.editorConfig); return builder.signWith(SignatureAlgorithm.HS256, (Key)key).compact(); // [1] token signed } ``` The claims at `[0]` describe an editor session and its document. The signing call at `[1]` does not add an audience, route, purpose, capability, issue time or expiry. OnlyOffice 7.2.1 uses the same secret for browser and inbox request tokens in `server/Common/sources/tenantManager.js`: ```javascript // ... secret-selection function setup omitted ... switch (type) { case commonDefines.c_oAscSecretType.Browser: case commonDefines.c_oAscSecretType.Inbox: res = utils.getSecretByElem(cfgSecretInbox); // [2] shared browser/inbox key break; // ... Outbox and Session cases omitted ... } // ... remaining function omitted ... ``` The shared mapping at `[2]` allows a Zimbra editor token to verify as an inbox request token. OnlyOffice's generic request parser treats successful signature verification as sufficient authorization: ```javascript if (res.params.token) { checkJwtRes = yield checkJwt(ctx, res.params.token, commonDefines.c_oAscSecretType.Inbox); // [3] editor JWT verified } else { checkJwtRes = yield checkJwtHeader(ctx, req); } if (checkJwtRes) { if (checkJwtRes.decoded) { res.code = constants.NO_ERROR; // [4] request authorized if (cfgTokenRequiredParams) { res.params = {}; } Object.assign(res.params, checkJwtRes.decoded); // ... remaining assignments and closing braces omitted ... ``` `[3]` proves only that the shared secret signed the token. The success result at `[4]` does not check whether the token was issued for DocBuilder. ### The public DocBuilder handler accepts the attacker's script The `/docbuilder` handler sends query parameters to that generic parser: ```javascript // ... DocBuilder handler setup omitted ... if (!utils.isEmptyObject(req.query)) { //todo this is a stub for compatibility. remove in future version authRes = yield docsCoServer.getRequestParams(ctx, req, true); // [5] query token checked } else { authRes = yield docsCoServer.getRequestParams(ctx, req); } // ... remaining handler omitted ... ``` After `[5]` returns the decoded editor token, the handler creates a builder task and stores the complete request body as its script: ```javascript // ... authorization and parameter handling omitted ... if (error === constants.NO_ERROR && (params.key || params.url || (req.body && Buffer.isBuffer(req.body) && req.body.length > 0))) { let cmd = new commonDefines.InputCommand(); cmd.setCommand('builder'); cmd.setIsBuilder(true); cmd.setWithAuthorization(true); cmd.setDocId(docId); if (!docId) { // ... random builder-task key setup omitted ... if (params.url) { cmd.setUrl(params.url); cmd.setFormat('docbuilder'); } else { yield storageBase.putObject(ctx, docId + '/script.docbuilder', req.body, req.body.length); // [6] body stored as script } // ... task submission and closing braces omitted ... ``` At `[6]`, the attacker-controlled body becomes a trusted DocBuilder program. There is no requirement that its operations relate to the document named by the token. The proxy exposes this handler through its catch-all `/zdocument//` location. Before 10.1.21, only the `info` and `internal` paths received explicit loopback restrictions. ### `CreateNativeZip()` exposes host files OnlyOffice registers the native ZIP object in `Default.h`: ```c CZipEmbed::CreateObjectInContext("CreateNativeZip", context); // [7] native ZIP API exposed ``` At `[7]`, the DocBuilder runtime exposes the native ZIP object to the attacker-controlled script. Its `open()` string branch selects a directory from the host filesystem: ```c // ... argument validation and earlier branches omitted ... else if (typedArray_or_Folder->isString()) { m_pFolder = new CFolderSystem(typedArray_or_Folder->toStringW()); // [8] attacker directory } // ... remaining method omitted ... ``` The same object writes an attacker-supplied byte array beneath that directory: ```c JSSmart CZipEmbed::addFile(JSSmart filePath, JSSmart typedArray) { if (!m_pFolder || !filePath->isString() || !typedArray->isTypedArray()) return CJSContext::createBool(false); JSSmart typedArray2 = typedArray->toTypedArray(); CJSDataBuffer buffer = typedArray2->getData(); m_pFolder->write(filePath->toStringW(), buffer.Data, (DWORD)buffer.Len); // [9] attacker bytes written // ... return and closing brace omitted ... ``` At `[8]`, the script selects the host directory; `[9]` writes the selected bytes. Adjacent `getFile()` and `removeFile()` methods provide reads and deletion. These operations use `zimbra`'s normal filesystem permissions. ### `SaveFile()` loads a planted origin library The tested converter layout was: ```text /opt/zimbra/onlyoffice/documentserver/server/FileConverter/bin zimbra:zimbra 0755 x2t DT_NEEDED: libpthread.so.0 x2t DT_RPATH: $ORIGIN:$ORIGIN/system origin libpthread.so.0: absent ``` DocBuilder starts `x2t` with that directory at the front of its runtime library search path: ```c std::wstring sConverterExe = m_sX2tPath + L"/x2t"; // [10] converter path // ... parameter-file creation, platform branch, fork, and child-process setup omitted ... if (std::string::npos != sProgramm.find_last_of('/')) { sLibraryDir = "LD_LIBRARY_PATH=" + sProgramm.substr(0, sProgramm.find_last_of('/')); // [11] origin first sPATH = "PATH=" + sProgramm.substr(0, sProgramm.find_last_of('/')); } // ... argv and environment setup omitted ... execve(sProgramm.c_str(), (char * const *)nargs, (char * const *)nenv); // [12] converter executed // ... child error handling and remaining method omitted ... ``` The exploit opens the directory from `[10]`, writes an ABI-compatible `libpthread.so.0`, and calls `builderJS.SaveFile()`. The environment at `[11]` and process start at `[12]` load the planted library before a system copy. Its constructor runs as `zimbra`. This creates a previously absent file; it does not replace the converter or an installed library, and the new file does not need its executable bit set. ## Exploitation The public request has this form: ```http POST /zdocument//docbuilder?token= HTTP/1.1 Host: mail.lab.local Content-Type: application/octet-stream Content-Length: