CVE-2026-6040 Heap use-after-free in ODF number-format blank-width parsing

Medium 5.4 Published Updated

A heap use-after-free in LibreOffice allows attackers to execute arbitrary code or cause denial of service via a malformed ODF number format.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Local or same network only
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2026-6040?

CVE-2026-6040 is a medium-severity use after free vulnerability in The Document Foundation LibreOffice, published on 15 Jun 2026. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.

Official description

A heap use-after-free existed when importing the blank-width characters of an ODF number format. A position value read from the document was not checked against the length of the format-code string, so a malformed number format could be processed against memory outside that string. In fixed versions the position is bounds-checked before use.

Weakness: CWE-825, CWE-787, CWE-416

Which versions are affected by CVE-2026-6040?

How do I fix CVE-2026-6040?

Apply the vendor's patch.

Upgrade to the fixed version. These bugs are found with fuzzing and sanitisers and avoided by memory-safe languages. More about Use after free.

Is CVE-2026-6040 being exploited?

There is no known exploitation of CVE-2026-6040 in the wild and no public exploit code.

Sources

Also known as DEBIAN-CVE-2026-6040, GHSA-pp4w-c8m6-4xvf, UBUNTU-CVE-2026-6040.

Is CVE-2026-6040 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free