Skip to content
Memory corruption Disclosed report Advanced CVE-2016-5281

use-after-free in DOMSVGLength

A use-after-free in DOMSVGLength caused a null pointer dereference and crash in Firefox. An attacker could potentially exploit this to crash the browser, though the report only demonstrates a crash.

Brian Carpenter Follow

Originally disclosed on Mozilla

  • Fixed in 36 days
  • Paid in 41 days
  • Disclosed after 36 days
Text
Created attachment 8768230
Stack Text from WinDBG

While fuzzing the latest Firefox Nightly build (Built from https://hg.mozilla.org/mozilla-central/rev/c9a70b64f2faa264296f0cc90d68a2ee2bac6ac5) with cross_fuzz (http://lcamtuf.coredump.cx/cross_fuzz/), I encountered a null ptr dereference / access violation / crash @ nsINode::GetComposedDoc.

cross_fuzz command line:
file:///d:/cross_fuzz_v3/cross_fuzz_randomized_20110105_seed.html#8088

time to crash:
10-15 minutes

FAULTING_IP: 
xul!nsINode::GetComposedDoc+0 [c:\builds\moz2_slave\m-cen-w64-ntly-000000000000000\build\src\obj-firefox\dist\include\nsinode.h @ 536]
00007ffc`a0e53af8 f7411800080000  test    dword ptr [rcx+18h],800h

EXCEPTION_RECORD:  ffffffffffffffff -- (.exr 0xffffffffffffffff)
.exr 0xffffffffffffffff
ExceptionAddress: 00007ffca0e53af8 (xul!nsINode::GetComposedDoc)
   ExceptionCode: c0000005 (Access violation)
  ExceptionFlags: 00000000
NumberParameters: 2
   Parameter[0]: 0000000000000000
   Parameter[1]: 0000000000000018
Attempt to read from address 0000000000000018

FAULTING_THREAD:  000000000000153c

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:  0000000000000000

EXCEPTION_PARAMETER2:  0000000000000018

READ_ADDRESS:  0000000000000018 

FOLLOWUP_IP: 
xul!nsINode::GetComposedDoc+0 [c:\builds\moz2_slave\m-cen-w64-ntly-000000000000000\build\src\obj-firefox\dist\include\nsinode.h @ 536]
00007ffc`a0e53af8 f7411800080000  test    dword ptr [rcx+18h],800h

NTGLOBALFLAG:  70

APPLICATION_VERIFIER_FLAGS:  0

BUGCHECK_STR:  APPLICATION_FAULT_NULL_CLASS_PTR_DEREFERENCE_NULL_POINTER_READ_INVALID_POINTER_READ

PRIMARY_PROBLEM_CLASS:  NULL_CLASS_PTR_DEREFERENCE

DEFAULT_BUCKET_ID:  NULL_CLASS_PTR_DEREFERENCE

LAST_CONTROL_TRANSFER:  from 00007ffca0fb90c9 to 00007ffca0e53af8

FAULTING_SOURCE_CODE:  
No source found for 'c:\builds\moz2_slave\m-cen-w64-ntly-000000000000000\build\src\obj-firefox\dist\include\nsinode.h'


SYMBOL_STACK_INDEX:  0

SYMBOL_NAME:  xul!nsINode::GetComposedDoc+0

FOLLOWUP_NAME:  MachineOwner

MODULE_NAME: xul

IMAGE_NAME:  xul.dll

DEBUG_FLR_IMAGE_TIMESTAMP:  577c1d67

STACK_COMMAND:  ~52s ; kb

FAILURE_BUCKET_ID:  NULL_CLASS_PTR_DEREFERENCE_c0000005_xul.dll!nsINode::GetComposedDoc

BUCKET_ID:  X64_APPLICATION_FAULT_NULL_CLASS_PTR_DEREFERENCE_NULL_POINTER_READ_INVALID_POINTER_READ_xul!nsINode::GetComposedDoc+0

WATSON_STAGEONE_URL:  http://watson.microsoft.com/StageOne/firefox_exe/50_0_0_6030/577c1612/xul_dll/50_0_0_6030/577c1d67/c0000005/00103af8.htm?Retriage=1

Followup: MachineOwner

The original report as published on Mozilla's Bugzilla, by Brian Carpenter. 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.

How it worked

Impact

The vulnerability could cause a denial of service (browser crash), but the report does not demonstrate code execution.

What the attacker needed

Victim visits a malicious page; Firefox Nightly build

How it was found

  1. Build or obtain the specified Firefox Nightly revision.
  2. Run the cross_fuzz tool with the given command line and seed file.
  3. Wait 10-15 minutes for the crash to occur.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

A use-after-free is a memory bug where a program keeps using a piece of memory after it has been freed. Here, fuzzing Firefox with a generated web page caused a crash because the browser tried to read from an invalid memory address. The report only shows a crash, not full code execution.

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 Brian Carpenter

View all

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