IE 11 MSHTML!CPaste­Command::Convert­Bitmapto­Png heap-based buffer overflow学习

MS14-056, CVE-2014-4138

Time-line

8 May 2014: This vulnerability was submitted to ZDI.
9 June 2014: This vulnerability was acquired by ZDI.
23 June 2014: This vulnerability was disclosed to Microsoft by ZDI.
14 October 2014: This vulnerability was address by Microsoft in MS14-056.
21 December 2016: Details of this vulnerability are released.

越界访问漏洞

版本:Microsoft Internet Explorer 11.0.9600.16521

概述

图片被粘贴到IE11中,会把BMP格式转换成PNG格式,MSHTML!CPaste­Command::Convert­Bitmapto­Png函数执行这个操作。

这个函数使用BMP图片的大小来储存转换好的PNG图片,如果转换后的PNG大于BMP则会发生溢出

CPaste­Command::Convert­Bitmapto­Png 伪代码

  函数原型
Convert­Bitmapto­Png(
[IN] VOID* po­Bitmap,
UINT u­Bitmap­Size,
[OUT] VOID** ppo­Png­Image,
UINT* pu­Png­Image­Size
) {
// BMP到PNG的转换
CMem­Stm* po­CMem­Stm;
IWICStream* po­Wic­Bitmap;
STATSTG o­Stat­Stg;
TSmart­Array<unsigned char> po­Png­Image;
UINT u­Read­Size;
// Create a CMem­Stm for the PNG image.
Create­Stream­On­HGlobal(NULL, True, po­CMem­Stm);
// Create an IWICStream from the BMP image.
Initialize­From­Memory(po­Bit­Map, u­Bitmap­Size,
&GUID_­Container­Format­Bmp, &po­Wic­Bitmap)));
// Write BMP image in IWICStream to PNG image in CMem­Stm
Write­Wic­Bitmap­To­Stream(po­Wic­Bitmap, &GUID_­Container­Format­Png, po­CMem­Stm);
// Get size of PNG image in CMem­Stm and save it to the output variable.
o­CMem­Stm->Stat(&o­Stat­Stg, 0);
*pu­Png­Image­Size = o­Stat­Stg.cb­Size.Low­Part;
// Allocate memory for the PNG
//这一句产生问题,使用了BMP的大小给PNG分配内存
po­Png­Image->New(u­Bitmap­Size);
// Go to start of PNG image in CMem­Stm
po­CMem­Stm->Seek(0, STREAM_­SEEK_­SET, NULL, &p­Position­Low);
// Read PNG image in CMem­Stm to allocated memory.
//这一句读入PNG的内容,导致溢出
po­CMem­Stm->Read(po­Png­Image, *pu­Png­Image­Size, &u­Read­Size);
// Save location of allocated memory with PNG image to output variable.
*ppo­Png­Image = po­Png­Image;
}

POC

只有用js实现图片复制的脚本,图片本身需要另外生成

这个洞因为没有完整的POC所以我没有调,但是其实作者在概述里已经说的很清楚了,这个洞的成因比较有意思放在这里开阔一下思路。

【OOB】MSHTML!CPaste­Command::Convert­Bitmapto­Png heap-based buffer overflow学习的更多相关文章

  1. CVE-2016-10190 FFmpeg Http协议 heap buffer overflow漏洞分析及利用

    作者:栈长@蚂蚁金服巴斯光年安全实验室 -------- 1. 背景 FFmpeg是一个著名的处理音视频的开源项目,非常多的播放器.转码器以及视频网站都用到了FFmpeg作为内核或者是处理流媒体的工具 ...

  2. CVE-2016-10191 FFmpeg RTMP Heap Buffer Overflow 漏洞分析及利用

    作者:栈长@蚂蚁金服巴斯光年安全实验室 一.前言 FFmpeg是一个著名的处理音视频的开源项目,使用者众多.2016年末paulcher发现FFmpeg三个堆溢出漏洞分别为CVE-2016-10190 ...

  3. metasploit--exploit模块信息

    Name                                             Disclosure Date  Rank    Description ----           ...

  4. Kali linux 2016.2(Rolling)中的Exploits模块详解

    简单来将,这个Exploits模块,就是针对不同的已知漏洞的利用程序. root@kali:~# msfconsole Unable to handle kernel NULL pointer der ...

  5. BUFFER OVERFLOW 10 Vulnerability & Exploit Example

    SRC= http://www.tenouk.com/Bufferoverflowc/Bufferoverflow6.html THE VULNERABLE AND THE EXPLOIT     W ...

  6. sqlmap用法大全

    sqlmap参数详解: Usage: python sqlmap.py [options] Options(选项): -h, --help            Show basic help mes ...

  7. fuzz实战之honggfuzz

    Honggfuzz实战 前言 本文介绍 libfuzzer 和 afl 联合增强版 honggfuzz .同时介绍利用 honggfuzz 来 fuzz 网络应用服务. 介绍 honggfuzz 也是 ...

  8. An Assembly Language

    BUFFER OVERFLOW 3 An Assembly Language Introduction Basic of x86 Architecture Assembly Language Comp ...

  9. arcmap Command

    The information in this document is useful if you are trying to programmatically find a built-in com ...

随机推荐

  1. 00405EB0 mov eax,dword ptr [ecx] 是什么意思?

    dword 双字 就是四个字节ptr pointer缩写 即指针[]里的数据是一个地址值,这个地址指向一个双字型数据比如mov eax, dword ptr [12345678] 把内存地址12345 ...

  2. spring 事务传播 never 当一个业务方法设置为never时候表示 不会加入任何事务中

  3. pgm2

    MRF 笔记 我们先讨论引入 MRF 的必要性.经典的例子就是四个 r.v.s 连成一个正方形的结构的时候,我们没法通过 BN 获得给定对角线两个 r.v.s 而剩下的条件独立(不都是 d-sep), ...

  4. Nginx反向代理下IIS获取真实IP

    1. iis 如果放在反向代理后面,日志里的c-ip是反向代理服务器的ip,不是真正用户的ip,想要记录用户的ip要做两件事. 一.在反向代理设置X-Forwarded-For段,以下为nginx下的 ...

  5. (转)Maven学习总结(三)——使用Maven构建项目

    孤傲苍狼 只为成功找方法,不为失败找借口! Maven学习总结(三)——使用Maven构建项目 maven作为一个高度自动化构建工具,本身提供了构建项目的功能,下面就来体验一下使用maven构建项目的 ...

  6. HDU 6156 数位dp

    Palindrome Function Time Limit: 8000/4000 MS (Java/Others)    Memory Limit: 256000/256000 K (Java/Ot ...

  7. ReentrantLock与synchronized

    1.ReentrantLock 拥有Synchronized相同的并发性和内存语义,此外还多了 锁投票,定时锁等候和中断锁等候 线程A和B都要获取对象O的锁定,假设A获取了对象O锁,B将等待A释放对O ...

  8. Elasticsearch 5.0 安装 Search Guard 5 插件

    一.Search Guard 简介 Search Guard  是 Elasticsearch 的安全插件.它为后端系统(如LDAP或Kerberos)提供身份验证和授权,并向Elasticsearc ...

  9. 对Property进行RACObserve

    @property (assign,nonatomic) int price; @property (assign,nonatomic) int time; [RACObserve(self,pric ...

  10. Nginx学习总结

    2017年2月23日, 星期四 Nginx学习总结 Nginx是目前比较主流的HTTP反向代理服务器(其企业版提供了基于TCP层的反向代理插件),对于构建大型分布式web应用,具有举足轻重的作用.简单 ...