Problem:Preventative Security

Attackers are agile, adaptive, and resultsfocused – effective techniques oftendon’t map to security boundaries••

Preventative Strategy – SDL “Find all thebugs” before shipping•

Static Security Boundaries•Focus on component level security –customer assets, configuration, 3rd partysoftware largely out-of-scope•

Investigation of exploit and other attacktechniques out-of-scope•Engineering driven - Focus onabstraction to support scale and process•Mitigation design and offensive securityresearch is ad-hoc and specializedSMarket value for exploits is 10xvulnerabilities – preventative security isfocused on lowest value assetAttackers invest in developing tool setsand libraries – no proactive disruption,reactive response only after attacksThe cost for attackers is unknown – Thecurrent approach to security is abstractedfrom attacks – security effectivenessagainst real attacks unknown“Assume breach” mitigation strategy augments preventative security

Strategy:

Analyze

Build

Evaluate

Analyze comprehensiveset of real world dataIdentify opportunitiesfor tactical attackdisruption and futurestrategic hardening

Security engineers exploremitigation concepts withproduct ownersSecurity engineersprototype or productizemitigation design

Windows OffensiveSecurity Research Team(OSR) evaluatesmitigations and attemptsto identify bypassesMitigation flaws areaddressedExternal Data Sources

Root Cause

ExploitTechniques

AttackSurface

MitigationImpact

Internal Data Sources

Exploit Data

Analysis: High-level vulnerability & exploit trends% of Microsoft RCE & EOP CVEsexploited within 30 days of patch# of Microsoft RCE/EOP CVEs by patch year450400414350# of CVEs300287

250200218199

150

10030015512114113311150
02006 2007 2008 2009 2010 2011 2012 2013 2014 2015

Patch YearTotal

Linear (Total)

100%95%90%85%80%75%70%65%60%55%50%45%40%35%30%25%20%15%10%5%0%

97

24

2006

15793

114

130

6118

2007

19252008

2009

2010

156

43

2011

116266

282

396

21

18

182013

2014

2015

252012Patch YearExploited within 30 days of patch

Not known to be exploited

Vulnerabilities are increasing while evidence of actual exploits is decreasing due to mitigation investments

Analysis:Exploit Techniques used in Public Flash Exploits (2013-2015)
9080

Percentage of Use

7060504030100%

2090%

1080%

0Primitive :: ArbitraryMemory RW :: FlashVector LengthCorruption

Bypass :: ASLR ::Predictable Region ::Heap Spraying

Bypass :: ASLR ::Predictable Region

Bypass :: DEP :: CodeReuse :: ROP :: StackPivot

Primitive :: ArbitraryPrimitive :: Virtual Table Bypass :: DEP :: CodeMemory RW :: ByteArrayPointer OverwriteReuse :: ROP :: Allocate- DomainMemoryExecutable Code ::VirtualProtect

Exploit Technique

70%1224Use After Free160%

1Type Confusion

50%40%

Stack Corruption130%

Heap Corruption

4620%10%

Uninitialized Use

110%2013

2014

2015

Exploit technique trend analysis drives new or improved mitigations

Arbitrary CorruptionSuccess Story:Year7/5/2015Type Protector Shipped

0day exploit in Internet ExplorerNew Internet Explorer Security Feature

11/7/2014CFG Windows 8.1 Shipped (Optional Update)

2/11/2015CFG for Windows 8.1 Shipped (Default)

6/8/20144/23/2014 - 5/1/2014 Use-After-Free hardening v1CVE-2014-1776

4/1/2014

7/1/2014

10/1/2014

8/18/2015CVE-2015-2502

1/1/2015

201311682014

22642015

188

1

10/1/2015MemGC IE 11

8/3/2014Out-of-Date Java Blocking

5/1/2014 - 5/13/20142/12/2014 - 3/11/2014CVE-2014-18152/19/2014 - 3/11/2014CVE-2014-03227/6/2014CVE-2014-0324Use-After-Free hardening v2

1/1/2014

Patched Zero DayRCE CVE RCE CVE

4/1/2015

7/1/2015

10/1/2015

1/1/2016•A focus on mitigations for disruption of invariant techniques used in exploits (ROP, Heap Spraying, UAF)

•In 2015 only 6 days with a known zero day Internet Explorer RCE exploit in-the-wild (down from 45, 135)

•Vulnerability volume has increased but number of zero day exploits has decreased

Assume BreachPrevent BreachThreat modelCode reviewSecurity testingSecurity development lifecycle(SDL)• Detection, Containment, Response,and RecoverRedteams

Assume BreachWar game exercisesCentral security monitorsLive site penetration test

Hypothesis: We can use the assume breach approach to model exploitation anddrive mitigations

“Assume Breach”PWN2OWN & Data Influenced Mitigations

CFG: suppress sensitive APIsFlash: Eliminate RWX ATL thunksJunctions: Prevent sandbox processesfrom creating NTFS junctions – TH1Fonts: Move font parsing to user modesandboxEdge: Prevent content processes fromcreating child processesEdge: Enable win32k system callrestrictions

How do we design effective mitigations proactively?

REDTEAM:Model real-world attacks

Identify security gaps

Demonstrate impact

 Model attacks based onecosystem analysis andthreat intelligence Measure Time-toCompromise (MTTC) /Pwnage (MTTP)

 Break-it-you-bought-itwork with teams toaddress issues

 Evaluate the customerpromises from an attackperspective Identify invarianttechniques for mitigation

 Design mitigations todrive up MTTC/MTTPmetrics

 Provide data sets ofdetection-and-response

 Simulate a real-worldincident response before itoccurs (process, owners,messaging) Enumerate business andlegal risk Attack the full stack inproduction configuration(software, configuration,hardware, OEMs) Provide detection guidancefor Defenders

Assume Breach: An Inside Look at Cloud Service Provider Security - Russinovich Show business value,priorities, andinvestments needs withdemonstrable attacks

REDTEAMBLUETEAM

Offensive security modeling is now a core pillar of Microsoftsecurity strategy

Internet Explorer, Edge, & Chakra

Dave Buchthal, Shubham Chopra, Crispin Cowan, Bo Cupp, Mike Decker, Jim Fox, Matt Gradwohl, John Hazen, C.J.
Hebert, Forbes Higman, Michael Howell, Sermet Iskin, Rick James, Riff Jiang, Venkat Kudallur, Louis Lafreniere, CurtisMan, Ed Maurer, Bruce Morgan, Kamen Moutafov, Zach Murphy, Vidya Nallathimmayyagari, Justin Rogers, ToddSahl, Saranya Kalpathy Seshadri, Bob Schroder, Kirk Sykora, Jason Weber

SmartScreen

Costas Boulis, Ryan Colvin, Jeb Haber, Jeff McKune, Anthony Penta

Visual Studio

Natalia Glagoleva, Shayne Hiet-Block, Jim Hogg, Jim Radigan, Asmaa Taha, YongKang Zhu

Windows & Devices Group (WDG)

Patrick Azzarello, Vassil Bakalov, Jasika Bawa, Thorsten Brunklaus, Brandon Caldwell, Eric Douglas, Dustin Duran,Michael Fortin, Daniel Frampton, Saruhan Karademir, Leif Kornstaedt, Aaron Lahman, Arun Kishan, Ryan Kivett,Daniel Libby, Niraj Majmudar, Dave Midturi, Cody Nicewanner, Roman Porter, Maliha Qureshi, Jordan Rabet, VijeshShetty, Nathan Starr, Brady Thornton, Prabhakar Hampanna Vrushabendrappa, Landy Wang, David Weston, ArdenWhite, Arthur Wongtschowski

Microsoft Security Response Center (MSRC)& C+E Security

Chris Betz, Joe Bialek, Tim Burrell, Suha Can, Sweety Chauhan, Vishal Chauhan, Richard van Eeden, Stephen Fleming,Swamy Shivaganga Nagaraju, Nitin Kumar Goel, John Lambert, Ken Johnson, Matt Miller, Michael Plucinski, ShawnRichardson, Axel Souchet, Gavin Thomas

Microsoft Research (MSR)

Richard Black, Miguel Castro, Manuel Costa, Austin Donnelly100%90% 880% 2170% 060% 950%40%30%1310411420396311012311419181221131324

1331111211182007

2008

2009

1435318261720318153020%10% 80%2006

63221023127282010

2011

2012

111291823

15134531181133

1119262013

Use After Free

Heap Corruption

Other

Heap OOB Read

Uninitialized Use

Stack Corruption

2014

2015

Type Confusion

2016

// 3. Use freed objectp->Foo();// 1. Allocate objectp = new COptionElement();

Attacker reallocates p asa new type// 2. Free objectdelete p;// 2. Zero object, but don’t freeZeroMemory(p, sizeof(T));// 3. Garbage collection phasefrees all objects with no references(stack, registers, heap)TacticApplies toFirst shipped

Eliminate entire classes of vulnerabilities

Edge on Windows 10 and backported to IE9+ on Windows Vista+

July, 2015 (Windows 10 RTM)

Tactic

Applies toFirst shipped

Eliminate entire classes of vulnerabilities

Edge and IE11 on Windows 10 and backported to IE10+ on Windows 7+

July, 2015 (Windows 10 RTM)

No legacy document modesNo legacy script engines (VBScript, JScript)No Vector Markup Language (VML)No ToolbarsNo Browser Helper Objects (BHOs)No ActiveX controls

Edge

22Internet Explorer

348105047100

H1 (Aug 2015 - Jan 2016)H2 (Feb 2016 - Jul 2016)

TacticApplies toFirst shipped

Eliminate entire classes of vulnerabilities

Edge on Windows 10

July, 2015 (Windows 10 RTM)

150

CVE-2003-0344

The Info leak era ofsoftware exploitation

 Trigger stack buffer overrun
 Overwrite return address withpredictable address of a “JMP ESP” Execute shellcode from the stack Arbitrary native code execution  Place array length at a predictablelocation (via heap spray/massage) Modify array length via memorycorruption, enabling arbitrary read/write Use arbitrary read/write to discover DLLbase address Construct ROP payload by searching forcode sequences in the DLL Corrupt C++ virtual table pointer andtrigger virtual method call to first gadget
 Execute ROP payload (typically to makeshellcode executable) Execute arbitrary native code Escape the sandbox (or operate inside it)

2006

2007

2008

2009

2010

2011

2012

2013

2014

2015

2016

 Place array length at a predictable location (via heap spray/massage)

var memory = new Array();function sprayHeap(shellcode, heapSprayAddr, heapBlockSize) {var index;var heapSprayAddr_hi = (heapSprayAddr >> 16).toString(16);var heapSprayAddr_lo = (heapSprayAddr & 0xffff).toString(16);while (heapSprayAddr_hi.length < 4) { heapSprayAddr_hi = "0" + heapSprayAddr_hi; }while (heapSprayAddr_lo.length < 4) { heapSprayAddr_lo = "0" + heapSprayAddr_lo; }var retSlide = unescape("%u" + heapSprayAddr_hi + "%u" + heapSprayAddr_lo);while (retSlide.length < heapBlockSize) { retSlide += retSlide; }retSlide = retSlide.substring(0, heapBlockSize - shellcode.length);var heapBlockCnt = (heapSprayAddr - heapBlockSize) / heapBlockSize;for (index = 0; index < heapBlockCnt; index++) {memory[index] = retSlide + shellcode;}}[1] https://github.com/rapid7/metasploit-framework/blob/master/data/js/memory/heap_spray.js

TacticApplies toFirst shipped

Breaking exploitation techniques

Edge on Windows 10

July, 2015 (Windows 10 RTM)

 Corrupt a C++ virtual table pointer and trigger virtual method call to first gadget

RuntimeCompile timevoid Foo(...) {// SomeFunc is address-taken// and may be called indirectlyObject->FuncPtr = SomeFunc;}

Metadata is automatically added to the image whichidentifies functions that may be called indirectlyvoid Bar(...) {// Compiler-inserted check to// verify call target is valid_guard_check_icall(Object->FuncPtr);
Object->FuncPtr(xyz);}

A lightweight check is inserted prior to indirect callswhich will verify that the call target is valid at runtime

ImageLoad•Update valid call target datawith metadata from PE image

ProcessStart•Map valid call target data

IndirectCall•Perform O(1) validity check•Terminate process if invalidtarget

TacticApplies toFirst shipped

Breaking exploitation techniques

Edge on Windows 10 and IE11 on Windows 8.1+

November, 2014 (Windows 8.1 Update 3) Return addresses are not protected  Valid functions can be called out of context  “Fail-open” design for compatibility

BypassStatusNon-enlightened Just-in-Time (JIT) compilerscan be abused

Mitigated in latest version of Edge on Windows 10 (Chakra, Adobe Flash, and WARP)

Multiple non-instrumented indirect callsreported to our Mitigation Bypass Bounty

Mitigated in latest version of Edge on Windows 10NtContinue/longjmp – mitigated for all CFG enabled apps on Windows 10

Calling sensitive APIs out of context

VirtualProtect/VirtualAlloc – mitigated in latest version of Edge on Windows 10LoadLibrary – mitigated in latest version of Edge on Windows 10 via code integrityWinExec – mitigated in Edge on Windows 10 anniversary edition via child process policy

Corrupting return addresses on the stack

Known limitation that we intend to address with new technology (e.g. with Intel CET) Execute arbitrary native code Only properly signed images can be loaded(Microsoft, WHQL, Store, or DRM signed) Binaries on remote devices (UNC/WebDAV)
cannot be loadedExample of such an attack provided by Yang Yu @ Black Hat USA 2014

TacticApplies toFirst shipped

Breaking exploitation techniques

Edge on Windows 10 and opt-in for other apps

November, 2015 (Windows 10 1511 update) Execute arbitrary native code

Code is immutable

Data cannot become code

Code pages cannot become writable viaVirtualProtect or initially allocated as WX

Data pages cannot become executable viaVirtualProtect or initially allocated as WX

TacticApplies toFirst shipped

Breaking exploitation techniques

Opt-in by process on Windows 8.1+

August, 2013 (Windows 8.1 RTM)

 Hyper Guard• Prevents modification of key MSRs, controlregisters, and descriptor table registers• Example: SMEP cannot be disabled

WindowsSecure Kernel Hypervisor-Enforced Code Integrity (HVCI)• Only properly signed kernel pages canbecome executable Robust even if an attacker can perform arbitraryread/write in VTL0 kernel

https://channel9.msdn.com/Blogs/Seth-Juarez/Windows-10-Virtual-Secure-Mode-with-David-Hepkin

TacticApplies toFirst shipped

Breaking exploitation techniques

Windows 10 with Hyper-V enabled

July, 2015 (Windows 10 RTM)

PML4Directory ptr

Non-paged poolSystemcachePage tablesPaged pool

Non-paged poolSystem cachePage tables…
Paged poolDirectory

TableOffset

System region PML4 entries arerandomized Non-paged pool
 Paged pool
 System cache PFN database

Paged poolNon-pagedpoolSystem cachePage tables

 Page tables … and so on

 Page table self-map and PFN database arerandomized• Dynamic value relocation fixups are used topreserve constant address references SIDT/SGDT kernel address disclosure is preventedwhen Hyper-V is enabled• Hypervisor traps these instructions and hidesthe true descriptor base from CPL>0 GDI shared handle table no longer discloseskernel addresses

TacticApplies toFirst shipped

Breaking exploitation techniques

Windows 10 64-bit kernel

August, 2016 (Windows 10 Anniversary Edition)

Mitigation

How to opt-inControl Flow Guard

Compile and link with /guard:cf (requires Visual Studio 2015 Update 2+)

Image load restrictions••

SetProcessMitigationPolicy with ProcessImageLoadPolicyUpdateProcThreadAttribute with PROC_THREAD_ATTRIBUTE_MITIGATION_POLICY

Code integrity restrictions••

SetProcessMitigationPolicy with ProcessSignaturePolicyUpdateProcThreadAttribute with PROC_THREAD_ATTRIBUTE_MITIGATION_POLICY

Dynamic code restrictions••

SetProcessMitigationPolicy with ProcessDynamicCodePolicyUpdateProcThreadAttribute with PROC_THREAD_ATTRIBUTE_MITIGATION_POLICYChild process restrictions•UpdateProcThreadAttribute with PROC_THREAD_ATTRIBUTE_CHILD_PROCESS_POLICYHVCI•Set HypervisorEnforcedCodeIntegrity (REG_DWORD) to 1 inHKLM\SYSTEM\CurrentControlSet\Control\DeviceGuard

For more information: https://aka.ms/setprocessmitigationpolicy

Win32Process

Store AppAppContainer

User Mode FontDriver HostAppContainer

 Store apps all run within anACEdgeManagerAppContainer

ContentAppContainer

Adobe FlashAppContainer Font parsing is now done inuser mode within an AC Edge uses a multi-AC designfor isolation

System Call Filter

New in Windows 10 AnniversaryEdition Adobe Flash has now beenmoved to its own ACAppContainerProperties

Security boundary

Microsoft will address vulnerabilities that can violate AC security boundary

Capability-based resource accessNetwork, file, registry, and device access are restricted (both read and write)

Locked down process

No symbolic links, reduced attack surface, and various mitigations on by default

 Win32k system call filtering isenabled for Edge

TacticApplies toFirst shipped

Containing damage & preventing persistence

Multiple applications

August, 2012 (Windows 8)

RapidlyRespond• Mobilize engineering teams to quickly understand and develop a fix fora vulnerability

RapidlyProtect• Use SmartScreen and other technologies to protect customers from inthe-wild attacks• Enable Microsoft Active Protection Program (MAPP) partners to protectthe broader ecosystem

RapidlyUpdate• Broadly deploy and install security updates to quickly minimize theaffected population size

Legend

11/15/2014CVE-2014-9163

7/17/2015CVE-2015-5122

2/11/2015CVE-2015-3043

Exploited within 10 days of patch

8/29/2015CVE-2015-5560

Exploited as 0day

2/27/15CVE-2014-4130

Exploited within 30 days of patch

6/16/2015CVE-2015-3104

1/16/2015CVE-2015-0310 2/2/20154/28/2014CVE-2014-0515

9/9/2014CVE-2014-0556

CVE-2015-0313

3/20/2015CVE-2014-0336

April 2014

July 2014

October 2014

January 2015

April 2015

3/26/2016CVE-2016-1001

5/5/2016CVE-2016-41714/4/2016CVE-2016-1019

7/7/201510/13/2015CVE-2015-511912/24/20157/21/2015CVE-2015-7645CVE-2015-8651CVE-2015-16716/27/2015CVE-2015-311312/29/2015

4/17/2015CVE-2015-0359

11/11/2014CVE-2014-8440

3/18/2016CVE-2016-411712/12/15CVE-2015-8446

5/26/2015CVE-2015-3090

10/14/20141/20/2015CVE-2014-0569 CVE-2015-0311

2/4/2014CVE-2014-0497

7/24/2015CVE-2015-2419

CVE-2016-1010

July 2015

October 2015

January 2016

April 2016

 Control-flow Enforcement Technology(CET)• Indirect branch tracking viaENDBRANCH• Return address protection viashadow stack Hardware-assists for helping to mitigatecontrol-flow hijacking & ROP

July 2016

Preview specification:https://software.intel.com/sites/default/files/managed/4d/2a/control-flow-enforcement-technologypreview.pdf

 The number of Microsoft vulnerabilities exploited within 30 days of a patch hascontinued to decline Y/Y despite increases in the number of vulnerabilities beingaddressed each year In the last two years, no zero day exploits for Microsoft RCE vulnerabilities have beenfound in-the-wild that work against Internet Explorer 11 on Windows 8.1+

 Since releasing Edge one year ago, there have been no zero day exploits found in-thewild targeting EdgeMicrosoft Edge RCE on WIP Bounty Program• Submit a remote code execution (RCE) vulnerability for Microsoft Edge• The bugs reported should be on the most recent Windows Insider Preview slow build• Program duration is August 4 2016 to May 15 2017Only eligible reported on the latest WIP slow builds will be paid a bounty• This continues our effort in finding bugs in the earlier stages of development• Microsoft will pay up to $1,500 for the first external report received on an internallyknown issue• Microsoft will pay up to $15,000 on a previously unknown RCE on EdgeFunctioningProof ofExploitconceptRequiredRequiredRemote Code Execution inRequiredMicrosoft Edge on recent NoNobuilds of WIP slowRequired

Vulnerability typeReportQualityHighHigh

Payout range(USD) *Up to $15,000Up to $6,000Low

Up to $1,500