Use-After-Free in WorkerPrivateParent<mozilla::dom::workers::WorkerPrivate>::DispatchPrivate()
Originally disclosed on Mozilla
- Fixed in 17 days
- Paid in 22 days
- Disclosed after 17 days
Created attachment 8511613 wsserver_DispatchPrivate.js
User Agent: Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.36 Safari/537.36
Steps to reproduce:
Run websocket server wsserver_DispatchPrivate.js with Node.js module websocket, enter http://localhost:12345/ in Firefox browser.
Firefox Version: 36.0a1 (2014-10-25) Operating System: Windows 8, 64 bit
Test case: On server side, it accepts web socket at port 12345 with protocol "wsm1-protocol"; On client side, it initiate a web socket to port 12345 with protocol "wsm1-protocol" in web worker, and auto refresh.
Client and server side code have been combined in a single node.js source file wsserver_DispatchPrivate.js.
Actual results:
Firefox crashes at random addresses in WorkerPrivateParentmozilla::dom::workers::WorkerPrivate::DispatchPrivate(). The 5a5a5a5a pattern indicates that it may be a Use After Free.
(f9c.8a4): Access violation - code c0000005 (first chance) First chance exceptions are reported before any exception handling. This exception may be expected and handled. eax=1149d094 ebx=1b18c000 ecx=1b18c000 edx=0966f580 esi=5a5a5a5a edi=00000000 eip=0f8350c8 esp=07bbeb0c ebp=07bbeb1c iopl=0 nv up ei pl zr na pe nc cs=0023 ss=002b ds=002b es=002b fs=0053 gs=002b efl=00010246 xul!mozilla::dom::workers::WorkerPrivateParentmozilla::dom::workers::WorkerPrivate::DispatchPrivate+0xc: 0f8350c8 ff36 push dword ptr [esi] ds:002b:5a5a5a5a=???????? 0:008> !analyze -v
-
* -
Exception Analysis * -
*
*** ERROR: Symbol file could not be found. Defaulted to export symbols for C:\Windows\SysWOW64\SogouPy.ime - *** ERROR: Symbol file could not be found. Defaulted to export symbols for C:\Windows\SysWOW64\atidxx32.dll - *** ERROR: Symbol file could not be found. Defaulted to export symbols for C:\Program Files (x86)\360\360Safe\safemon\urlproc.dll - *** ERROR: Symbol file could not be found. Defaulted to export symbols for C:\Program Files (x86)\360\360Safe\360NetBase.dll -
FAULTING_IP: xul!mozilla::dom::workers::WorkerPrivateParentmozilla::dom::workers::WorkerPrivate::DispatchPrivate+c [c:\builds\moz2_slave\m-cen-w32-ntly-000000000000000\build\dom\workers\workerprivate.cpp @ 2104] 0f8350c8 ff36 push dword ptr [esi]
EXCEPTION_RECORD: ffffffff -- (.exr 0xffffffffffffffff) ExceptionAddress: 0f8350c8 (xul!mozilla::dom::workers::WorkerPrivateParentmozilla::dom::workers::WorkerPrivate::DispatchPrivate+0x0000000c) ExceptionCode: c0000005 (Access violation) ExceptionFlags: 00000000 NumberParameters: 2 Parameter[0]: 00000000 Parameter[1]: 5a5a5a5a Attempt to read from address 5a5a5a5a
CONTEXT: 00000000 -- (.cxr 0x0;r) eax=1149d094 ebx=1b18c000 ecx=1b18c000 edx=0966f580 esi=5a5a5a5a edi=00000000 eip=0f8350c8 esp=07bbeb0c ebp=07bbeb1c iopl=0 nv up ei pl zr na pe nc cs=0023 ss=002b ds=002b es=002b fs=0053 gs=002b efl=00010246 xul!mozilla::dom::workers::WorkerPrivateParentmozilla::dom::workers::WorkerPrivate::DispatchPrivate+0xc: 0f8350c8 ff36 push dword ptr [esi] ds:002b:5a5a5a5a=????????
FAULTING_THREAD: 000008a4
PROCESS_NAME: firefox.exe
ERROR_CODE: (NTSTATUS) 0xc0000005 - The instruction at 0x%08lx referenced memory at 0x%08lx. The memory could not be %s.
EXCEPTION_CODE: (NTSTATUS) 0xc0000005 - The instruction at 0x%08lx referenced memory at 0x%08lx. The memory could not be %s.
EXCEPTION_PARAMETER1: 00000000
EXCEPTION_PARAMETER2: 5a5a5a5a
READ_ADDRESS: 5a5a5a5a
FOLLOWUP_IP: xul!mozilla::dom::workers::WorkerPrivateParentmozilla::dom::workers::WorkerPrivate::DispatchPrivate+c [c:\builds\moz2_slave\m-cen-w32-ntly-000000000000000\build\dom\workers\workerprivate.cpp @ 2104] 0f8350c8 ff36 push dword ptr [esi]
NTGLOBALFLAG: 0
APPLICATION_VERIFIER_FLAGS: 0
APP: firefox.exe
ANALYSIS_VERSION: 6.3.9600.17029 (debuggers(dbg).140219-1702) x86fre
BUGCHECK_STR: APPLICATION_FAULT_INVALID_POINTER_READ_FILL_PATTERN_5a5a5a5a
PRIMARY_PROBLEM_CLASS: INVALID_POINTER_READ_FILL_PATTERN_5a5a5a5a
DEFAULT_BUCKET_ID: INVALID_POINTER_READ_FILL_PATTERN_5a5a5a5a
LAST_CONTROL_TRANSFER: from 0f6a950c to 0f8350c8
STACK_TEXT:
07bbeb1c 0f6a950c 0963fa00 00000000 0963fa00 xul!mozilla::dom::workers::WorkerPrivateParentmozilla::dom::workers::WorkerPrivate::DispatchPrivate+0xc
07bbeb38 0f6a920a 1c7753b8 0963fa00 6d2e5f29 xul!mozilla::dom::workers::WorkerRunnable::DispatchInternal+0x19
07bbeb74 108ac563 00000000 00000000 1aa9c868 xul!mozilla::dom::workers::WorkerRunnable::Dispatch+0xf8
07bbeb88 1037b705 1c7753b8 0966f580 00000000 xul!mozilla::dom::WebSocketImpl::Dispatch+0x67
07bbeba8 1037a60e 00000000 1bb46960 09635bc0 xul!mozilla::net::WebSocketChannel::OnOutputStreamReady+0x185
07bbebc0 1037a7d4 1aa9c9c0 09635e30 1aa9c800 xul!mozilla::net::WebSocketChannel::EnqueueOutgoingMessage+0x4a
07bbebdc 1037cb37 07bbec5e 00000000 00000000 xul!mozilla::net::WebSocketChannel::GeneratePong+0x7b
07bbec30 1037b420 09bbec5c 00000002 029405c0 xul!mozilla::net::WebSocketChannel::ProcessInput+0x65e
07bbf460 0f836bd6 1aa9c864 1bb46940 1c75fa60 xul!mozilla::net::WebSocketChannel::OnInputStreamReady+0x136
07bbf474 0f6eecfc 1c75fa60 029405c0 0294470c xul!nsInputStreamReadyEvent::Run+0x1e
07bbf57c 0f6ee240 029405c0 00000001 07bbf59b xul!nsThread::ProcessNextEvent+0x6f1
07bbf590 0f753a3a 019405c0 00000001 00000000 xul!NS_ProcessNextEvent+0x1b
07bbf5b4 0f6eecfc 0194470c 0294b3c0 029cd610 xul!nsSocketTransportService::Run+0xd1
07bbf6bc 0f6ee240 029405c0 00000000 07bbf6db xul!nsThread::ProcessNextEvent+0x6f1
07bbf6d0 0fb631a1 019405c0 00000000 0294b3c0 xul!NS_ProcessNextEvent+0x1b
07bbf6fc 0fb56c5d 0294b3c0 555a49ca 029405c0 xul!mozilla::ipc::MessagePumpForNonMainThreads::Run+0x7f
07bbf734 0fb56a72 0294b3c0 00000001 02911500 xul!MessageLoop::RunHandler+0x53
07bbf754 0f9ee858 02906350 02911530 02906350 xul!MessageLoop::Run+0x19
07bbf76c 6bce3559 029405c0 00000000 05b941a0 xul!nsThread::ThreadFunc+0x87
07bbf788 6bcd2d9f 02911530 07bbf7cc 6be7c01d nss3!_PR_NativeRunThread+0x149
07bbf794 6be7c01d 02911530 2e0ac485 00000000 nss3!pr_root+0xf
07bbf7cc 6be7c001 00000000 07bbf7e4 75b686e3 MSVCR120!_callthreadstartex+0x1b
07bbf7d8 75b686e3 05b93dd8 07bbf828 778ebe19 MSVCR120!_threadstartex+0x7c
07bbf7e4 778ebe19 05b93dd8 32b89343 00000000 KERNEL32!BaseThreadInitThunk+0xe
07bbf828 778ebdec 6be7bfb4 05b93dd8 ffffffff ntdll!__RtlUserThreadStart+0x72
07bbf840 00000000 6be7bfb4 05b93dd8 00000000 ntdll!_RtlUserThreadStart+0x1b
STACK_COMMAND: .cxr 0x0 ; kb
FAULTING_SOURCE_LINE: c:\builds\moz2_slave\m-cen-w32-ntly-000000000000000\build\dom\workers\workerprivate.cpp
FAULTING_SOURCE_FILE: c:\builds\moz2_slave\m-cen-w32-ntly-000000000000000\build\dom\workers\workerprivate.cpp
FAULTING_SOURCE_LINE_NUMBER: 2104
SYMBOL_STACK_INDEX: 0
SYMBOL_NAME: xul!mozilla::dom::workers::WorkerPrivateParentmozilla::dom::workers::WorkerPrivate::DispatchPrivate+c
FOLLOWUP_NAME: MachineOwner
MODULE_NAME: xul
IMAGE_NAME: xul.dll
DEBUG_FLR_IMAGE_TIMESTAMP: 544b8df9
FAILURE_BUCKET_ID: INVALID_POINTER_READ_FILL_PATTERN_5a5a5a5a_c0000005_xul.dll!mozilla::dom::workers::WorkerPrivateParent_mozilla::dom::workers::WorkerPrivate_::DispatchPrivate
BUCKET_ID: APPLICATION_FAULT_INVALID_POINTER_READ_FILL_PATTERN_5a5a5a5a_xul!mozilla::dom::workers::WorkerPrivateParent_mozilla::dom::workers::WorkerPrivate_::DispatchPrivate+c
ANALYSIS_SOURCE: UM
FAILURE_ID_HASH_STRING: um:invalid_pointer_read_fill_pattern_5a5a5a5a_c0000005_xul.dll!mozilla::dom::workers::workerprivateparent_mozilla::dom::workers::workerprivate_::dispatchprivate
FAILURE_ID_HASH: {4b223de6-1d8e-0720-cc95-f78d04301aaa}
Followup: MachineOwner
Expected results:
Should not crash.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
What is known
A critical-severity memory corruption bug in DOM: Workers. Mozilla made it public on 12 November 2014.
About Memory corruption
Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
What is Memory corruption?
Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.