Twenty Year Anniversary

Google Chrome Blink Serializer::doSerialize Bad Cast

Google Chrome Blink Serializer::doSerialize Bad Cast
Posted Nov 12, 2016
Authored by SkyLined

When serializing JavaScript objects for sending to another window using the postMessage method, the code in blink does not handle Symbol objects correctly and attempts to serialize this kind of object as a regular object, which results in a bad cast. An attacker that can trigger this issue may be able to execute arbitrary code. Chrome version 38 is affected.

tags | exploit, arbitrary, javascript
MD5 | 86effd621987bbc00b6283b6d779fee9

Google Chrome Blink Serializer::doSerialize Bad Cast

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
ninth entry in that series, and the first to not target a Microsoft browser.

The below information is available in more detail on my blog at
http://blog.skylined.nl/20161111001.html.

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

Google Chrome blink Serializer::doSerialize bad cast
====================================================
(This fix and CVE number for this issue are not known)

Synopsis
--------
When serializing JavaScript objects for sending to another window using
the `postMessage` method, the code in blink does not handle `Symbol`
objects correctly and attempts to serialize this kind of object as a
regular object, which results in a bad cast. An attacker that can
trigger this issue may be able to execute arbitrary code.

Known affected versions, attack vectors and mitigations
-----------------------
* Chrome 38
An attacker would need to get a target user to open a specially
crafted webpage. Disabling JavaScript should prevent an attacker from
triggering the vulnerable code path.

Repro
-----
<script>
postMessage(Symbol());
</script>

Description
-----------
The repro causes a call to `blink::V8Window::postMessageMethodCustom`.
This method creates a `Serializer` object for the "script value" of the
symbol. In ``blink::`anonymous namespace'::Serializer::doSerialize`` the
code attempts to determine the type of object being serialized and runs
specific code to to serialize each type. This code does not distinguish
between a `Symbol` and a regular object, and therefor runs code designed
to handle the later to serialize the former. This results in a bad cast
to a `v8::Object`.

Exploit
-------
The exploitability of a bad cast depends on many things, including what
properties and methods the real object type and the object type it was
cast to have, how much control an attacker has over the values of
properties of the object, how the code proceeds to use the badly cast
object, compiler optimizations, heap management, etc... Without further
investigation it is impossible to say what an attacker could gain from
exploiting this vulnerability. In this specific case, I did not have
time to investigate exploitability on Google Chrome releases, so I
cannot proof this is actually exploitable.


Time-line
---------
* October 2014: This vulnerability was found through fuzzing.
* November 2014: This vulnerability was submitted to ZDI, iDefense
and EIP.
* December 2014: This issue appears to have been fixed and no longer
reproduces.
* December 2014: ZDI, iDefense and EIP all either reject the
submission or fail to respond.
* November 2016: Details of this issue are released.

Cheers,

SkyLined

Comments

RSS Feed Subscribe to this comment feed

No comments yet, be the first!

Login or Register to post a comment

Want To Donate?


Bitcoin: 18PFeCVLwpmaBuQqd5xAYZ8bZdvbyEWMmU

File Archive:

July 2018

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2018 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close