Skip to main content
Mallory
HighExploited in the wildCISA KEVPublic exploitVulnerability

CVE-2018-0802: Stack Buffer Overflow in Microsoft Office Equation Editor

Published Jan 10, 2018 · Updated 1 month ago
Trending this weekNot trendingOutside this week’s top 100
Mention activity · 30 daysNo mention activity in the last 30 days.
CVSS7.8High · v3.1
EPSS93.3%100th percentile
CISA KEVYesAdded Nov 3, 2021
In the wildActivePer CISA KEV
Vendor
Microsoft Corporation
IdentifiersCVE-2018-0802CWE-121

CVE-2018-0802 is a stack-based buffer overflow in Microsoft Office Equation Editor affecting Office 2007, 2010, 2013, and 2016. During parsing of an MTEF Font Record, function sub_421E39 uses strcpy without length validation to copy an attacker-supplied font name into the 32-byte lfFaceName field of a LOGFONT structure. The structure is allocated on the stack in sub_421774, allowing an oversized font name to overwrite the caller's return address. Crafted Office documents containing malicious equation objects can exploit this flaw to execute arbitrary code in the current user's context. An observed exploit used a partial return-address overwrite to redirect execution despite ASLR protection.

Do you run this?See affected versions in your environment and whether adversaries are exploiting this vulnerability against assets like yours.
Check your exposure
Analyst brief

Impact, mitigation & remediation

What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.

Impact

What an attacker gets, and what they’ve been doing with it.

Successful exploitation permits arbitrary code and command execution with the current user's permissions. Exploitation has supported delivery of backdoors, downloaders, and information-stealing malware, including PLEAD, Elise, and Agent Tesla. Subsequent payloads can provide remote control, credential theft, data exfiltration, and persistence; these capabilities depend on the deployed malware rather than the buffer overflow itself. The vulnerability is also associated with known ransomware campaign use.

Mitigation

If you can’t patch tonight, do this now.

Use virtual patching where immediate software updates are operationally infeasible. Detect and block malicious Office attachments at email gateways and endpoints, and train users to verify unexpected messages before opening attachments. Apply least privilege, application control, network segmentation, and behavioral monitoring to limit payload execution and subsequent compromise.

Remediation

Patch, then assume compromise.

Apply Microsoft's security updates addressing CVE-2018-0802 to affected Office installations. Verify deployment across endpoints and remediate systems left unpatched because of operational constraints.

Public exploits

Exploits

3 exploits validated by Mallory's analysis. Hidden: 1 rejected by Mallory's analysis as not a working exploit.

View more in app →
CVE-2018-0802_POCThis repository is a proof-of-concept (PoC) exploit for CVE-2018-0802, a vulnerability in Microsoft Office's Equation Editor that allows for arbitrary code execution via a crafted RTF file. The repository contains three files: a README with usage instructions, a sample malicious RTF file ('cve-2018-0802.rtf'), and a Python script ('cve-2018-0802_poc.py') that generates malicious RTF files. The Python script takes an executable command (such as 'calc.exe' or a remote executable path) and outputs an RTF file that, when opened in a vulnerable version of Microsoft Word, will execute the specified command. The exploit leverages the embedding of an OLE object with a crafted Equation.3 object to trigger the vulnerability. The main attack vector is through a malicious file delivered to the victim, and the payload is customizable to execute arbitrary commands. The exploit is a PoC and does not include advanced features such as evasion or persistence.zldww2011 · Disclosed Jan 11, 2018 · python · filePoCCVE-2018-0802This repository provides a proof-of-concept exploit for CVE-2018-0802 (and optionally CVE-2017-11882), both critical vulnerabilities in the Microsoft Office Equation Editor. The main exploit script, 'packager_exec_CVE-2018-0802.py', generates a malicious RTF file that embeds a user-supplied executable using a Packager OLE object. When the RTF is opened in a vulnerable version of Microsoft Office, the exploit drops the embedded executable to the %TMP% directory and executes it via a WinExec call, achieving arbitrary code execution. The script supports an option to exploit both CVE-2018-0802 and CVE-2017-11882 in a single document. The repository also includes a sample malicious RTF ('example/example.rtf') that launches calc.exe, YARA rules for detection of the exploit, and a utility script ('yara/strip_keycodes.py') for removing obfuscating keycodes from RTF files. The exploit is a POC and requires the attacker to supply the payload executable. The attack vector is via malicious file delivery (RTF), and the main fingerprintable endpoint is the dropped file in the %TMP% directory.rxwx · Disclosed Jan 11, 2018 · python · yara · filePoCRTF_11882_0802This repository contains a Python proof-of-concept exploit for the Microsoft Office Equation Editor vulnerabilities CVE-2017-11882 and CVE-2018-0802. The main file, RTF_11882_0802.py, is a command-line tool that generates a malicious RTF file. The user specifies a command to execute on the target system and the output file name for the crafted RTF. Optionally, a template RTF can be provided. The exploit works by embedding a specially crafted OLE object into the RTF, which triggers the vulnerability in the Equation Editor component when the file is opened in a vulnerable version of Microsoft Office on Windows. The exploit does not contain any hardcoded payload; instead, it allows the user to specify any command, making it a flexible proof-of-concept. The repository also includes a README with usage instructions and references to research and advisories. No network endpoints or external IPs/domains are present; the attack vector is via a malicious file delivered to the victim.Ridter · Disclosed Jan 12, 2018 · python · filePoC
Exposure surface

Affected products & vendors

Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.

VendorProductType
Microsoft CorporationMicrosoft Officeapplication
Microsoft CorporationOffice Compatibility Packapplication
Microsoft CorporationWordapplication
FAQ

Frequently asked questions

Is CVE-2018-0802 exploited in the wild?
Yes. As of Oct 16, 2026, Mallory has reports of exploitation in the wild, and CISA added it to KEV on Nov 3, 2021.
Is there a public exploit for CVE-2018-0802?
Yes. Mallory tracks 3 public exploits or proofs of concept for CVE-2018-0802, the earliest disclosed Jan 11, 2018.
Is there a patch for CVE-2018-0802?
Apply Microsoft's security updates addressing CVE-2018-0802 to affected Office installations. Verify deployment across endpoints and remediate systems left unpatched because of operational constraints.
What products are affected by CVE-2018-0802?
Microsoft Corporation Microsoft Office, Microsoft Corporation Office Compatibility Pack, and Microsoft Corporation Word.
How severe is CVE-2018-0802?
CVE-2018-0802 has a CVSS v3.1 score of 7.8 (High) and an EPSS score of 93.3% (100th percentile) as of Oct 16, 2026.
Mallory platform

The version that knows your environment.

This page is what’s public. Mallory adds the parts that aren’t: which of your assets are affected, which adversaries are exploiting it right now, and which detections to deploy tonight.
Exposure mappingQuery your assets running an affected version, and investigate the blast radius.
Threat actor evidence48Every report linking this CVE to a named adversary.
Associated malware63Malware families linked to this CVE, with evidence and IOCs.
Detection signatures2YARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.
Vendor-by-vendor mappingCross-references every affected SKU, including bundled OEM variants.
Social activity28Community discussion across Reddit, Mastodon, and other social sources.