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

heap-buffer-overflow in mozilla::dom::AudioBufferSourceNodeEngine::CopyFromInputBuffer

Atte Kettunen Follow

Originally disclosed on Mozilla

  • Fixed in 29 days
  • Paid in 34 days
  • Disclosed after 29 days

Created attachment 8434019 Repro-file

Tested on:

OS: Ubuntu 12.04

Firefox: ASAN build from https://ftp.mozilla.org/pub/mozilla.org/firefox/tinderbox-builds/mozilla-central-linux64-asan/1401807026/

ASAN-report:

==6994==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x7f37adc1aea0 at pc 0x43906e bp 0x7f37b1d150e0 sp 0x7f37b1d14898 READ of size 17179677220 at 0x7f37adc1aea0 thread T27 (MediaStreamGrph) #0 0x43906d in __interceptor_memcpy asan_rtl #1 0x7f37dc4b8e09 in mozilla::dom::AudioBufferSourceNodeEngine::CopyFromInputBuffer(mozilla::AudioChunk*, unsigned int, unsigned long, unsigned int) /home/attekett/firefox/content/media/webaudio/AudioBufferSourceNode.cpp:222 #2 0x7f37dc4b830a in mozilla::dom::AudioBufferSourceNodeEngine::ProcessBlock(mozilla::AudioNodeStream*, mozilla::AudioChunk const&, mozilla::AudioChunk*, bool*) /home/attekett/firefox/content/media/webaudio/AudioBufferSourceNode.cpp:470 #3 0x7f37dc3b0d10 in mozilla::AudioNodeStream::ProcessInput(long, long, unsigned int) /home/attekett/firefox/content/media/AudioNodeStream.cpp:468 #4 0x7f37dc419781 in mozilla::MediaStreamGraphImpl::ProduceDataForStreamsBlockByBlock(unsigned int, int, long, long) /home/attekett/firefox/content/media/MediaStreamGraph.cpp:1192 #5 0x7f37dc41a83a in mozilla::MediaStreamGraphImpl::RunThread() /home/attekett/firefox/content/media/MediaStreamGraph.cpp:1356 #6 0x7f37dc435fee in mozilla::(anonymous namespace)::MediaStreamGraphInitThreadRunnable::Run() /home/attekett/firefox/content/media/MediaStreamGraph.cpp:1512 #7 0x7f37d8aade08 in nsThread::ProcessNextEvent(bool, bool*) /home/attekett/firefox/xpcom/threads/nsThread.cpp:766 #8 0x7f37d8992e09 in NS_ProcessNextEvent(nsIThread*, bool) /home/attekett/firefox/xpcom/glue/nsThreadUtils.cpp:263 #9 0x7f37d92b826c in mozilla::ipc::MessagePumpForNonMainThreads::Run(base::MessagePump::Delegate*) /home/attekett/firefox/ipc/glue/MessagePump.cpp:307 #10 0x7f37d92461fe in MessageLoop::RunInternal() /home/attekett/firefox/ipc/chromium/src/base/message_loop.cc:229 #11 0x7f37d8aab375 in nsThread::ThreadFunc(void*) /home/attekett/firefox/xpcom/threads/nsThread.cpp:346 #12 0x7f37e4152e95 in _pt_root /home/attekett/firefox/nsprpub/pr/src/pthreads/ptthread.c:212 #13 0x7f37e766ae99 in start_thread ??:0 #14 0x7f37e67753fc in ?? ??:0

0x7f37adc1aea0 is located 0 bytes to the right of 149152-byte region [0x7f37adbf6800,0x7f37adc1aea0) allocated by thread T0 here: #0 0x45f9d5 in __interceptor_calloc asan_rtl #1 0x7f37df8b439a in js_calloc(unsigned long) /home/attekett/firefox/objdir-ff-asan/js/src/../../dist/include/js/Utility.h:104 #2 0x7f37df8b5563 in js::ArrayBufferObject::stealContents(JSContext*, JS::Handlejs::ArrayBufferObject*) /home/attekett/firefox/js/src/vm/ArrayBufferObject.cpp:750 #3 0x7f37df8b9d5f in JS_StealArrayBufferContents(JSContext*, JS::Handle<JSObject*>) /home/attekett/firefox/js/src/vm/ArrayBufferObject.cpp:1124 #4 0x7f37dc48dd87 in mozilla::dom::StealJSArrayDataIntoThreadSharedFloatArrayBufferList(JSContext*, nsTArray<JSObject*> const&) /home/attekett/firefox/content/media/webaudio/AudioBuffer.cpp:223 #5 0x7f37dc49094d in mozilla::dom::AudioBufferSourceNode::SendBufferParameterToStream(JSContext*) /home/attekett/firefox/content/media/webaudio/AudioBufferSourceNode.cpp:633 #6 0x7f37da247406 in mozilla::dom::AudioBufferSourceNode::SetBuffer(JSContext*, mozilla::dom::AudioBuffer*) /home/attekett/firefox/objdir-ff-asan/dom/bindings/../../dist/include/mozilla/dom/AudioBufferSourceNode.h:56 #7 0x7f37db141107 in mozilla::dom::GenericBindingSetter(JSContext*, unsigned int, JS::Value*) /home/attekett/firefox/dom/bindings/BindingUtils.cpp:2316 #8 0x7f37df9e9c13 in js::CallJSNative(JSContext*, bool ()(JSContext, unsigned int, JS::Value*), JS::CallArgs const&) /home/attekett/firefox/js/src/jscntxtinlines.h:239 #9 0x7f37df974ace in js::Invoke(JSContext*, JS::Value const&, JS::Value const&, unsigned int, JS::Value const*, JS::MutableHandleJS::Value) /home/attekett/firefox/js/src/vm/Interpreter.cpp:511 #10 0x7f37df9eb9dd in js::InvokeGetterOrSetter(JSContext*, JSObject*, JS::Value, unsigned int, JS::Value*, JS::MutableHandleJS::Value) /home/attekett/firefox/js/src/vm/Interpreter.cpp:583 #11 0x7f37df7ad310 in js::Shape::set(JSContext*, JS::Handle<JSObject*>, JS::Handle<JSObject*>, bool, JS::MutableHandleJS::Value) /home/attekett/firefox/js/src/vm/Shape-inl.h:95 #12 0x7f37df7aea18 in bool js::baseops::SetPropertyHelper<(js::ExecutionMode)0>(js::ExecutionModeTraits<(js::ExecutionMode)0>::ContextType, JS::Handle<JSObject*>, JS::Handle<JSObject*>, JS::Handle<jsid>, js::baseops::QualifiedBool, JS::MutableHandleJS::Value, bool) /home/attekett/firefox/js/src/jsobj.cpp:5069 #13 0x7f37df9cf7cb in SetPropertyOperation(JSContext*, JS::Handle<JSScript*>, unsigned char*, JS::HandleJS::Value, JS::HandleJS::Value) /home/attekett/firefox/js/src/vm/Interpreter.cpp:314 #14 0x7f37df9c056c in js::RunScript(JSContext*, js::RunState&) /home/attekett/firefox/js/src/vm/Interpreter.cpp:402 #15 0x7f37df9ea161 in js::Invoke(JSContext*, JS::CallArgs, js::MaybeConstruct) /home/attekett/firefox/js/src/vm/Interpreter.cpp:474 #16 0x7f37df974ace in js::Invoke(JSContext*, JS::Value const&, JS::Value const&, unsigned int, JS::Value const*, JS::MutableHandleJS::Value) /home/attekett/firefox/js/src/vm/Interpreter.cpp:511 #17 0x7f37df608875 in JS::Call(JSContext*, JS::HandleJS::Value, JS::HandleJS::Value, JS::HandleValueArray const&, JS::MutableHandleJS::Value) /home/attekett/firefox/js/src/jsapi.cpp:5210 #18 0x7f37da6ce4cd in mozilla::dom::Function::Call(JSContext*, JS::HandleJS::Value, nsTArrayJS::Value const&, mozilla::ErrorResult&) /home/attekett/firefox/objdir-ff-asan/dom/bindings/./FunctionBinding.cpp:34 #19 0x7f37db771ebe in JS::Value mozilla::dom::Function::Call<nsCOMPtr<nsISupports> >(nsCOMPtr<nsISupports> const&, nsTArrayJS::Value const&, mozilla::ErrorResult&, mozilla::dom::CallbackObject::ExceptionHandling) /home/attekett/firefox/objdir-ff-asan/dom/base/../../dist/include/mozilla/dom/FunctionBinding.h:58 #20 0x7f37db747dd0 in nsGlobalWindow::RunTimeoutHandler(nsTimeout*, nsIScriptContext*) /home/attekett/firefox/dom/base/nsGlobalWindow.cpp:12106 #21 0x7f37db72c23a in nsGlobalWindow::RunTimeout(nsTimeout*) /home/attekett/firefox/dom/base/nsGlobalWindow.cpp:12330 #22 0x7f37db74755f in nsGlobalWindow::TimerCallback(nsITimer*, void*) /home/attekett/firefox/dom/base/nsGlobalWindow.cpp:12576 #23 0x7f37d8ab5390 in nsTimerImpl::Fire() /home/attekett/firefox/xpcom/threads/nsTimerImpl.cpp:609 #24 0x7f37d8ab594e in nsTimerEvent::Run() /home/attekett/firefox/xpcom/threads/nsTimerImpl.cpp:702 #25 0x7f37d8aade08 in nsThread::ProcessNextEvent(bool, bool*) /home/attekett/firefox/xpcom/threads/nsThread.cpp:766 #26 0x7f37d8992e09 in NS_ProcessNextEvent(nsIThread*, bool) /home/attekett/firefox/xpcom/glue/nsThreadUtils.cpp:263 #27 0x7f37d92b7384 in mozilla::ipc::MessagePump::Run(base::MessagePump::Delegate*) /home/attekett/firefox/ipc/glue/MessagePump.cpp:136 #28 0x7f37d92461fe in MessageLoop::RunInternal() /home/attekett/firefox/ipc/chromium/src/base/message_loop.cc:229 #29 0x7f37db35be2f in nsBaseAppShell::Run() /home/attekett/firefox/widget/xpwidgets/nsBaseAppShell.cpp:164

Thread T27 (MediaStreamGrph) created by T0 here: #0 0x423626 in __interceptor_pthread_create asan_rtl #1 0x7f37e414f81d in _PR_CreateThread /home/attekett/firefox/nsprpub/pr/src/pthreads/ptthread.c:453 #2 0x7f37e414f39a in PR_CreateThread /home/attekett/firefox/nsprpub/pr/src/pthreads/ptthread.c:544 #3 0x7f37d8aac31a in nsThread::Init() /home/attekett/firefox/xpcom/threads/nsThread.cpp:423 #4 0x7f37d8ab06a8 in nsThreadManager::NewThread(unsigned int, unsigned int, nsIThread**) /home/attekett/firefox/xpcom/threads/nsThreadManager.cpp:248 #5 0x7f37d8992605 in NS_NewThread(nsIThread**, nsIRunnable*, unsigned int) /home/attekett/firefox/xpcom/glue/nsThreadUtils.cpp:67 #6 0x7f37dc41ba5c in tag_nsresult NS_NewNamedThread<16ul>(char const (&) [16ul], nsIThread**, nsIRunnable*, unsigned int) /home/attekett/firefox/objdir-ff-asan/content/media/../../dist/include/nsThreadUtils.h:75 #7 0x7f37dc435c10 in mozilla::(anonymous namespace)::MediaStreamGraphStableStateRunnable::Run() /home/attekett/firefox/content/media/MediaStreamGraph.cpp:1580 #8 0x7f37db35ce0d in nsCOMPtr_base::assign_assuming_AddRef(nsISupports*) /home/attekett/firefox/objdir-ff-asan/widget/xpwidgets/../../dist/include/nsCOMPtr.h:486 #9 0x7f37db35d3cd in nsBaseAppShell::AfterProcessNextEvent(nsIThreadInternal*, unsigned int, bool) /home/attekett/firefox/widget/xpwidgets/nsBaseAppShell.h:93 #10 0x7f37d8aae2ab in nsThread::ProcessNextEvent(bool, bool*) /home/attekett/firefox/xpcom/threads/nsThread.cpp:780 #11 0x7f37d8992e09 in NS_ProcessNextEvent(nsIThread*, bool) /home/attekett/firefox/xpcom/glue/nsThreadUtils.cpp:263 #12 0x7f37d92b73a5 in mozilla::ipc::MessagePump::Run(base::MessagePump::Delegate*) /home/attekett/firefox/ipc/glue/MessagePump.cpp:95 #13 0x7f37d92461fe in MessageLoop::RunInternal() /home/attekett/firefox/ipc/chromium/src/base/message_loop.cc:229 #14 0x7f37db35be2f in nsBaseAppShell::Run() /home/attekett/firefox/widget/xpwidgets/nsBaseAppShell.cpp:164 #15 0x7f37ddc0e8b6 in nsAppStartup::Run() /home/attekett/firefox/toolkit/components/startup/nsAppStartup.cpp:278 #16 0x7f37dda7eba8 in XREMain::XRE_mainRun() /home/attekett/firefox/toolkit/xre/nsAppRunner.cpp:4012 #17 0x7f37dda7f849 in XREMain::XRE_main(int, char**, nsXREAppData const*) /home/attekett/firefox/toolkit/xre/nsAppRunner.cpp:4083 #18 0x7f37dda8018b in XRE_main /home/attekett/firefox/toolkit/xre/nsAppRunner.cpp:4297 #19 0x479fa6 in do_main(int, char**, nsIFile*) /home/attekett/firefox/browser/app/nsBrowserApp.cpp:282 #20 0x7f37e66a276c in ?? ??:0

SUMMARY: AddressSanitizer: heap-buffer-overflow ??:0 ?? Shadow bytes around the buggy address: 0x0fe775b7b580: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0fe775b7b590: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0fe775b7b5a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0fe775b7b5b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0fe775b7b5c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 =>0x0fe775b7b5d0: 00 00 00 00[fa]fa fa fa fa fa fa fa fa fa fa fa 0x0fe775b7b5e0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0fe775b7b5f0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0fe775b7b600: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0fe775b7b610: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0fe775b7b620: fa 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 Contiguous container OOB:fc ASan internal: fe ==6994==ABORTING

The original report as published on Mozilla's Bugzilla, by Atte Kettunen. 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 Web Audio. Mozilla made it public on 3 July 2014 as CVE-2014-1549.

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 Atte Kettunen

View all

62 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.