ONLYOFFICE Document Server Container Compromise
High severity TLP:CLEAR Research by Rapid7 Published 18 Nov 2026
Hypothesis
An attacker with view-only document access is chaining an authorization bypass in the DocBuilder API with a native file read to forge credentials and escalate to root via a maintenance script.
Brief
Why now
Rapid7 recently detailed a vulnerability chain in ONLYOFFICE Docs (https://www.rapid7.com/blog/post/ve-from-view-only-access-to-container-root-five-vulnerabilities-in-onlyoffice-docs-fixed) that permits complete container takeover. An attacker starts with simple view-only access to a document and finishes as root. This hunt provides a technical path to identify this exploitation in your document infrastructure.
How the hunt flows
The hunt begins by scoping the environment for ONLYOFFICE Document Server installations. The first phase uses the hb_software_inventory surface to find packages older than version 10.0. This restricts the investigation to vulnerable hosts and reduces noise from patched systems. We focus on packages like onlyoffice-documentserver because the vulnerability resides in the core document handling logic. Since ONLYOFFICE is frequently integrated into suites like Zimbra or Nextcloud, we recommend running this across any Linux host facilitating document previews.
After scoping, the hunt moves to web and file telemetry. It identifies rare requests to the /docbuilder endpoint containing JWT tokens in the url_query using hb_http_activity. In parallel, it monitors for unauthorized access to sensitive configuration files like local.json via hb_file_activity. If an attacker reads local.json, they obtain the signing keys required to forge administrative tokens. The hunt identifies when ONLYOFFICE processes or the service account touch these files, or system files like /etc/passwd.
The third phase examines the behavior of the ds service account using hb_process_activity. This account runs the application and should not typically execute interactive shells or network utilities. The hunt flags any instances of the ds user spawning bash, python, or curl. This activity suggests the attacker has moved from builder API interaction to active code execution.
The final phase looks for the privilege escalation attempt in hb_process_activity. The documentserver-flush-cache.sh script is a sudo helper that runs without a password. An attacker can inject commands into the --hash parameter, which the script passes to the sed utility. By using the sed e flag, the attacker executes arbitrary shell commands as root. The hunt specifically identifies this pattern in process command lines using the flush-cache script.
Blind spots
This hunt has two main visibility gaps. If the endpoint agent lacks visibility into container namespaces, the process-level activity by the ds user and the root helper will not appear in the telemetry. Additionally, most environments do not log HTTP POST bodies. Because the specific DocBuilder scripts are passed in these bodies, the hunt relies on URL-based tokens and subsequent file activity to infer the nature of the request.
Steps
-
Query, scoping
Identify vulnerable ONLYOFFICE instances
Locate hosts running versions of ONLYOFFICE Document Server prior to the 10.0 fix to prioritize investigation.
sql, reads hb_software_inventorySELECT device_hostname, package_name, package_version, install_pathFROM hb_software_inventoryWHERE instr(',' || '{{onlyoffice_packages}}' || ',', ',' || LOWER(package_name) || ',') > 0 AND (CAST(SUBSTR(package_version, 1, INSTR(package_version, '.') - 1) AS INTEGER) < 10 OR package_version LIKE '9.%')What a hit looks like. A list of hosts running vulnerable Document Server versions. Silence suggests the estate is patched or ONLYOFFICE is not present.
-
Query, baseline
DocBuilder endpoint access baseline
Identify potential authorization bypass attempts where view-only tokens are used against the /docbuilder endpoint, highlighting rare query patterns.
sql, reads hb_http_activitySELECT url_query, COUNT(DISTINCT device_hostname) AS host_count, COUNT(*) AS request_count, MIN(time) AS first_seenFROM hb_http_activityWHERE (LOWER(url_path) LIKE '%/docbuilder%' OR LOWER(url_path) LIKE '%/docbuilder/%') AND instr(url_query, 'token=') > 0 AND ('{{scope_hosts}}' = '' OR instr(',' || '{{scope_hosts}}' || ',', ',' || device_hostname || ',') > 0) AND time >= datetime('now', '-{{lookback_days}} days')GROUP BY url_queryHAVING host_count < 5ORDER BY host_count ASCWhat a hit looks like. A rare URL query parameter containing a token used against the DocBuilder endpoint. Common tokens used by automated integrations should be filtered by the host count threshold.
-
Query, enrichment
Sensitive file touches by DocumentServer
Detect the exploitation of GetFontBinary or ZipFileAsString to read configuration files or passwords.
sql, reads hb_file_activitySELECT device_hostname, file_path, actor_user_name, process_name, timeFROM hb_file_activityWHERE instr(',' || '{{sensitive_files}}' || ',', ',' || LOWER(file_path) || ',') > 0 AND ('{{scope_hosts}}' = '' OR instr(',' || '{{scope_hosts}}' || ',', ',' || device_hostname || ',') > 0) AND time >= datetime('now', '-{{lookback_days}} days')What a hit looks like. Access to local.json or system files by ONLYOFFICE processes or the service account. This indicates the attacker is exfiltrating signing keys or user data via the native file read vulnerability.
-
Agent triage
Triage early access evidence
Synthesize the web access patterns and file system events to identify hosts likely undergoing credential theft.
-
Query, triage
Suspicious processes under 'ds' account
Monitor the DocumentServer service account for unexpected shell usage or command execution following RCE.
sql, reads hb_process_activitySELECT device_hostname, user_name, process_name, process_cmd_line, timeFROM hb_process_activityWHERE user_name = 'ds' AND (LOWER(process_name) IN ('sh', 'bash', 'python', 'python3', 'curl', 'wget', 'nc', 'sed')) AND ('{{scope_hosts}}' = '' OR instr(',' || '{{scope_hosts}}' || ',', ',' || device_hostname || ',') > 0) AND time >= datetime('now', '-{{lookback_days}} days')What a hit looks like. Interactive shells or network utilities run by the 'ds' user, which is a service account that should only run application binaries. This indicates post-exploitation activity.
-
Query, detection candidate
Root escalation via maintenance helper
Detect the use of the passwordless documentserver-flush-cache.sh sudo helper to execute arbitrary root commands via sed injection.
sql, reads hb_process_activitySELECT device_hostname, user_name, process_name, process_cmd_line, timeFROM hb_process_activityWHERE LOWER(process_cmd_line) LIKE '%documentserver-flush-cache.sh%' AND LOWER(process_cmd_line) LIKE '%--hash%' AND ('{{scope_hosts}}' = '' OR instr(',' || '{{scope_hosts}}' || ',', ',' || device_hostname || ',') > 0) AND time >= datetime('now', '-{{lookback_days}} days')What a hit looks like. Execution of the flush-cache script with a crafted --hash parameter. This is a high-confidence indicator of a root escalation attempt using the sed e flag injection.
-
Agent triage
Triage full compromise chain
Merge the early access and credential theft evidence with the later execution and escalation data to confirm a container-root compromise.
-
Decision
Route based on compromise verdict
Route the hunt to immediate response for confirmed compromises or to an analyst for review in suspicious cases.
-
Response action
Isolate compromised host
Prevent lateral movement and further exfiltration from a root-compromised container environment.
-
Analyst task
Analyst confirmation
Review evidence for unconfirmed findings to identify novel exploitation methods or novel indicators.
-
Analyst task
Close out
Finalize the hunt and record negative results if none were found.
Coverage
4 of 4 stages covered
| Stage and ATT&CK technique | Covered | How, or why not |
|---|---|---|
| DocBuilder Authorization Bypass T1190 |
Yes | docbuilder-access-baseline |
| Native File Read and Token Forgery T1552.001 |
Yes | sensitive-file-touches |
| DocBuilder Parameter Injection T1203 T1059.004 |
Yes | ds-user-suspicious-processes |
| Root Escalation via Maintenance Helper T1548.003 |
Yes | root-helper-command-injection |
Blind spots
- Needs Endpoint agent with full container runtime and namespace visibility. If the agent cannot see into container namespaces, activity by the 'ds' user and shell execution will be invisible, leading to false negatives. It would answer: Are processes inside the ONLYOFFICE container visible to the host EDR?
- Needs hb_http_activity with captured POST request bodies. Without POST bodies, the hunt relies on URL-based tokens and subsequent file-touch patterns, which may be harder to correlate in high-traffic environments. It would answer: Which specific DocBuilder script (e.g. GetFontBinary) was passed in the POST body?
Parameters and data
Parameters
| Parameter | Type | Default | What it is |
|---|---|---|---|
lookback_days | number | 14 | Days of historical telemetry to examine for exploit indicators. |
onlyoffice_packages | list[string] | onlyoffice-documentserver, onlyoffice-documentserver-ee, onlyoffice-documentserver-de | Package names for ONLYOFFICE Document Server products to scope the hunt. |
scope_hosts | list[host] | none | Narrow the hunt to specific hosts; leave empty to scan the estate. |
sensitive_files | list[path] | /etc/onlyoffice/documentserver/local.json, /etc/passwd, /etc/shadow, /var/www/onlyoffice/documentserver/server/local.json | Sensitive server files targeted for credential theft and JWT signing key access. |
Data sources
| Source | Category | Telemetry |
|---|---|---|
| Endpoint telemetry (hb_ surfaces) | endpoint | endpoint |
| Web server / proxy logs | siem | network |
Source
An open hunt.md file. It runs anywhere that reads the format.
---
analysis: A single detection rule for 'ds' user activity or the maintenance helper
might fire during normal administrative work. This hunt durably links web-based
auth bypass signals with sensitive config file access and specific command injection
patterns, providing the necessary context to distinguish container takeover from
maintenance.
blind_spots:
- id: container-visibility-gap
question: Are processes inside the ONLYOFFICE container visible to the host EDR?
requires: Endpoint agent with full container runtime and namespace visibility
risk: If the agent cannot see into container namespaces, activity by the 'ds' user
and shell execution will be invisible, leading to false negatives.
stage: execution-parameter-injection
- id: no-http-post-bodies
question: Which specific DocBuilder script (e.g. GetFontBinary) was passed in the
POST body?
requires: hb_http_activity with captured POST request bodies
risk: Without POST bodies, the hunt relies on URL-based tokens and subsequent file-touch
patterns, which may be harder to correlate in high-traffic environments.
stage: initial-access-docbuilder
coverage:
- stage: initial-access-docbuilder
status: covered
steps:
- docbuilder-access-baseline
- stage: credential-theft-file-read
status: covered
steps:
- sensitive-file-touches
- stage: execution-parameter-injection
status: covered
steps:
- ds-user-suspicious-processes
- stage: privilege-escalation-root-helper
status: covered
steps:
- root-helper-command-injection
guardrails:
claims: no_unsupported
evidence: citation_required
missing_data: not_benign
telemetry: untrusted
hunt:
applicability: campaign-specific
handoff: promote-to-detection
justification: Exploiting ONLYOFFICE provides a direct path to sensitive corporate
documents and root access within the hosting container. A negative result confirms
that the document infrastructure is not currently undergoing active exploitation
via these chained vulnerabilities.
methodology: model-assisted
trigger: intel-report
hypothesis: An attacker with view-only document access is chaining an authorization
bypass in the DocBuilder API with a native file read to forge credentials and escalate
to root via a maintenance script.
labels:
- hunt
- attack.t1190
- attack.t1552.001
- attack.t1203
- attack.t1059.004
- attack.t1548.003
- credential access
- execution
- initial access
- privilege escalation
name: ONLYOFFICE Document Server Container Compromise
parameters:
lookback_days:
default: '14'
description: Days of historical telemetry to examine for exploit indicators.
from:
kind: manual
observed: '2026-11-16'
ref: default
type: number
onlyoffice_packages:
default:
- onlyoffice-documentserver
- onlyoffice-documentserver-ee
- onlyoffice-documentserver-de
description: Package names for ONLYOFFICE Document Server products to scope the
hunt.
from:
kind: article
observed: '2026-11-16'
ref: rapid7
type: list[string]
scope_hosts:
default: []
description: Narrow the hunt to specific hosts; leave empty to scan the estate.
from:
kind: manual
observed: '2026-11-16'
ref: default
type: list[host]
sensitive_files:
default:
- /etc/onlyoffice/documentserver/local.json
- /etc/passwd
- /etc/shadow
- /var/www/onlyoffice/documentserver/server/local.json
description: Sensitive server files targeted for credential theft and JWT signing
key access.
from:
kind: article
observed: '2026-11-16'
ref: rapid7
type: list[path]
provenance:
authors:
- name: Huntbase hunt generation
org: huntbase.io
generated:
by: huntbase-hunt-generation
from: https://www.rapid7.com/blog/post/ve-from-view-only-access-to-container-root-five-vulnerabilities-in-onlyoffice-docs-fixed
gates:
- dry-run
- lint
- critic
model: hb_google/gemini-3-flash-preview
rationale: Start with Linux servers hosting Docker containers, focusing on those running
ONLYOFFICE Document Server (often integrated with Zimbra). Use the software inventory
results to narrow subsequent queries to affected hosts.
references:
- name: "Rapid7 \u2014 From view-only access to container root: five vulnerabilities\
\ in ONLYOFFICE Docs (FIXED)"
url: https://www.rapid7.com/blog/post/ve-from-view-only-access-to-container-root-five-vulnerabilities-in-onlyoffice-docs-fixed
related:
- hunt: zimbra-cve-2024-45519-exploitation
reason: Since ONLYOFFICE is often integrated with Zimbra, a compromised Zimbra instance
may be the source of the view-only Editor JWTs used in this DocBuilder chain.
relation: sibling
scenario:
stages:
- name: DocBuilder Authorization Bypass
observables:
- POST to /docbuilder
- view-only Editor JWT in url_query token parameter
- WOPI_ENABLED=true environment
slug: initial-access-docbuilder
tactic: initial-access
techniques:
- T1190
- name: Native File Read and Token Forgery
observables:
- native.GetFontBinary script usage
- native.ZipFileAsString script usage
- /etc/onlyoffice/documentserver/local.json
- services.CoAuthoring.secret.session.string
slug: credential-theft-file-read
tactic: credential-access
techniques:
- T1552.001
- name: DocBuilder Parameter Injection
observables:
- builder.SaveFile with duplicate m_sFileTo element
- path traversal to write outside job directory
- execution as ds service account
slug: execution-parameter-injection
tactic: execution
techniques:
- T1203
- T1059.004
- name: Root Escalation via Maintenance Helper
observables:
- sudo documentserver-flush-cache.sh
- crafted --hash argument with sed injection
- sed execution with e flag
- process execution as root
slug: privilege-escalation-root-helper
tactic: privilege-escalation
techniques:
- T1548.003
summary: Attackers chain multiple vulnerabilities in ONLYOFFICE Docs to escalate
from view-only document access to root command execution within the DocumentServer
container. The chain involves bypassing JWT authorization for the DocBuilder API,
reading sensitive configuration files to forge high-privilege tokens, and abusing
a sudo-permitted maintenance script to elevate privileges.
severity: high
targets:
analyst:
name: Tier-2 analyst
role: analyst
endpoint:
category: endpoint
name: Endpoint telemetry (hb_ surfaces)
telemetry:
- endpoint
hunter:
agent: true
name: Hunt agent
web:
category: siem
name: Web server / proxy logs
telemetry:
- network
tlp: clear
type: investigation
---
# ONLYOFFICE Document Server Container Compromise
This hunt identifies exploitation of a multi-stage chain in ONLYOFFICE Document Server (vulnerable before v10.0). It starts by scoping the environment for vulnerable versions, then looks for suspicious access to the DocBuilder endpoint and sensitive configuration files like local.json. The hunt then pivots to find evidence of command execution by the 'ds' service account and privilege escalation through the documentserver-flush-cache.sh sudo helper, which allows root execution via sed injection. This phased approach links initial access, credential theft, and terminal compromise into a single investigator read.
## vulnerable-onlyoffice-instances
<!-- Identify vulnerable ONLYOFFICE instances -->
Locate hosts running versions of ONLYOFFICE Document Server prior to the 10.0 fix to prioritize investigation.
```sqlite target=endpoint role=scoping params=(onlyoffice_packages=onlyoffice_packages)
~~~yaml
expected: A list of hosts running vulnerable Document Server versions. Silence suggests
the estate is patched or ONLYOFFICE is not present.
reads:
- device_hostname
- package_name
- package_version
- install_path
silence: not_evidence_of_absence
source: hb_software_inventory
verified: dry-run
verified_at: '2026-11-18'
~~~
SELECT device_hostname, package_name, package_version, install_path FROM hb_software_inventory WHERE instr(',' || '{{onlyoffice_packages}}' || ',', ',' || LOWER(package_name) || ',') > 0 AND (CAST(SUBSTR(package_version, 1, INSTR(package_version, '.') - 1) AS INTEGER) < 10 OR package_version LIKE '9.%')
```
## early-stage-activity
<!-- Initial access and credential access activity -->
parallel:
- → docbuilder-access-baseline
- → sensitive-file-touches
join: → triage-early-access
## docbuilder-access-baseline
<!-- DocBuilder endpoint access baseline -->
Identify potential authorization bypass attempts where view-only tokens are used against the /docbuilder endpoint, highlighting rare query patterns.
```sqlite target=web role=baseline params=(lookback_days=lookback_days, scope_hosts=scope_hosts)
~~~yaml
baseline:
compare: first_seen
window: '{{lookback_days}}d'
expected: A rare URL query parameter containing a token used against the DocBuilder
endpoint. Common tokens used by automated integrations should be filtered by the
host count threshold.
prevalence:
by: device_hostname
key:
- url_query
rare_below: 5
reads:
- url_path
- url_query
- device_hostname
- time
silence: not_evidence_of_absence
source: hb_http_activity
verified: dry-run
verified_at: '2026-11-18'
~~~
SELECT url_query, COUNT(DISTINCT device_hostname) AS host_count, COUNT(*) AS request_count, MIN(time) AS first_seen FROM hb_http_activity WHERE (LOWER(url_path) LIKE '%/docbuilder%' OR LOWER(url_path) LIKE '%/docbuilder/%') AND instr(url_query, 'token=') > 0 AND ('{{scope_hosts}}' = '' OR instr(',' || '{{scope_hosts}}' || ',', ',' || device_hostname || ',') > 0) AND time >= datetime('now', '-{{lookback_days}} days') GROUP BY url_query HAVING host_count < 5 ORDER BY host_count ASC
```
## sensitive-file-touches
<!-- Sensitive file touches by DocumentServer -->
Detect the exploitation of GetFontBinary or ZipFileAsString to read configuration files or passwords.
```sqlite target=endpoint role=enrichment params=(lookback_days=lookback_days, sensitive_files=sensitive_files, scope_hosts=scope_hosts)
~~~yaml
expected: Access to local.json or system files by ONLYOFFICE processes or the service
account. This indicates the attacker is exfiltrating signing keys or user data via
the native file read vulnerability.
reads:
- device_hostname
- file_path
- actor_user_name
- process_name
- time
silence: not_evidence_of_absence
source: hb_file_activity
verified: dry-run
verified_at: '2026-11-18'
~~~
SELECT device_hostname, file_path, actor_user_name, process_name, time FROM hb_file_activity WHERE instr(',' || '{{sensitive_files}}' || ',', ',' || LOWER(file_path) || ',') > 0 AND ('{{scope_hosts}}' = '' OR instr(',' || '{{scope_hosts}}' || ',', ',' || device_hostname || ',') > 0) AND time >= datetime('now', '-{{lookback_days}} days')
```
## triage-early-access
<!-- Triage early access evidence -->
```agent target=hunter
cite: required
context:
- vulnerable-onlyoffice-instances
- docbuilder-access-baseline
- sensitive-file-touches
max_iterations: 3
objective: Identify hosts where rare DocBuilder URL queries are accompanied by unauthorized
touches on sensitive server configuration files.
success_criteria: A list of suspicious hosts with cited evidence of early-stage exploitation.
tools:
- endpoint
- web
```
## follow-on-activity
<!-- Execution and escalation activity -->
parallel:
- → ds-user-suspicious-processes
- → root-helper-command-injection
join: → triage-full-chain
## ds-user-suspicious-processes
<!-- Suspicious processes under 'ds' account -->
Monitor the DocumentServer service account for unexpected shell usage or command execution following RCE.
```sqlite target=endpoint role=triage params=(lookback_days=lookback_days, scope_hosts=scope_hosts)
~~~yaml
expected: Interactive shells or network utilities run by the 'ds' user, which is a
service account that should only run application binaries. This indicates post-exploitation
activity.
reads:
- device_hostname
- user_name
- process_name
- process_cmd_line
- time
silence: not_evidence_of_absence
source: hb_process_activity
verified: dry-run
verified_at: '2026-11-18'
~~~
SELECT device_hostname, user_name, process_name, process_cmd_line, time FROM hb_process_activity WHERE user_name = 'ds' AND (LOWER(process_name) IN ('sh', 'bash', 'python', 'python3', 'curl', 'wget', 'nc', 'sed')) AND ('{{scope_hosts}}' = '' OR instr(',' || '{{scope_hosts}}' || ',', ',' || device_hostname || ',') > 0) AND time >= datetime('now', '-{{lookback_days}} days')
```
## root-helper-command-injection
<!-- Root escalation via maintenance helper -->
Detect the use of the passwordless documentserver-flush-cache.sh sudo helper to execute arbitrary root commands via sed injection.
```sqlite target=endpoint role=detection-candidate params=(lookback_days=lookback_days, scope_hosts=scope_hosts)
~~~yaml
expected: Execution of the flush-cache script with a crafted --hash parameter. This
is a high-confidence indicator of a root escalation attempt using the sed e flag
injection.
reads:
- device_hostname
- user_name
- process_name
- process_cmd_line
- time
silence: not_evidence_of_absence
source: hb_process_activity
verified: dry-run
verified_at: '2026-11-18'
~~~
SELECT device_hostname, user_name, process_name, process_cmd_line, time FROM hb_process_activity WHERE LOWER(process_cmd_line) LIKE '%documentserver-flush-cache.sh%' AND LOWER(process_cmd_line) LIKE '%--hash%' AND ('{{scope_hosts}}' = '' OR instr(',' || '{{scope_hosts}}' || ',', ',' || device_hostname || ',') > 0) AND time >= datetime('now', '-{{lookback_days}} days')
```
## triage-full-chain
<!-- Triage full compromise chain -->
```agent target=hunter
cite: required
context:
- triage-early-access
- ds-user-suspicious-processes
- root-helper-command-injection
max_iterations: 5
objective: Determine if any host shows the complete progression from DocBuilder access
and config file reads (from triage-early-access) to shell execution and root escalation.
success_criteria: A final verdict of compromised | suspicious | benign per host, citing
sequential evidence across all queried surfaces.
tools:
- endpoint
- web
```
## route-on-verdict
<!-- Route based on compromise verdict -->
if~: "The final verdict from triage-full-chain is 'compromised' for any host." (confidence: high, judge=hunter)
then: → isolate-host
indeterminate: → analyst-confirmation
unavailable: → analyst-confirmation (blind_spot: container-visibility-gap)
else: → close-out
## isolate-host
<!-- Isolate compromised host -->
```action target=endpoint
~~~yaml
approval: required
~~~
Isolate the host immediately. Terminate all ONLYOFFICE Docker containers and preserve the container images and local volumes for forensic analysis. Collect the local.json file to check for signing key rotation.
```
→ analyst-confirmation
## analyst-confirmation
<!-- Analyst confirmation -->
```manual target=analyst
Examine the process cmd_line for the 'root-helper-command-injection' step. Specifically look for sed injection patterns like 'e exec' or 'sed e'. Validate if 'ds' user shell activity matches any known administrative maintenance windows.
```
→ close-out
## close-out
<!-- Close out -->
```manual target=analyst
Document the hosts examined and record any identified vulnerable Document Server instances for patching. If no compromise was found, archive as a negative result.
```
→ end
Run this hunt against your own data.
In Huntbase, Scout runs every step across the tools you already connect, checks back through your history and returns a verdict with the evidence. The hunt.md file is open, so you can also take it anywhere that reads the format.
Drafted by machine (huntbase-hunt-generation, hb_google/gemini-3-flash-preview), checked by dry-run, lint, critic, then reviewed by a person.