Skip to content
Path traversal Write-up Advanced

Vulnerability Summary

A directory traversal flaw in the Exchange Server help update process allowed an attacker in a man-in-the-middle position to write arbitrary files, including a web shell, to the server. When an administrator ran the Update-ExchangeHelp command, the attacker could execute code as SYSTEM.

Steven Seeley Follow

Published on srcincite.io

In mid-November 2020 I discovered a logical remote code execution vulnerability in Microsoft Exchange Server that had a bizarre twist - it required a morpheus in the middle (MiTM) attack to take place before it could be triggered. I found this bug because I was looking for calls to WebClient.DownloadFile in the hope…

Steven Seeley (@steventseeley), on srcincite.io

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 write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

The cab file extraction routine did not validate file paths, allowing directory traversal during extraction.

Impact

An unauthenticated attacker in a privileged network position could execute arbitrary code as SYSTEM when an administrator runs the Update-ExchangeHelp command.

What the attacker needed

Attacker in man-in-the-middle position; administrator runs Update-ExchangeHelp

The fix

Microsoft patched this issue as CVE-2021-31209.

How it was found

  1. Perform an ARP spoof against the target system to become a man-in-the-middle.
  2. Intercept the request to the manifest URL and redirect it to an attacker-controlled manifest.
  3. Serve a malicious manifest that points to a malicious cab file and specifies a higher revision number.
  4. The server downloads and extracts the cab file, writing a web shell to a web-accessible directory.
  5. Request the web shell to execute arbitrary commands as SYSTEM.

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 write-up has not been written yet. The Original tab links to the source.

The Exchange server downloads help files from the internet when an admin runs a command. The attacker sat between the server and the internet, pretending to be the download server, and sent a malicious file that could be placed anywhere on the disk. Because the file was placed in a web-accessible folder, the attacker could then run commands on the server.

What is Path traversal?

Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.

More by Steven Seeley

View all

6 more disclosed reports, best first.

More from Microsoft

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Path traversal and file inclusion

The lesson behind this report.

Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.