# CVE-2026-8357: Heap buffer overflow in Calc formula compilation

> A heap buffer overflow in LibreOffice Calc allows attackers to execute arbitrary code or cause a crash by providing a specially crafted spreadsheet with a long formula.

- **Severity:** Medium 5.4 (`CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:L/VI:L/VA:H/SC:N/SI:N/SA:N/E:P`)
- **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:** Yes
- **Published:** 15 Jun 2026
- **Updated:** 28 Jul 2026
- **Also known as:** ALSA-2026:35839, ALSA-2026:36832, DEBIAN-CVE-2026-8357, GHSA-j779-pcc6-8c5f, RHSA-2026:35839, RHSA-2026:36832, RHSA-2026:43423, RHSA-2026:43424, RHSA-2026:43425, RHSA-2026:43460, RHSA-2026:43461, RHSA-2026:46387, RLSA-2026:35839, RLSA-2026:36832, UBUNTU-CVE-2026-8357

## What is CVE-2026-8357?

CVE-2026-8357 is a medium-severity memory corruption 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

LibreOffice Calc compiles cell formulas when opening a spreadsheet. A heap buffer overflow existed when compiling a very long formula made up of many opening tokens. The array that tracks nesting depth was allocated one element too small for that worst case, so such a formula wrote one element past its end. In fixed versions the array is sized to hold the largest possible nesting.

Weakness: CWE-131 (Incorrect Calculation of Buffer Size), CWE-787 (Out-of-bounds Write), CWE-193 (Off-by-one Error)

## Which versions are affected by CVE-2026-8357?


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `autocorr-af` | AlmaLinux:8 | All versions | 1:6.4.7.2-21.el8_10.alma.1 |
| `autocorr-bg` | AlmaLinux:8 | All versions | 1:6.4.7.2-21.el8_10.alma.1 |
| `autocorr-ca` | AlmaLinux:8 | All versions | 1:6.4.7.2-21.el8_10.alma.1 |
| `autocorr-cs` | AlmaLinux:8 | All versions | 1:6.4.7.2-21.el8_10.alma.1 |
| `autocorr-da` | AlmaLinux:8 | All versions | 1:6.4.7.2-21.el8_10.alma.1 |
| `autocorr-de` | AlmaLinux:8 | All versions | 1:6.4.7.2-21.el8_10.alma.1 |
| `autocorr-en` | AlmaLinux:8 | All versions | 1:6.4.7.2-21.el8_10.alma.1 |
| `autocorr-es` | AlmaLinux:8 | All versions | 1:6.4.7.2-21.el8_10.alma.1 |
| `autocorr-fa` | AlmaLinux:8 | All versions | 1:6.4.7.2-21.el8_10.alma.1 |
| `autocorr-fi` | AlmaLinux:8 | All versions | 1:6.4.7.2-21.el8_10.alma.1 |
| `autocorr-fr` | AlmaLinux:8 | All versions | 1:6.4.7.2-21.el8_10.alma.1 |
| `autocorr-ga` | AlmaLinux:8 | All versions | 1:6.4.7.2-21.el8_10.alma.1 |
| `autocorr-hr` | AlmaLinux:8 | All versions | 1:6.4.7.2-21.el8_10.alma.1 |
| `autocorr-hu` | AlmaLinux:8 | All versions | 1:6.4.7.2-21.el8_10.alma.1 |
| `autocorr-is` | AlmaLinux:8 | All versions | 1:6.4.7.2-21.el8_10.alma.1 |
| `autocorr-it` | AlmaLinux:8 | All versions | 1:6.4.7.2-21.el8_10.alma.1 |
| `autocorr-ja` | AlmaLinux:8 | All versions | 1:6.4.7.2-21.el8_10.alma.1 |
| `autocorr-ko` | AlmaLinux:8 | All versions | 1:6.4.7.2-21.el8_10.alma.1 |
| `autocorr-lb` | AlmaLinux:8 | All versions | 1:6.4.7.2-21.el8_10.alma.1 |
| `autocorr-lt` | AlmaLinux:8 | All versions | 1:6.4.7.2-21.el8_10.alma.1 |
| `autocorr-mn` | AlmaLinux:8 | All versions | 1:6.4.7.2-21.el8_10.alma.1 |
| `autocorr-nl` | AlmaLinux:8 | All versions | 1:6.4.7.2-21.el8_10.alma.1 |
| `autocorr-pl` | AlmaLinux:8 | All versions | 1:6.4.7.2-21.el8_10.alma.1 |
| `autocorr-pt` | AlmaLinux:8 | All versions | 1:6.4.7.2-21.el8_10.alma.1 |
| `autocorr-ro` | AlmaLinux:8 | All versions | 1:6.4.7.2-21.el8_10.alma.1 |
| `autocorr-ru` | AlmaLinux:8 | All versions | 1:6.4.7.2-21.el8_10.alma.1 |
| `autocorr-sk` | AlmaLinux:8 | All versions | 1:6.4.7.2-21.el8_10.alma.1 |
| `autocorr-sl` | AlmaLinux:8 | All versions | 1:6.4.7.2-21.el8_10.alma.1 |
| `autocorr-sr` | AlmaLinux:8 | All versions | 1:6.4.7.2-21.el8_10.alma.1 |
| `autocorr-sv` | AlmaLinux:8 | All versions | 1:6.4.7.2-21.el8_10.alma.1 |
| `autocorr-tr` | AlmaLinux:8 | All versions | 1:6.4.7.2-21.el8_10.alma.1 |
| `autocorr-vi` | AlmaLinux:8 | All versions | 1:6.4.7.2-21.el8_10.alma.1 |
| `autocorr-zh` | AlmaLinux:8 | All versions | 1:6.4.7.2-21.el8_10.alma.1 |
| `libreoffice` | AlmaLinux:8 | All versions | 1:6.4.7.2-21.el8_10.alma.1 |
| `libreoffice-base` | AlmaLinux:8 | All versions | 1:6.4.7.2-21.el8_10.alma.1 |
| `libreoffice-calc` | AlmaLinux:8 | All versions | 1:6.4.7.2-21.el8_10.alma.1 |
| `libreoffice-core` | AlmaLinux:8 | All versions | 1:6.4.7.2-21.el8_10.alma.1 |
| `libreoffice-data` | AlmaLinux:8 | All versions | 1:6.4.7.2-21.el8_10.alma.1 |
| `libreoffice-draw` | AlmaLinux:8 | All versions | 1:6.4.7.2-21.el8_10.alma.1 |
| `libreoffice-emailmerge` | AlmaLinux:8 | All versions | 1:6.4.7.2-21.el8_10.alma.1 |

## How do I fix CVE-2026-8357?

Apply the vendor's patch.

## Is CVE-2026-8357 being exploited?

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

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-8357 and fix it if it is affected.

What it is: CVE-2026-8357 is a medium-severity memory corruption 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.
Exploitation: There is no known exploitation of CVE-2026-8357 in the wild and no public exploit code.

Affected product: The Document Foundation LibreOffice. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-8357/ (Markdown: https://insights.sbomify.com/CVE-2026-8357/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-8357
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-8357
- OSV: https://osv.dev/vulnerability/CVE-2026-8357

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-8357/
Summaries are generated and may contain mistakes; the official description above is the record.
