Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
132 lines (89 sloc) 6.1 KB
Microsoft Office365/ProPlus Auto Macro Code Execution/Protection Bypass Report by Social Engineering Neo.
Affected Platforms: -
Microsoft Windows ≤10
Office365 & ProPlus Products ≤2019
Tested On: -
Windows 10 (build 17763.253 & 18362.295)
Office365/ProPlus (build 16.0.11727.20222, 16.0.11901.20170 & 16.0.11901.20204)
Most up to-date version of Microsoft Windows & Office365/ProPlus Products are affected.
Class: -
Inappropriate Configuration. (CWE-16)
Remote Code Execution.
Summary: -
Multiple Microsoft Office Products Suffer from Inappropriate Default Configuration, Allowing Auto-Execution of Macro Code Inside Macro-Enabled Office Documents.
Short Description: -
Macro-enabled Office documents can bypass protections when located in specific directories/locations on the host machine.
Long Description: -
Standard users can download macro-enabled Access, Excel, PowerPoint, Word documents and bypass built-in protections allowing potentially malicious code to run on the affected system without any user consent.
For example, the standard user downloads a macro-enabled Word document from the internet. The user has the latest Windows & Office365/ProPlus patches installed.
Let’s assume the document is downloaded & opened in '~\Downloads\', MS Word will prevent the script(s) from running and prompt the user for consent to execute the script. (this is good)
Now, let’s assume that same document is opened in one of the default "Trusted Locations" '~\AppData\Roaming\Microsoft\Word\STARTUP\', MS Word will allow the script to run automatically without user consent. (this is bad)
Proof of Concept: -
Tested on Latest Versions of Access, Excel, InfoPath, OneNote, Outlook, PowerPoint, Project, Publisher, Visio, Word.
Does (by-default) affect Access, Excel, PowerPoint, Word.
Does not (by-default) affect InfoPath, Visio.
Does not affect OneNote, Outlook, Project, Publisher.
ATTACKER: -
Step 1.) - Inject malicious VBA macro code & payload into Word document. *preferably AV evasive*
Step 2.) - Send malicious macro-enabled document to victim through internet.
Step 3.) - Setup bind/reverse connection.
*Optional*
Step 1.1) - Create shortcut to intended document location (one of the default trusted locations). Include link file with original document.
Step 1.2) - Be creative. Think of/search some path traversal vulnerabilities;) *who updates zip software anyways*
VICTIM: -
Step 1.) - Download document sent by ATTACKER.
Step 2.) - Open Document in trusted directory/location.
*If Optional Was Done*
Step 1.1) - Unzip/extract document.
Step 1.2) - Open document shortcut.
[CODE EXECUTION SUCCESSFUL]
Am I at risk??? Sure...
Step 1.) - Open Microsoft Office Product.
Step 1.1) - Create a new blank document.
Step 2.) - Navigate to File, Options.
Step 2.1) - Once in the "Word Options" window. Navigate to 'Trust Center', 'Trust Center Settings'
Step 3.) - Once in the "Trust Center" window. Navigate to 'Trusted Locations'
You will now see locations on the device which can execute macro commands without additional user interaction. (auto-exec)
VIDEO: - https://youtu.be/jNBl6yiYwmo **updated**
: - https://youtu.be/j75GUD9oUK4 **original**
Expected Result: -
It shouldn't be possible to automatically execute macro code on the host machine without user consent or additional configuration.
(Clean Install)
Observed Result: -
Office document auto-executes macro code upon loading document without any user consent, in our case leading to remote code execution.
(User Level Access)
Our Recommendation:
Disable 'Trusted Locations' in future Office editions. This is because users often do not use the default trusted locations, potentially leaving average users vulnerable to such attacks when there is no need.
NOTE: - These kinds of tactics may be used by workplaces & education providers to embed honeytokens into sensitive documents.
: - In the 'Trusted Locations' tab, "Allow Trusted Locations on my network" is `Not Recommended` and not selected by default. Whereas in the 'Trusted Documents' tab, "Allow documents on a network to be trusted" is enabled by default. Wouldn’t you rather allow documents on the LAN to be trusted and remote (WAN) documents not be trusted? This may allow remote macro-enabled documents to auto-exec code (as demonstrated)
: - Most Office365/ProPlus users will not use the default "Trusted Locations". They are very likely to add their own location(s). Therefore, potentially leaving most Office365/ProPlus users at risk of such bypasses, when there is no need to put users at risk.
: - A simple path traversal vulnerability in the web browser or zip software (like the 20-year unpatched winRAR vulnerability [CVE-2018-20250]) or a path traversal over the shared RDP clipboard will result in total system compromisation because of this potential Office365/ProPlus security issue with the default configuration.
: - This is not a vulnerability itself, instead a security issue due to inappropriate default configuration of the software.
CVSS v3 Vector: -
AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H/E:P/RL:W/RC:R/CR:L/IR:L/AR:M/MAV:L/MAC:L/MPR:N/MUI:R/MS:U/MC:H/MI:H/MA:H
CVSS Base Score: - 7.8
Impact Subscore: - 5.9
Exploitability Subscore: - 1.8
CVSS Temporal Score: - 6.9
CVSS Environmental Score: -6.0
Modified Impact Subscore: - 5.0
Overall CVSS Score: -6.0
CVSS v2 Vector: -
AV:L/AC:M/Au:N/C:C/I:C/A:C/E:POC/RL:W/RC:UR/CDP:LM/TD:M/CR:L/IR:L/AR:M
CVSS Base Score: - 6.9
Impact Subscore: - 10.0
Exploitability Subscore: - 3.4
CVSS Temporal Score: - 5.6
CVSS Environmental Score: - 4.8
Modified Impact Subscore: - 8.8
Overall CVSS Score: - 4.8
MITRE CVSS Vector: -
Base Vector: - AV:L/AC:L/Au:N/C:C/I:C/A:C
Base Score: - 7.2
TIMELINE: - Discovery 14th July 2019
: - Initial Report 15th July 2019
: - Case Opened 16th July 2019
: - Added Detail 16th July 2019 *Public Disclosure Date: - Sep 8th 2019 UTC -08:00 (25 days from initial discovery)*
: - Case Closed 19th July 2019
: - Added Detail 19th July 2019 *Public Disclosure Date: - Jul 20th 2019 UTC -08:00 (24 hours from closed case)*
: - We thank the MSRC team for their quick response.
You can’t perform that action at this time.