Heap-based buffer overflow in Microsoft Office allows local code execution

Note: This data is for reference and cybersecurity research purposes only.CyStack advises users not to use this information for unlawful purposes.

What is CVE-2026-40363?

CVE-2026-40363 is a vulnerability classified as Heap-based Buffer Overflow, affecting Microsoft 365 Apps for Enterprise (affected versions: 16.0.1 – < https://aka.ms/OfficeSecurityReleases), Microsoft Office 2016 (affected versions: 16.0.0 – < 16.0.5552.1000), Microsoft Office 2019 (affected versions: 19.0.0 – < https://aka.ms/OfficeSecurityReleases), and 5 more products. This vulnerability is rated High, with a CVSS score of 8.4. Current sources do not report this vulnerability as exploited.

Overview

Original source data

Heap-based buffer overflow in Microsoft Office allows an unauthorized attacker to execute code locally.

Affected products and scope

The record covers Microsoft Office across several maintained editions: Microsoft 365 Apps for Enterprise, Office 2016, Office 2019, Office LTSC 2021, Office LTSC 2024, Office for Android, and Office LTSC for Mac 2021 and Office LTSC for Mac 2024. Because the affected ranges are recorded against the vendor's release pages rather than as plain build numbers, the reliable test is to compare an installation's build with the fixed builds listed in Microsoft's update guidance. The record does not name any configuration that is explicitly out of scope.

Technical details

The weakness is a heap-based buffer overflow, tracked as CWE-122. Microsoft Office allocates a buffer on the heap and then writes past its boundary while handling input, corrupting adjacent heap memory. Because the heap holds control structures and object pointers that the process later reads and follows, an attacker who can influence the overwritten contents can redirect execution instead of simply crashing the application. The vendor names Microsoft Office as the affected product but does not publish which component, parser or file format is at fault, so the specific input path is not publicly documented. The scoring places the attack vector as local, with low complexity, no privileges required and no user interaction.

Exploitability

The attack vector is local: exploitation happens on the affected machine rather than over the network, and the attacker needs a way to get the triggering input processed there. Per the vendor's scoring, the attack requires no privileges and no user interaction, which means it does not depend on tricking someone into clicking through a prompt. No exploitation in the wild is reported in the record, and no public exploit is listed. Public detail about the triggering input is limited to the vendor's description.

Technical impact

Successful exploitation gives an attacker code execution on the local machine, with high impact on confidentiality, integrity and availability as scored by the vendor. The code runs in the security context of the Office process and therefore of the user running it; the flaw does not by itself grant administrator or system rights. Reaching it requires the ability to run something in the local context of the target machine, so it is a step an attacker takes after some other form of access or delivery, not a network-facing entry point on its own.

Business impact

Office is installed on most knowledge-worker machines, so a memory corruption bug in it sits close to the documents, mail, credentials and internal systems those users touch. Code that runs through this flaw runs with the same rights as the Office process that loaded it, which for a typical user means access to their files, their signed-in sessions and any network shares they can reach. On an account with administrative rights, the reach is wider. The practical cost is the usual one for local code execution: an attacker who already has a foothold on a machine, or who can get a crafted file in front of a user, gains a way to run their own code without needing credentials. That feeds into incident response, forensic scoping and any reporting obligation an organisation carries for unauthorised access to systems and data. Desktop engineering and endpoint teams should care first; identity and data owners care because of what the process can reach once compromised.

Remediation

Apply Microsoft's update for Office. A patch exists and is distributed through the normal Office update channels and the vendor's update guide, so the priority action is to bring every affected edition, including the Mac and Android builds, up to the fixed build listed there. The record documents no mitigation or workaround, so there is nothing to fall back on other than updating. Where an estate cannot be patched at once, use the inventory to know which machines are still exposed and treat them as a known gap.

Detection

Watch for Office applications crashing or being terminated by heap corruption, particularly crashes clustered on the same user or the same class of input, and for unusual child processes or network connections originating from Office processes. Endpoint telemetry that records process creation with Office as the parent is the practical place to look. For exposure rather than attempts, compare installed Office builds against the fixed builds in the vendor's guidance and reconcile the result against your asset inventory.

Sources (7)
Learn more

Run an in-depth assessment with complete web risk management

CyStack VulnScan continuously discovers assets, validates vulnerabilities, and helps security teams prioritize remediation across the organization.