heap-use-after-free in libxul.so!nsHostResolver::ConditionallyRefreshRecord()
Originally disclosed on Mozilla
- Fixed in 2 months
- Paid in 3 months
- Disclosed after 2 months
Found by the BlackBerry Security Automated Analysis Team's fuzzing framework ALF.
At this time we do not have a test case that will reproduce the issue.
==14607==ERROR: AddressSanitizer: heap-use-after-free on address 0x603001988ce0 at pc 0x7fb8e190676a bp 0x7fff84db1080 sp 0x7fff84db1078 READ of size 4 at 0x603001988ce0 thread T0 #0 0x7fb8e1906769 (libxul.so!nsHostResolver::ConditionallyRefreshRecord(nsHostRecord*, char const*)+0x1a9) Line 368 of "../../dist/include/nsTArray.h" #1 0x7fb8e190533d (libxul.so!nsHostResolver::ResolveHost(char const*, unsigned short, unsigned short, nsResolveHostCallback*)+0xd2d) Line 634 of "/builds/slave/m-in-l64-asan-0000000000000000/build/netwerk/dns/nsHostResolver.cpp" #2 0x7fb8e1917874 (libxul.so!nsDNSService::AsyncResolve(nsACString_internal const&, unsigned int, nsIDNSListener*, nsIEventTarget*, nsICancelable**)+0xb44) Line 675 of "/builds/slave/m-in-l64-asan-0000000000000000/build/netwerk/dns/nsDNSService2.cpp" #3 0x7fb8e182cc9d (libxul.so!nsDNSPrefetch::Prefetch(unsigned short)+0x1dd) Line 64 of "/builds/slave/m-in-l64-asan-0000000000000000/build/netwerk/base/src/nsDNSPrefetch.cpp" #4 0x7fb8e1ae05bf (libxul.so!mozilla::net::nsHttpChannel::BeginConnect()+0x104f) Line 4540 of "/builds/slave/m-in-l64-asan-0000000000000000/build/netwerk/protocol/http/nsHttpChannel.cpp" #5 0x7fb8e1ae15be (libxul.so!mozilla::net::nsHttpChannel::OnProxyAvailable(nsICancelable*, nsIURI*, nsIProxyInfo*, tag_nsresult)+0x10e) Line 4650 of "/builds/slave/m-in-l64-asan-0000000000000000/build/netwerk/protocol/http/nsHttpChannel.cpp" #6 0x7fb8e18b2a25 (libxul.so!nsAsyncResolveRequest::DoCallback()+0x9a5) Line 238 of "/builds/slave/m-in-l64-asan-0000000000000000/build/netwerk/base/src/nsProtocolProxyService.cpp" #7 0x7fb8e1878251 (libxul.so!nsProtocolProxyService::AsyncResolveInternal(nsIURI*, unsigned int, nsIProtocolProxyCallback*, nsICancelable**, bool)+0x8a1) Line 130 of "/builds/slave/m-in-l64-asan-0000000000000000/build/netwerk/base/src/nsProtocolProxyService.cpp" #8 0x7fb8e1ad03d9 (libxul.so!mozilla::net::nsHttpChannel::ResolveProxy()+0x2f9) Line 1776 of "/builds/slave/m-in-l64-asan-0000000000000000/build/netwerk/protocol/http/nsHttpChannel.cpp" #9 0x7fb8e1adf3ea (libxul.so!mozilla::net::nsHttpChannel::AsyncOpen(nsIStreamListener*, nsISupports*)+0x5ea) Line 4444 of "/builds/slave/m-in-l64-asan-0000000000000000/build/netwerk/protocol/http/nsHttpChannel.cpp" #10 0x7fb8e4ea2a59 (libxul.so!mozilla::dom::HTMLTrackElement::LoadResource()+0xad9) Line 247 of "/builds/slave/m-in-l64-asan-0000000000000000/build/content/html/content/src/HTMLTrackElement.cpp" #11 0x7fb8e4ea858c (libxul.so!nsRunnableMethodImpl<void (mozilla::dom::HTMLTrackElement::)(), void, true>::Run()+0x6c) Line 383 of "../../../../dist/include/nsThreadUtils.h" #12 0x7fb8e4e36415 (libxul.so!mozilla::dom::nsSyncSection::Run()+0xa5) Line 693 of "/builds/slave/m-in-l64-asan-0000000000000000/build/content/html/content/src/HTMLMediaElement.cpp" #13 0x7fb8e4007dc8 (libxul.so!nsBaseAppShell::RunSyncSectionsInternal(bool, unsigned int)+0x228) Line 349 of "/builds/slave/m-in-l64-asan-0000000000000000/build/widget/xpwidgets/nsBaseAppShell.cpp" #14 0x7fb8e40085d8 (libxul.so!non-virtual thunk to nsBaseAppShell::AfterProcessNextEvent(nsIThreadInternal, unsigned int, bool)+0x48) Line 90 of "/builds/slave/m-in-l64-asan-0000000000000000/build/widget/xpwidgets/nsBaseAppShell.h" #15 0x7fb8e16f47da (libxul.so!nsThread::ProcessNextEvent(bool, bool*)+0xffa) Line 648 of "/builds/slave/m-in-l64-asan-0000000000000000/build/xpcom/threads/nsThread.cpp" #16 0x7fb8e15ce521 (libxul.so!NS_ProcessNextEvent(nsIThread*, bool)+0xb1) Line 263 of "/builds/slave/m-in-l64-asan-0000000000000000/build/xpcom/glue/nsThreadUtils.cpp" #17 0x7fb8e1eedbd1 (libxul.so!mozilla::ipc::MessagePump::Run(base::MessagePump::Delegate*)+0x311) Line 95 of "/builds/slave/m-in-l64-asan-0000000000000000/build/ipc/glue/MessagePump.cpp" #18 0x7fb8e1e5fd53 (libxul.so!MessageLoop::Run()+0x1c3) Line 226 of "/builds/slave/m-in-l64-asan-0000000000000000/build/ipc/chromium/src/base/message_loop.cc" #19 0x7fb8e400696c (libxul.so!nsBaseAppShell::Run()+0x5c) Line 161 of "/builds/slave/m-in-l64-asan-0000000000000000/build/widget/xpwidgets/nsBaseAppShell.cpp" #20 0x7fb8e6c4c2c6 (libxul.so!nsAppStartup::Run()+0xc6) Line 268 of "/builds/slave/m-in-l64-asan-0000000000000000/build/toolkit/components/startup/nsAppStartup.cpp" #21 0x7fb8e6a646e5 (libxul.so!XREMain::XRE_mainRun()+0x1de5) Line 4023 of "/builds/slave/m-in-l64-asan-0000000000000000/build/toolkit/xre/nsAppRunner.cpp" #22 0x7fb8e6a6561a (libxul.so!XREMain::XRE_main(int, char**, nsXREAppData const*)+0x4fa) Line 4091 of "/builds/slave/m-in-l64-asan-0000000000000000/build/toolkit/xre/nsAppRunner.cpp" #23 0x7fb8e6a6654b (libxul.so!XRE_main+0x3ab) Line 4331 of "/builds/slave/m-in-l64-asan-0000000000000000/build/toolkit/xre/nsAppRunner.cpp" #24 0x459dcd (firefox!main+0x94d) Line 280 of "/builds/slave/m-in-l64-asan-0000000000000000/build/browser/app/nsBrowserApp.cpp" #25 0x7fb8f1c2d76c (libc.so.6!__libc_start_main+0xec) Line 226 of "libc-start.c" #26 0x45934c (firefox!_start+0x28) 0x603001988ce0 is located 0 bytes inside of 24-byte region [0x603001988ce0,0x603001988cf8) freed by thread T3 (Socket Thread) here: #0 0x446255 (firefox!free+0x55) Line 64 of "/builds/slave/moz-toolchain/src/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc" #1 0x7fb8e15c2a5d (libxul.so!nsTArray_base<nsTArrayInfallibleAllocator, nsTArray_CopyWithMemutils>::ShrinkCapacity(unsigned int, unsigned long)+0x14d) Line 212 of "/builds/slave/m-in-l64-asan-0000000000000000/build/xpcom/build/../glue/nsTArray.h" previously allocated by thread T3 (Socket Thread) here: #0 0x446395 (firefox!malloc+0x55) Line 74 of "/builds/slave/moz-toolchain/src/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc" #1 0x7fb8ed308588 (libmozalloc.so!moz_xmalloc+0x8) Line 52 of "/builds/slave/m-in-l64-asan-0000000000000000/build/memory/mozalloc/mozalloc.cpp" Thread T3 (Socket Thread) created by T0 here: #0 0x437801 (firefox!pthread_create+0x71) Line 155 of "/builds/slave/moz-toolchain/src/llvm/projects/compiler-rt/lib/asan/asan_interceptors.cc" #1 0x7fb8ef6d9be5 (libnspr4.so!_PR_CreateThread+0x4a5) Line 445 of "/builds/slave/m-in-l64-asan-0000000000000000/build/nsprpub/pr/src/pthreads/ptthread.c" #2 0x7fb8ef6d9737 (libnspr4.so!PR_CreateThread+0x17) Line 528 of "/builds/slave/m-in-l64-asan-0000000000000000/build/nsprpub/pr/src/pthreads/ptthread.c" Shadow bytes around the buggy address: 0x0c0680329140: fa fa fa fa fa fa fa fa fd fd fd fd fa fa fd fd 0x0c0680329150: fd fd fa fa fa fa fa fa fa fa fd fd fd fd fa fa 0x0c0680329160: fa fa fa fa fa fa 00 00 00 fa fa fa fa fa fa fa 0x0c0680329170: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fd fd 0x0c0680329180: fd fd fa fa fa fa fa fa fa fa fa fa fa fa fa fa =>0x0c0680329190: fa fa fa fa fa fa fd fd fd fa fa fa[fd]fd fd fa 0x0c06803291a0: fa fa fa fa fa fa fa fa fd fd fd fd fa fa 00 00 0x0c06803291b0: 02 fa fa fa fd fd fd fa fa fa fd fd fd fd fa fa 0x0c06803291c0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c06803291d0: fa fa fa fa fa fa fa fa 00 00 00 00 fa fa fd fd 0x0c06803291e0: fd fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Heap right redzone: fb Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack partial redzone: f4 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 ASan internal: fe ==14607==ABORTING
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 high-severity memory corruption bug in Networking. Mozilla made it public on 9 April 2014 as CVE-2014-1532.
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.