Skip to content
Memory corruption Disclosed report CVE-2014-1544

heap-use-after-free in libnss3.so!CERT_DestroyCertificate

Tyson Smith Follow

Originally disclosed on Mozilla

  • Fixed in 5 months
  • Paid in 6 months
  • Disclosed after 5 months

Found by the BlackBerry Security Automated Analysis Team's fuzzing framework ALF.

At this time we are unable to create a test case that will reproduce the issue. However we do see it during our analysis a couple times a day so once a build with a fix is available we should be able to verify that this issue has been resolved.

==5650==ERROR: AddressSanitizer: heap-use-after-free on address 0x61d0013a9f38 at pc 0x7f2091221f48 bp 0x7f207adcd0d0 sp 0x7f207adcd0c8 READ of size 8 at 0x61d0013a9f38 thread T3 (Socket Thread) #0 0x7f2091221f47 (libnss3.so!CERT_DestroyCertificate+0x57) Line 791 of "stanpcertdb.c" #1 0x7f208fb41b08 (libssl3.so!ssl3_DestroySSL3Info+0xd8) Line 9635 of "ssl3con.c" #2 0x7f208fb777ce (libssl3.so!ssl_DestroySocketContents+0x1e) Line 335 of "sslsock.c" #3 0x7f208fb77527 (libssl3.so!ssl_FreeSocket+0x187) Line 398 of "sslsock.c" #4 0x7f208fb5c129 (libssl3.so!ssl_DefClose+0xb9) Line 205 of "ssldef.c" #5 0x7f208a2baa20 (libxul.so!nsNSSSocketInfo::CloseSocketAndDestroy(nsNSSShutDownPreventionLock const&)+0xe0) Line 843 of "/builds/slave/m-in-l64-asan-0000000000000000/build/security/manager/ssl/src/nsNSSIOLayer.cpp" #6 0x7f208a2bc873 (libxul.so!nsSSLIOLayerClose(PRFileDesc*)+0x93) Line 821 of "/builds/slave/m-in-l64-asan-0000000000000000/build/security/manager/ssl/src/nsNSSIOLayer.cpp" #7 0x7f2084fa9f72 (libxul.so!nsSocketTransport::ReleaseFD_Locked(PRFileDesc*)+0x272) Line 1604 of "/builds/slave/m-in-l64-asan-0000000000000000/build/netwerk/base/src/nsSocketTransport2.cpp" #8 0x7f2084fb5d8e (libxul.so!nsSocketTransport::OnSocketDetached(PRFileDesc*)+0x3ce) Line 1867 of "/builds/slave/m-in-l64-asan-0000000000000000/build/netwerk/base/src/nsSocketTransport2.cpp" #9 0x7f2084fbbe0f (libxul.so!nsSocketTransportService::DetachSocket(nsSocketTransportService::SocketContext*, nsSocketTransportService::SocketContext*)+0x12f) Line 181 of "/builds/slave/m-in-l64-asan-0000000000000000/build/netwerk/base/src/nsSocketTransportService2.cpp" #10 0x7f2084fc0757 (libxul.so!nsSocketTransportService::DoPollIteration(bool)+0x9e7) Line 862 of "/builds/slave/m-in-l64-asan-0000000000000000/build/netwerk/base/src/nsSocketTransportService2.cpp" #11 0x7f2084fbf94f (libxul.so!nsSocketTransportService::Run()+0x31f) Line 684 of "/builds/slave/m-in-l64-asan-0000000000000000/build/netwerk/base/src/nsSocketTransportService2.cpp" #12 0x7f2084fc1139 (libxul.so!non-virtual thunk to nsSocketTransportService::Run()+0x9) Line 728 of "/builds/slave/m-in-l64-asan-0000000000000000/build/netwerk/base/src/nsSocketTransportService2.cpp" #13 0x7f2084ed9cf7 (libxul.so!nsThread::ProcessNextEvent(bool, bool*)+0xbd7) Line 637 of "/builds/slave/m-in-l64-asan-0000000000000000/build/xpcom/threads/nsThread.cpp" #14 0x7f2084db26d1 (libxul.so!NS_ProcessNextEvent(nsIThread*, bool)+0xb1) Line 263 of "/builds/slave/m-in-l64-asan-0000000000000000/build/xpcom/glue/nsThreadUtils.cpp" #15 0x7f20856d484f (libxul.so!mozilla::ipc::MessagePumpForNonMainThreads::Run(base::MessagePump::Delegate*)+0x1cf) Line 301 of "/builds/slave/m-in-l64-asan-0000000000000000/build/ipc/glue/MessagePump.cpp" #16 0x7f20856452f3 (libxul.so!MessageLoop::Run()+0x1c3) Line 226 of "/builds/slave/m-in-l64-asan-0000000000000000/build/ipc/chromium/src/base/message_loop.cc" #17 0x7f2084ed69a2 (libxul.so!nsThread::ThreadFunc(void*)+0x192) Line 258 of "/builds/slave/m-in-l64-asan-0000000000000000/build/xpcom/threads/nsThread.cpp" #18 0x7f2091dd7c49 (libnspr4.so!_pt_root+0x4e9) Line 205 of "/builds/slave/m-in-l64-asan-0000000000000000/build/nsprpub/pr/src/pthreads/ptthread.c" #19 0x44cf03 (firefox!__asan::AsanThread::ThreadStart(unsigned long)+0x83) Line 138 of "/builds/slave/moz-toolchain/src/llvm/projects/compiler-rt/lib/asan/asan_thread.cc" #20 0x7f20963c3e99 (libpthread.so.0!start_thread+0xd9) Line 308 of "pthread_create.c" #21 0x7f20954ce3fc (libc.so.6!clone+0x6c) Line 112 of "../sysdeps/unix/sysv/linux/x86_64/clone.S" 0x61d0013a9f38 is located 696 bytes inside of 2048-byte region [0x61d0013a9c80,0x61d0013aa480) freed by thread T0 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 0x7f209195c7c3 (libplds4.so!PL_FinishArenaPool+0x43) Line 277 of "/builds/slave/m-in-l64-asan-0000000000000000/build/nsprpub/lib/ds/plarena.c" #2 0x7f20891da741 (libxul.so!PresShell::Paint(nsView*, nsRegion const&, unsigned int)+0xe11) Line 5847 of "/builds/slave/m-in-l64-asan-0000000000000000/build/layout/base/nsPresShell.cpp" #3 0x7f208817a87c (libxul.so!nsViewManager::ProcessPendingUpdatesForView(nsView*, bool)+0x3fc) Line 420 of "/builds/slave/m-in-l64-asan-0000000000000000/build/view/src/nsViewManager.cpp" #4 0x7f20891fe1d0 (libxul.so!nsRefreshDriver::Tick(long, mozilla::TimeStamp)+0x2ba0) Line 1207 of "/builds/slave/m-in-l64-asan-0000000000000000/build/layout/base/nsRefreshDriver.cpp" #5 0x7f2089202030 (libxul.so!mozilla::RefreshDriverTimer::Tick()+0x1f0) Line 168 of "/builds/slave/m-in-l64-asan-0000000000000000/build/layout/base/nsRefreshDriver.cpp" #6 0x7f2084ee1d83 (libxul.so!nsTimerImpl::Fire()+0x6b3) Line 551 of "/builds/slave/m-in-l64-asan-0000000000000000/build/xpcom/threads/nsTimerImpl.cpp" #7 0x7f2084ee24e6 (libxul.so!nsTimerEvent::Run()+0x66) Line 635 of "/builds/slave/m-in-l64-asan-0000000000000000/build/xpcom/threads/nsTimerImpl.cpp" #8 0x7f2084db26d1 (libxul.so!NS_ProcessNextEvent(nsIThread*, bool)+0xb1) Line 263 of "/builds/slave/m-in-l64-asan-0000000000000000/build/xpcom/glue/nsThreadUtils.cpp" #9 0x7f20856d3a60 (libxul.so!mozilla::ipc::MessagePump::Run(base::MessagePump::Delegate*)+0x2f0) Line 134 of "/builds/slave/m-in-l64-asan-0000000000000000/build/ipc/glue/MessagePump.cpp" #10 0x7f20856452f3 (libxul.so!MessageLoop::Run()+0x1c3) Line 226 of "/builds/slave/m-in-l64-asan-0000000000000000/build/ipc/chromium/src/base/message_loop.cc" #11 0x7f208780da5c (libxul.so!nsBaseAppShell::Run()+0x5c) Line 161 of "/builds/slave/m-in-l64-asan-0000000000000000/build/widget/xpwidgets/nsBaseAppShell.cpp" #12 0x7f208a316bda (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" #13 0x7f208a317b0b (libxul.so!XRE_main+0x3ab) Line 4331 of "/builds/slave/m-in-l64-asan-0000000000000000/build/toolkit/xre/nsAppRunner.cpp" #14 0x459dcd (firefox!main+0x94d) Line 280 of "/builds/slave/m-in-l64-asan-0000000000000000/build/browser/app/nsBrowserApp.cpp" #15 0x7f20953fb76c (libc.so.6!__libc_start_main+0xec) Line 226 of "libc-start.c" 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 0x7f209195bd8d (libplds4.so!PL_ArenaAllocate+0x1ed) Line 203 of "/builds/slave/m-in-l64-asan-0000000000000000/build/nsprpub/lib/ds/plarena.c" 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 0x7f2091dd3be5 (libnspr4.so!_PR_CreateThread+0x4a5) Line 445 of "/builds/slave/m-in-l64-asan-0000000000000000/build/nsprpub/pr/src/pthreads/ptthread.c" #2 0x7f2091dd3737 (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: 0x0c3a8026d390: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c3a8026d3a0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c3a8026d3b0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c3a8026d3c0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c3a8026d3d0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd =>0x0c3a8026d3e0: fd fd fd fd fd fd fd[fd]fd fd fd fd fd fd fd fd 0x0c3a8026d3f0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c3a8026d400: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c3a8026d410: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c3a8026d420: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c3a8026d430: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 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 ==5650==ABORTING

The original report as published on Mozilla's Bugzilla, by Tyson Smith. Images and videos are our own copies; raw HTML is shown as text. View it on Mozilla's Bugzilla.

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 Libraries. Mozilla made it public on 26 June 2014 as CVE-2014-1544.

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.

More by Tyson Smith

View all

5 more disclosed reports, best first.

More from Mozilla

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.