A researcher who goes by ii4gsp has published a full exploit chain for two LibreOffice remote code execution flaws, CVE-2026-104007 and CVE-2026-104692. Opening a crafted spreadsheet can run attacker code on macOS, Windows and Linux without macros or prompts. No attacks have been confirmed.
Two LibreOffice Flaws Scored CVSS 4.0 8.5
Both vulnerabilities carry a CVSS 4.0 score of 8.5. They affect The Document Foundation’s LibreOffice versions before 26.2.7 and 26.8.2, which are the fixed releases.
CVE-2026-104007: Code Execution Through the JDBC Driver Path
CVE-2026-104007 allows code execution through the JDBC driver path of a database document. A crafted file can point LibreOffice at a driver location that the attacker controls.
CVE-2026-104692: Java Method Calls in HSQLDB Databases
CVE-2026-104692 allows code execution through Java method calls in HSQLDB databases. Together, the two flaws give the published exploit chain two routes to running attacker code from a document.
How CVE-2026-104692 Bypasses the HSQLDB Method Whitelist
The HSQLDB bundled with LibreOffice initialised its method whitelist as null rather than an empty set. As a result, supportsJavaMethod() “unconditionally returns true” for any method name, and SQL CALL statements can invoke arbitrary Java methods. The weakness class is reflection injection (CWE-470).
How CVE-2026-104007 Skips the JavaDriverClassPath Filter
When ODB database files are referenced externally from forms, LibreOffice skipped the filter that removes JavaDriverClassPath, so an attacker-controlled classpath can load malicious classes (CWE-829). Opening an ODB file directly triggers the filter, but remote references did not.
The ii4gsp write-up, “LibreOffice RCE via ODF Form Datasource JDBC Code Execution,” says the affected versions are 26.2.6.x and earlier and 26.8.1 and earlier. The crafted files are ODS spreadsheets, and nothing beyond opening them is needed.
Five ODF Features Chain Into One Exploit
The chain combines five features of the OpenDocument Format:
- HTTP auto-download through form:datasource=”http://…” silently fetches a remote ODB.
- Form auto-load with form:apply-design-mode=”false” runs queries on open.
- form:escape-processing=”false” bypasses SQL composer validation and allows CALL.
- ODS files are ZIP archives, and a URLClassLoader loads .class files embedded in them.
- Bootstrap variables such as $SYSUSERHOME, with several common paths, compensate for unpredictable download locations.
Windows, macOS and Linux Run Different Paths of the Exploit
On macOS and Windows the exploit chains both CVEs, triggering evil.Driver.pwn() through the HSQLDB CALL path and executing commands through Runtime.getRuntime().exec(). On Linux, CVE-2026-104007 alone suffices: the malicious class acts as the JDBC driver, and commands travel in a connection URL of the form jdbc:evil:. Commands run as the victim’s user.
What the Exploit Requires and What It Skips
The exploit does not need macros and does not show the user a prompt. Opening the crafted spreadsheet is enough on macOS, Windows and Linux. The one condition is that a Java runtime must be installed and enabled in LibreOffice, which limits who is exposed.
That requirement is the main brake on the exploit’s spread. Installations where Java is absent or disabled are not reachable by the chain as published.
Weaponization Risk Through Phishing Documents
The public proof of concept raises the risk that attackers will turn the chain into phishing documents. A spreadsheet that runs code on opening needs only delivery to a target who has a Java-enabled LibreOffice installed. The Java requirement narrows the audience but does not eliminate it.
This is a different set of flaws from the LibreOffice and OpenOffice issues covered in October, which also involved running code from spreadsheets. The new chain concerns JDBC and HSQLDB handling, and the two sets should not be conflated.
The fixes in 26.2.7 and 26.8.2 initialise the whitelist as an empty HashSet and strip JavaDriverClassPath and SystemProperties from ODB XML on import. They also filter extra driver options for untrusted documents and block ADO connections from untrusted locations. LibreOffice now always strips the driver location from documents.
Patch LibreOffice or Disable Java Integration
The response has two options. Users can update to LibreOffice 26.2.7 or 26.8.2, or they can disable Java in LibreOffice. Updating removes the vulnerable code paths, while disabling Java removes the condition the exploit depends on. With a full exploit chain now public and a fixed version available, applying the update closes the window for the published technique.
