Skip to content
Memory corruption Advisory Advanced CVE-2020-17123

Microsoft Office ElementType code execution vulnerability

A specially crafted XLS file containing malformed HTML/XML content causes Excel to free an object without clearing the pointer to it, leading to a use-after-free. An attacker who supplies such a file to a victim could potentially achieve remote code execution through heap grooming.

Marcin 'Icewall' Noga Follow

Originally disclosed on Cisco Talos

High 8.8 View original

An exploitable use-after-free vulnerability exists in Excel as part of Microsoft Office 365 ProPlus x86, version 2002, build 12527.20988. A specially crafted XLS file can cause a use-after-free condition, resulting in remote code execution.

Marcin 'Icewall' Noga, on Cisco Talos

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the HTML/XML import code frees an object but fails to null the associated pointer, so later reuse of that pointer bypasses the checks meant to prevent use-after-free.

Impact

With proper heap grooming an attacker could turn the use-after-free into arbitrary code execution, though the report only demonstrates a crash.

What the attacker needed

Victim opens a crafted XLS file; affected Office 365 ProPlus x86 build

How it was found

  1. Open a specially crafted XLS file containing malformed HTML/XML content in the affected Excel version.
  2. Observe the object being allocated during HTML import.
  3. Observe the object being freed because of the malformed HTML/XML content.
  4. Observe the stale pointer being reused, causing an access violation.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

When a program creates an object in memory it should also remove every reference to it once it is deleted. Here Excel deletes the object but keeps a pointer to it, so later code still uses that stale pointer. An attacker can arrange for their own data to sit where the deleted object was, which may let them run their own code when the victim opens the file.

What is Memory corruption?

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.

More by Marcin 'Icewall' Noga

View all

146 more disclosed reports, best first.

More from Cisco Talos

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.