Skip to content
RCE Write-up Advanced

CVE-2021-43444 to 43449: Exploiting ONLYOFFICE Web Sockets for Unauthenticated Remote Code Execution

The ONLYOFFICE document server accepted unauthenticated WebSocket connections and used weak default signing keys, so an attacker who knew a document identifier could download documents, inject macros and trigger server-side requests. By abusing a path traversal flaw in the document converter, an attacker could write a malicious library and gain remote code execution on the server.

Iain Wallace Follow

Published on labs.nettitude.com

About 18 months ago, I was conducting a pentest of a document management platform. It was designed with the goal of providing a secure document storage and sharing solution for some high impact use cases.

Iain Wallace (@strawp), on labs.nettitude.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 a combination of missing authentication on the WebSocket endpoint, weak default signing keys, and a path traversal flaw in the document converter's zip extraction.

Impact

An attacker could read documents, run commands on the document server and potentially pivot into the wider network, though the text notes that protections exist but are not enabled by default.

What the attacker needed

Network access to the document server; a known document identifier; default keys left unchanged

The fix

It was fixed in version 7.2; failing that, enable JWT signing with a strong random key, set a strong download URL signing key, disable the macros and chat plugins, restrict the server's network access and limit where the web user can write.

How it was found

  1. Connect to the WebSocket without authentication
  2. Request that the server downloads and converts a document that we host
  3. The document writes a Linux binary into a known path using path traversal
  4. The binary is loaded and executed, installing a backdoor into the document converter
  5. Calls to the document converter containing the right keywords and arguments are then executed as system commands

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.

A WebSocket is a two-way connection a web page keeps open with a server. ONLYOFFICE let anyone open that connection without logging in, and it also shipped with guessable default passwords for signing links and messages. Because the document converter unpacked uploaded files carelessly, an attacker could drop a file outside the intended folder and get their own code to run on the server.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

More from OnlyOffice

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.