CVE-2026-104007: LibreOffice Code Execution Through a Pivot Table -- JDBC Driver Loading From Untrusted ODB
The advisory
The Document Foundation published a security advisory for CVE-2026-104007 on November 16, 2026. The advisory describes code execution through JDBC driver loading when a user opens a crafted document. CVSS 4.0: 8.5 High. Affected: LibreOffice 26.2 through 26.2.6 and 26.8 through 26.8.1. The fix shipped in 26.2.7 and 26.8.2.
The advisory is sparse on details, but the CWE (CWE-829, Inclusion of Functionality from Untrusted Control Sphere) and the mention of JDBC drivers told me where to look. There is a related CVE – CVE-2026-63277 – that describes the same underlying problem (remote code execution through JDBC driver loading) but via a different route: calcext:data-mappings and an SQL provider. That one was fixed in 26.2.5. CVE-2026-104007 is a new route to the same driver-loading code, through pivot tables. No public proof of concept existed for this route.
I built a full attack chain from a crafted ODS spreadsheet to arbitrary Java code execution inside the LibreOffice JVM, confirmed it on 26.2.6.3, and verified the fix blocks it on 26.2.7.2.
PoC, detection rules, and live pcap: al4n4n/achilles-heel/CVE-2026-104007
How LibreOffice loads JDBC drivers
LibreOffice can connect to databases through Java JDBC drivers. The connection settings live in ODB files – OpenDocument Database documents – which are ZIP archives containing XML metadata. Among other things, an ODB’s db:driver-settings element names the JDBC driver class and the classpath to load it from:
1 | <db:driver-settings> |
In normal use, the driver classpath comes from the user’s own LibreOffice JDBC driver configuration, which the user sets up manually. The ODB file is trusted because the user created it. But what happens when LibreOffice opens an ODB it did not create, one that specifies a classpath the user never configured?
Before 26.2.7, LibreOffice uses the classpath from the ODB itself. It loads the named Java class from the path the ODB specifies, and if that class has a static initializer, it runs in the LibreOffice JVM process. The document controls what code the application loads.
The pivot table route
LibreOffice spreadsheets (ODS files) support pivot tables, which LibreOffice calls “data pilots.” A pivot table can be backed by a database source, specified in the ODS content XML:
1 | <table:data-pilot-table table:name="Pivot1" ...> |
The key detail: table:database-name can be a URL. When the pivot table refreshes, LibreOffice resolves that URL and fetches the ODB. In affected versions, this fetch happens without a link-update consent dialog. The user opens the spreadsheet, the pivot table tries to refresh, and LibreOffice silently downloads the ODB from wherever the attacker pointed it.
This is the route CVE-2026-104007 takes. The related CVE-2026-63277 reached the same driver-loading code through calcext:data-mappings and was fixed in 26.2.5, but the pivot table path remained open until 26.2.7.
The attack chain
The chain has five links. I built each one:
Crafted ODS. A minimal ODS spreadsheet with a pivot table whose
table:database-source-sqlelement names an HTTP URL as the database. The spreadsheet does nothing else – no macros, no other active content. The pivot table is the entire attack surface.HTTP-served ODB. A Python HTTP server on loopback port 9007 serves
poc.odb. When LibreOffice opens the ODS and refreshes the pivot table, it reaches out to this URL. The ODB is a minimal database document specifyingdb:java-driver-class="MaliciousDriver"anddb:java-classpath="file:///work/malicious-driver.jar".Malicious JAR. A compiled Java class implementing
java.sql.Driver. The static initializer runsid,hostname, anduname -a, writing the output to/tmp/pwned.txt. Nothing destructive – just enough to prove the code ran and to identify the execution context.Pivot table refresh. In the lab, the PoC opens the ODS via LibreOffice’s UNO API and calls
DataPilotTable.refresh(). In a real attack, the refresh would happen when the user interacts with the pivot table or through an embedded macro.Driver loads, code executes. LibreOffice fetches the ODB, reads the driver settings, and loads
MaliciousDriverfrom the attacker-specified classpath. The static initializer fires. The marker file appears.
One limitation: after the CVE-2026-63277 fix in 26.2.5, the classpath is restricted to file:// URLs. The JAR cannot be fetched over HTTP; it must already exist on the target filesystem. An attacker would deliver it by another means – an email attachment, a download, a shared drive – or target a known path. This restriction narrows the attack but does not prevent it.
The proof
On LibreOffice 26.2.6.3, the PoC runs the full chain. The pivot table refreshes, LibreOffice fetches the ODB, and the malicious driver executes:
1 | [+] EXPLOIT SUCCEEDED on vuln |
The marker file /tmp/pwned.txt written by the malicious driver inside the container:
1 | --- CVE-2026-104007 code execution proof --- |
The pcap from the vulnerable container (capture/vuln-capture.pcap, 12242 bytes, 70 packets) shows LibreOffice reaching out over HTTP:
1 | OPTIONS /poc.odb -> 501 |
LibreOffice issues multiple requests – OPTIONS, then HEAD, then GET – to retrieve the ODB. The User-Agent header confirms the vulnerable version.
Negative control
The same PoC against LibreOffice 26.2.7.2:
1 | [-] Exploit did not succeed on patched |
No marker file. The pcap from the patched container is 24 bytes – the file header only, zero packets. LibreOffice 26.2.7.2 did not make any HTTP request. The fix blocks the ODB fetch before the driver-loading code is ever reached.
Impact
The attack achieves arbitrary code execution in the LibreOffice JVM process when a user opens a crafted spreadsheet, with two preconditions: Java must be enabled in LibreOffice, and the malicious JAR must be on the target filesystem.
The pivot table route is distinct from CVE-2026-63277’s calcext:data-mappings route. Even installations that applied the 26.2.5 fix for CVE-2026-63277 remained vulnerable through CVE-2026-104007 until 26.2.7.
| Claim | Status | Evidence |
|---|---|---|
| Code execution on LibreOffice 26.2.6.3 | Proven | evidence/poc-vuln-pwned.txt, evidence/poc-console-output.txt |
| Full attack chain from crafted ODS to code execution | Proven | evidence/poc-console-output.txt, capture/vuln-capture.pcap |
| Patched version unaffected | Confirmed | evidence/poc-console-output.txt, evidence/capture-patched.pcap |
| Code execution without pre-staged JAR | Not reached | CVE-2026-63277 fix restricts classpath to file:// only |
Detection
The repository includes experimental detection rules for the network and file indicators of this attack. These are research artifacts, not production-grade signatures. Each was tested against the exploit capture or sample and one benign fixture only.
Suricata (detection/cve-2026-104007.rules): two rules detecting (1) HTTP responses delivering ODB files via Content-Type application/vnd.sun.xml.base, and (2) LibreOffice User-Agent requesting a .odb URI. Both require plaintext HTTP inspection.
YARA (detection/cve-2026-104007.yar): two rules matching (1) ODS files containing a pivot table with an HTTP-referenced database source, and (2) ODB files specifying both a JDBC driver class and a classpath. Useful at email gateways or endpoint scanners.
Both rule sets fired on the exploit samples and stayed silent on the benign fixtures. See detection/README.md for full test results and limitations.
The fix
The fix in 26.2.7 / 26.8.2 applies two restrictions. First, the JDBC driver location is sourced exclusively from the user’s own configured drivers, ignoring any classpath specified in the database document. Second, pivot tables whose data source names a URL-based database document require the user to approve link updates before connecting – the unconsented fetch is gone.
The dual fix is important. Restricting the classpath alone would still allow the silent ODB fetch, which is an information-disclosure risk (the attacker learns whether the user opened the document). Requiring consent for link updates is the defense-in-depth layer that blocks the entire chain at its first step.
| Date | Event |
|---|---|
| 2026-11-16 | Advisory published; 26.2.7 and 26.8.2 released |
| 2026-11-17 | Reproduction confirmed |
Reproduction
Readers can verify every claim in this post by running three commands from a fresh clone.
1 | git clone https://github.com/al4n4n/achilles-heel.git |
The setup requires Docker with access to a Linux x86_64 host. The PoC stages all payload files, runs the exploit, and reports the result with evidence collection.
Full details: al4n4n/achilles-heel/CVE-2026-104007