CVE-2019-0801: Microsoft Office Uri Hyperlink Hijinks
Microsoft Office failed to properly sanitise the query string when creating .url shortcut files for recently opened documents, allowing directory traversal. An attacker could craft a URI that places a malicious .url file in the Startup folder, which would then be executed on every login, potentially loading attacker-controlled content.
zerodayinitiative.com
Published on zerodayinitiative.com
In December of 2018, we received a report of a vulnerability in Microsoft Office from Andrea Micalizzi, also known as rgod, who is one of our frequent contributors. It was patched this April as CVE-2019-0801, and now we’d like to share the full details with you.
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
Likely, Office failed to sanitise directory traversal sequences in the query string when constructing the filename for the .url shortcut, allowing path traversal.
Impact
An attacker could cause arbitrary HTML/script to execute on each login, enabling adware, scareware, or login notification, though the impact is somewhat limited as it requires user interaction and only affects the user's own machine.
What the attacker needed
Victim clicks a link; user allows external program
The fix
Microsoft patched this bug with their April release.
How it was found
- Craft a URI with ms-word:ofe|u| followed by a URL containing a query string with directory traversal sequences.
- Victim navigates to the URI and allows the external program to open.
- Office creates a .url file in the Startup folder due to traversal.
- On next login, the .url file is launched, fetching content from the attacker's server.
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.
When you open a document from the internet, Office saves a shortcut to it in a 'Recent' folder. The bug is that Office didn't clean up special characters in the web address, so an attacker could use '..' to move the shortcut into the Startup folder. Then, every time you log in, Windows would run that shortcut, which could load a malicious web page.
What is Path traversal?
Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.