Lucene search
K

Microsoft DirectShow - Arbitrary Memory Overwrite (MS13-056)

🗓️ 23 Jul 2013 00:00:00Reported by Andrés Gómez RamírezType 
exploitdb
 exploitdb
🔗 www.exploit-db.com👁 53 Views

Microsoft DirectShow API vulnerability in GIF file parsing leading to arbitrary code executio

Related
Code
ReporterTitlePublishedViews
Family
Check Point Advisories
Microsoft DirectShow Remote Code Execution (MS13-056; CVE-2013-3174)
20 Aug 201300:00
checkpoint_advisories
CVE
CVE-2013-3174
10 Jul 201301:00
cve
Cvelist
CVE-2013-3174
10 Jul 201301:00
cvelist
exploitpack
Microsoft DirectShow - Arbitrary Memory Overwrite (MS13-056)
23 Jul 201300:00
exploitpack
canvas
Immunity Canvas: MS13_056
10 Jul 201303:46
canvas
NVD
CVE-2013-3174
10 Jul 201303:46
nvd
OpenVAS
Microsoft DirectShow Remote Code Execution Vulnerability (2845187)
10 Jul 201300:00
openvas
OpenVAS
Microsoft DirectShow Remote Code Execution Vulnerability (2845187)
10 Jul 201300:00
openvas
Prion
Memory corruption
10 Jul 201303:46
prion
Positive Technologies
PT-2013-4200 · Microsoft · Windows 7 +8
9 Jul 201300:00
ptsecurity
Rows per page
Introduction:

The Microsoft DirectShow application programming interface (API) is a media-streaming architecture for Microsoft Windows. Using DirectShow, your applications can perform high-quality video and audio playback or capture.  

Overview:

DirectShow in Microsoft Windows XP SP2 and SP3, Windows Server 2003 SP2, Windows Vista SP2, Windows Server 2008 SP2 and R2 SP1, Windows 7 SP1, Windows 8, and Windows Server 2012 allows remote attackers to execute arbitrary code via a crafted GIF file, aka "DirectShow Arbitrary Memory Overwrite Vulnerability." 

Disclosure Timeline

2013-03-20 - Vulnerability reported to vendor
2013-07-09 - Coordinated public release of advisory

Details:  

Microsoft's DirectShow API is vulnerable to arbitrary memory overwrite when reading specially crafted GIF files. I have attached a GIF which triggers the vulnerability. To open it you can use Media Player Classic which utilizes DirectShow API to render GIF files. I tested it on Windows XP SP3 and Windows 7 SP1 Spanish version. The corresponding output from WindDbg in Windows XP is:



ModLoad:    72c90000 72c98000      C:\WINDOWS\system32\msacm32
drv
ModLoad:   77bb0000 77bc5000       C:\WINDOWS\system32\MSACM32.dll
ModLoad:   77ba0000 77ba7000       C:\WINDOWS\system32\midimap.dll
ModLoad:   73e60000 73e64000       C:\WINDOWS\system32\KsUser.dll
ModLoad:   60830000 608bc000       C:\WINDOWS\system32\qedit.dll
ModLoad:   75ed0000 75ef1000        C:\WINDOWS\system32\MSVFW32.dll

(bd0.bf4): Access violation - code c0000005 (first chance) First chance exceptions are reported before any exception handling.

This exception may be expected and handled.

eax=ff414141 ebx=fffffa60 ecx=00000000 edx=fea57028 esi=fea57028 edi=000000ef
eip=60864094 esp=0274ec0c ebp=0274ed3c iopl=0         nv up ei ng nz ac pe cy
cs=001b  ss=0023  ds=0023  es=0023  fs=003b  gs=0000             efl=00010297

qedit!CImgGif::ReadImage+0x288:

60864094 8902            mov     dword ptr [edx],eax  ds:0023:fea57028=????????


The issue occurs inside qedit.dll when trying to read GIF header data, in CImgGif::ReadImage+0x288. This writes in memory position edx=fea57028 the value eax=ff414141 both of them controlled by the user. eax=fea57028 can be modified in the GIF file in the position 0x32C corresponding to NW corner of frame at 0, 0 and eax=ff414141 can be modified in the position 0x307 corresponding to Global Color Table. With these two values controlled by an attacker, arbitrary code execution could be achieved, with the privileges of the user running the application (in this case MPC).
    
References:

    https://technet.microsoft.com/en-us/security/bulletin/ms13-056 
    http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2013-3174

Fix:

http://technet.microsoft.com/en-us/security/bulletin/ms13-056

PoC:
https://docs.google.com/file/d/0B48gNjWDSsFwSDQ1ZGZEb3ItSEU
https://gitlab.com/exploit-database/exploitdb-bin-sploits/-/raw/main/bin-sploits/27050.zip

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation