Skip to content

Libreoffice Rce

ii4gsp.github.io • November 16, 2026

Vulnerability CVE-2026-104692: HSQLDB Method Whitelist Not Enforced CVE-2026-104007: setPropertyInfo Bypass for External ODB References Patch Defense-in-Depth

CVE-2026-104692: HSQLDB Method Whitelist Not Enforced

CVE-2026-104007: setPropertyInfo Bypass for External ODB References

Exploitation Exploit Chain Exploit Flow Platform-Specific Behavior evil/Driver.java Full Exploit

Platform-Specific Behavior

Demo Windows macOS Linux

This blog post describes how to exploit a remote code execution vulnerability in LibreOffice by combining two security vulnerabilities with several ODF document features to build a complete exploit chain. The exploit achieves arbitrary command execution on macOS, Windows, and Linux when a victim simply opens a crafted spreadsheet file, with no user interaction, no macro warning, and no security prompt. The vulnerabilities are tracked as CVE-2026-104692 and CVE-2026-104007.

Two independent vulnerabilities make this exploit possible. CVE-2026-104007 alone is sufficient for RCE via the Driver.connect() path, which bypasses the HSQLDB method whitelist entirely. The exploit demonstrates this on Linux, while on macOS and Windows it chains both CVEs through the HSQLDB CALL path.

CVE-2026-104692: HSQLDB Method Whitelist Not Enforced

The HSQLDB bundled with LibreOffice has a method whitelist mechanism in HsqlDatabaseProperties.supportsJavaMethod() that controls which Java methods can be invoked through SQL CALL statements. At [A], the whitelist field accessibleJavaMethodNames is initialized to null instead of an empty set. At [B], since the field is null , supportsJavaMethod() unconditionally returns true for any method name — effectively disabling the entire whitelist and allowing arbitrary Java method execution through HSQLDB.

The static initializer at [C] reads System.getProperty("hsqldb.method_class_names") and parses semicolon-separated method names to populate the whitelist. But since the field starts as null (not an empty set), supportsJavaMethod() already returns true regardless of whether this code runs.

When HSQLDB processes a CALL statement, Database.getJavaName() resolves the method name. At [D], it calls supportsJavaMethod() to check whether the method is allowed. Because the whitelist is null , this check always passes, and any Java method — including the attacker’s evil.Driver.pwn() — is invoked without restriction.

CVE-2026-104007: setPropertyInfo Bypass for External ODB References

dbaxml::ODBFilter::setPropertyInfo() is a security function that strips the JavaDriverClassPath property from ODB files during XML import to prevent attacker-controlled classpath injection. At [E], when an ODB is opened directly, setPropertyInfo() removes the dangerous property after XML parsing but before properties are applied to the datasource.

However, setPropertyInfo() is called only when directly opening an ODB file . When an ODB is referenced as an external datasource via form:datasource , this filter is not invoked. At [F], the ODB’s db:java-classpath is passed directly to JConnection::construct() and loaded into the URLClassLoader with the attacker’s classpath intact. This bypass is critical because it allows the attacker to control which classes URLClassLoader loads — without a classpath, even if CVE-2026-104692 allows calling arbitrary methods, there are no attacker-controlled classes to call.

The 26.8.2.2 pre-release patches both vulnerabilities with defense-in-depth.

CVE-2026-104692 : accessibleJavaMethodNames is initialized to an empty HashSet instead of null , so supportsJavaMethod() falls through to the whitelist check and blocks all methods not in org.hsqldb.Library.* or java.lang.Math.* . The static initializer still reads System.getProperty("hsqldb.method_class_names") after creating the empty set, but since LibreOffice does not set this property, the set remains empty.

CVE-2026-104007 : Two defense-in-depth changes were added. First, setPropertyInfo() now also strips SystemProperties from ODB files during XML import, closing a system property injection vector where an attacker could set hsqldb.method_class_names via the ODB’s db:data-source-settings to re-populate the whitelist bypassed by CVE-2026-104692.

Second, the datasource connection path now checks whether the document is in a trusted location. Untrusted documents have their additional driver options ( INFO_ADDITIONALOPTIONS ) filtered out during connection setup, and ADO connections from untrusted locations are blocked entirely.

The patches create overlapping defense layers. Even if one layer is bypassed, the others independently block the attack.

The exploit reaches the two vulnerabilities above through a chain of ODF document features that, while not vulnerabilities themselves, enable the attack to trigger automatically. Opening the document is enough — no macros, no prompts, no additional interaction required.

The exploit leverages five ODF/LibreOffice features to deliver the payload and trigger the two vulnerabilities without user interaction:

1. HTTP ODB Auto-Download — ODF documents can reference an external database file (ODB) through form:datasource . When this attribute contains an HTTP URL, LibreOffice downloads the ODB file from the remote server without user confirmation. This delivers the attacker’s ODB payload containing the malicious classpath configuration (CVE-2026-104007).

2. Form Auto-Load — The form:apply-design-mode="false" attribute causes LibreOffice to automatically connect to the datasource and execute the form’s SQL command upon document open. LibreOffice classifies database access as a non-macro operation, so no macro security dialog is triggered.

3. SQL Composer Bypass — The form:escape-processing="false" attribute disables SingleSelectQueryComposer validation, allowing CALL statements to reach HSQLDB unmodified. Without this, the SQL composer would reject the CALL syntax as it only handles SELECT statements.

4. ODS-as-Class-Container — Since ODS files are ZIP archives, the attacker embeds the malicious evil/Driver.class directly inside the ODS file itself. Java’s URLClassLoader treats ZIP/JAR files as class containers and loads .class files from them. The ODB payload sets the classpath to point back to this file on disk.

5. Bootstrap Variable Path Prediction — LibreOffice supports bootstrap variables ( $SYSUSERHOME , ${.envvar: } ) in classpath strings that resolve to platform-specific user directories at runtime. The attacker lists multiple common download locations (Downloads, Desktop, Documents) — URLClassLoader silently ignores paths that don’t exist, so one will match regardless of where the victim saved the file.

The crafted ODS file combines all five features. At [A], it references the attacker’s HTTP server. At [B], it enables form auto-load. At [C], it disables SQL composer validation.

Since ODS is a ZIP archive, the malicious evil/Driver.class is embedded directly inside the file at [D]. URLClassLoader treats ZIP files as class containers and loads .class files from them.

The ODB payload hosted on the attacker’s server provides the classpath configuration and JDBC settings. It uses bootstrap variables to predict the victim’s file path and points the classpath back to the ODS file on disk:

Platform-Specific Behavior

On macOS and Windows, the exploit uses the HSQLDB CALL path: the form’s SQL command directly invokes evil.Driver.pwn() with the command string as an argument.

On Linux, the exploit demonstrates that CVE-2026-104007 alone is sufficient for RCE: evil.Driver is registered as the JDBC driver class in the ODB, and its connect() method is invoked automatically during connection setup. The command is embedded in the JDBC URL as jdbc:evil: . This Driver.connect() approach would work on all platforms even if the HSQLDB whitelist were applied, because driver class loading and connect() invocation do not go through supportsJavaMethod() .

The malicious JDBC driver implements the CALL path via pwn() and the connect() path (demonstrated on Linux).

CVE-2026-104692 — HSQLDB Method Whitelist Bypass

CVE-2026-104007 — Classpath/Property Stripping Bypass

LibreOffice Security Advisories

Extracted Entities