【OOB】MSHTML!CPasteCommand::ConvertBitmaptoPng heap-based buffer overflow学习
IE 11 MSHTML!CPasteCommand::ConvertBitmaptoPng 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!CPasteCommand::ConvertBitmaptoPng函数执行这个操作。
这个函数使用BMP图片的大小来储存转换好的PNG图片,如果转换后的PNG大于BMP则会发生溢出
CPasteCommand::ConvertBitmaptoPng 伪代码
函数原型
ConvertBitmaptoPng(
[IN] VOID* poBitmap,
UINT uBitmapSize,
[OUT] VOID** ppoPngImage,
UINT* puPngImageSize
)
{
// BMP到PNG的转换
CMemStm* poCMemStm;
IWICStream* poWicBitmap;
STATSTG oStatStg;
TSmartArray<unsigned char> poPngImage;
UINT uReadSize;
// Create a CMemStm for the PNG image.
CreateStreamOnHGlobal(NULL, True, poCMemStm);
// Create an IWICStream from the BMP image.
InitializeFromMemory(poBitMap, uBitmapSize,
&GUID_ContainerFormatBmp, &poWicBitmap)));
// Write BMP image in IWICStream to PNG image in CMemStm
WriteWicBitmapToStream(poWicBitmap, &GUID_ContainerFormatPng, poCMemStm);
// Get size of PNG image in CMemStm and save it to the output variable.
oCMemStm->Stat(&oStatStg, 0);
*puPngImageSize = oStatStg.cbSize.LowPart;
// Allocate memory for the PNG
//这一句产生问题,使用了BMP的大小给PNG分配内存
poPngImage->New(uBitmapSize);
// Go to start of PNG image in CMemStm
poCMemStm->Seek(0, STREAM_SEEK_SET, NULL, &pPositionLow);
// Read PNG image in CMemStm to allocated memory.
//这一句读入PNG的内容,导致溢出
poCMemStm->Read(poPngImage, *puPngImageSize, &uReadSize);
// Save location of allocated memory with PNG image to output variable.
*ppoPngImage = poPngImage;
}
POC
只有用js实现图片复制的脚本,图片本身需要另外生成
这个洞因为没有完整的POC所以我没有调,但是其实作者在概述里已经说的很清楚了,这个洞的成因比较有意思放在这里开阔一下思路。
【OOB】MSHTML!CPasteCommand::ConvertBitmaptoPng heap-based buffer overflow学习的更多相关文章
- CVE-2016-10190 FFmpeg Http协议 heap buffer overflow漏洞分析及利用
作者:栈长@蚂蚁金服巴斯光年安全实验室 -------- 1. 背景 FFmpeg是一个著名的处理音视频的开源项目,非常多的播放器.转码器以及视频网站都用到了FFmpeg作为内核或者是处理流媒体的工具 ...
- CVE-2016-10191 FFmpeg RTMP Heap Buffer Overflow 漏洞分析及利用
作者:栈长@蚂蚁金服巴斯光年安全实验室 一.前言 FFmpeg是一个著名的处理音视频的开源项目,使用者众多.2016年末paulcher发现FFmpeg三个堆溢出漏洞分别为CVE-2016-10190 ...
- metasploit--exploit模块信息
Name Disclosure Date Rank Description ---- ...
- Kali linux 2016.2(Rolling)中的Exploits模块详解
简单来将,这个Exploits模块,就是针对不同的已知漏洞的利用程序. root@kali:~# msfconsole Unable to handle kernel NULL pointer der ...
- BUFFER OVERFLOW 10 Vulnerability & Exploit Example
SRC= http://www.tenouk.com/Bufferoverflowc/Bufferoverflow6.html THE VULNERABLE AND THE EXPLOIT W ...
- sqlmap用法大全
sqlmap参数详解: Usage: python sqlmap.py [options] Options(选项): -h, --help Show basic help mes ...
- fuzz实战之honggfuzz
Honggfuzz实战 前言 本文介绍 libfuzzer 和 afl 联合增强版 honggfuzz .同时介绍利用 honggfuzz 来 fuzz 网络应用服务. 介绍 honggfuzz 也是 ...
- An Assembly Language
BUFFER OVERFLOW 3 An Assembly Language Introduction Basic of x86 Architecture Assembly Language Comp ...
- arcmap Command
The information in this document is useful if you are trying to programmatically find a built-in com ...
随机推荐
- linux、windows搭建nginx出现问题集锦
1.启动提示端口被占用(linux) 启动ninx出现nginx: [emerg] bind() to0.0.0.0:80 failed (98: Address already in use) ne ...
- 【题解】 [ZJOI2012]灾难 (拓扑排序+LCA)
懒得复制,戳我戳我 Solution: 这题思路很神奇,首先你要知道这个毁灭树是怎么保证实现的:一句话就是如果该节点要被破坏,他的所有父节点就要被破坏,也就只要所有父节点的LCA被破坏就可以,所以我们 ...
- BZOJ 1412 [ZJOI2009]狼和羊的故事 | 网络流
显然是个最小割嘛! 一开始我是这么建图的: 源点向狼连INF 羊向汇点连INF 每两个相邻格子间连双向边,边权为1 然后T成狗 后来我是这么建图的: 源点向狼连INF 羊向汇点连INF 狼和空地向相邻 ...
- HGOI20181029模拟题解
HGOI20181029模拟题解 /* sxn让我一定要谴责一下出题人和他的数据! */ problem: 给出十进制数a,b,然后令(R)10=(a)10*(b)10,给出c表示一个k进制数(1&l ...
- Tomcat:IOException while loading persisted sessions: java.io.EOFException
Tomcat:IOException while loading persisted sessions: java.io.EOFException 产生原因: 最近将项目名称修改了一下,然后启动项目, ...
- 图像处理之规则裁剪(Resize)
1 图像裁剪 在实际工作中,经常需要根据研究工作要求对图像进行裁剪(Subset Image),按照实际图像分幅裁剪的过程,可以将图像分幅裁剪分为两种类型:规则分幅裁剪(Rectangle Subse ...
- 分布式系统登录功能拦截器的实现以及cookie的共享问题(利用cookie实现session在分布式系统的共享)
当我们的网站采用分布式部署系统时,每个子系统拥有自己独立的session,如果不实现session共享,当用户切换系统访问的时候,会不停的提示登录,这对于用户体验是非常不好的.因此对于多个子系统的的访 ...
- Ubuntu下安装BeautifulSoup4
先去下载beautifulsoup的安装包https://www.crummy.com/software/BeautifulSoup/bs4/download/4.0/ 下载完之后解压 tar -xv ...
- C语言复习---获取矩阵的对角和
#include <stdio.h> #include <stdlib.h> #include <math.h> #define MAX 5 int main() ...
- 【DS】排序算法之希尔排序(Shell Sort)
一.算法思想 希尔排序,也称递减增量排序算法,是插入排序的一种更高效的改进版本.希尔排序是非稳定排序算法.希尔排序是基于插入排序的以下两点性质而提出改进方法的:1)插入排序在对几乎已经排好序的数据操作 ...