Skip to content
Access control Write-up Advanced

From view-only access to container root: five vulnerabilities in ONLYOFFICE Docs (FIXED)

A view-only user could reuse their Editor JWT at the /docbuilder endpoint because Browser and Inbox tokens shared the same signing key, allowing native file reads and theft of the Session JWT signing key. A second flaw let DocBuilder conversion parameters be injected, enabling arbitrary file writes and code execution as the ds user inside the container.

Jonah Burgess Follow

Published on rapid7.com

From view-only access to container root: five vulnerabilities in ONLYOFFICE Docs (FIXED)

Rapid7, on rapid7.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the DocBuilder request handler validated tokens with the Inbox key, which was the same as the Browser key, so a view-only Editor JWT was accepted without checking it was issued for DocBuilder.

Impact

An attacker with view-only access could read any file readable by the ds user, including the Session JWT signing key, and forge credentials with permissions never granted; the demonstrated unauthorized save accounts for the low integrity impact.

What the attacker needed

View-only access to any document; a valid Editor JWT; access to /docbuilder; target files readable by ds

How it was found

  1. Obtain a valid Editor JWT for view-only access to any document.
  2. Send a POST request to /docbuilder with that token and a DocBuilder script in the body.
  3. Use the script to call GetFontBinary() with an absolute path to read a server file.
  4. Read the local.json configuration file to recover the Session JWT signing key.
  5. Forge a Session JWT with chosen document key and permissions using the stolen key.
  6. Submit a save request with the forged JWT and observe the server accepts it.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

ONLYOFFICE Docs is a web app for viewing and editing documents. It uses signed tokens (JWTs) to prove who you are and what you may do. A person who was only allowed to look at a document could send their token to a different feature that builds documents, and that feature accepted it because it used the same secret key. That let them read server files and then write files that the server later ran as code.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.