<?xml version="1.0"?>
<?xml-stylesheet href="../fma_report_en.xslt" type="text/xsl" ?>

<advisory xml:space="preserve">
	<meta>
		<description>IrfanView 4.35 - ANI (Windows Animated Cursor Format) Heap Overflow Vulnerability</description>
		<keywords>fuzzing, security, blackbox, tests, i_view32.exe, LCE, ANI, heap overflow</keywords>
	</meta>

	<title>IrfanView 4.35 - ANI (Windows Animated Cursor Format) Heap Overflow Vulnerability</title>
	<id>FMA-2013-008</id>
	
	<application>
		<name>IrfanView</name>
		<version>4.35</version>
		<url>http://www.irfanview.com</url>
		<files>
			<file>
				<name>i_view32.exe</name>
				<version>4.3.5.0</version>
				<md5>37C340F0FCC41DCCD2B70532C36E38AB</md5>
			</file>
		</files>		
		<verified>
			<os>
				<name>Windows XP SP3 Professional Edition</name>
			</os>
		</verified>
	</application>
	
	<discovery>
		<found>2013.04.19</found>
		<vendor_notified>2013.04.25</vendor_notified>
		<published>2013.07.03</published>
	</discovery>

	<vulnerabilities>
	
	<vulnerability>
			<name>Heap Overflow vulnerability.</name>
			<type>LCE</type>
			<description>IrfanView does not properly sanitize values read from ANI file header. Tampering with header values, exploiter can force overflow of allocated buffer. Values read from ANIH structure are treated as a limit for loop counter. On second of attached screens, limit for loop counter is set to too high value 0x41414141 "AAAA" and copy loop writes data till end of allocated heap buffer. Access violation is raised because application tires to write to next memory address which has no memory allocated. A successful exploitation can lead to Code Execution.</description>
			<exception>Access violation exception raised when writing at invalid address.</exception>
<disasm>00401771    8BBC24 0C010000 MOV EDI,DWORD PTR SS:[ESP+10C]
00401778    893C02          MOV DWORD PTR DS:[EDX+EAX],EDI    ; [www.FuzzMyApp.com] Write
0040177B    8908            MOV DWORD PTR DS:[EAX],ECX        ; [www.FuzzMyApp.com] Write
0040177D    8BBC24 F8000000 MOV EDI,DWORD PTR SS:[ESP+F8]
00401784    41              INC ECX                           ; [www.FuzzMyApp.com] Increment counter
00401785    83C0 04         ADD EAX,4
00401788    3BCF            CMP ECX,EDI                       ; [www.FuzzMyApp.com] We control EDI
0040178A  ^ 7C E5           JL SHORT i_view32.00401771        ; [www.FuzzMyApp.com] Loop</disasm>
			<images>
				<image>
					<thumbnail>
						<src>image01s.png</src>
						<width>100</width>
						<height>66</height>
					</thumbnail>
					<src>image01.png</src>
					<alt>Limit for loop counter.</alt>
					<text>Limit for loop counter.</text>
				</image>
				<image>
					<thumbnail>
						<src>image02s.png</src>
						<width>100</width>
						<height>66</height>
					</thumbnail>
					<src>image02.png</src>
					<alt>Access violation exception raised when writing at invalid address.</alt>
					<text>Access violation exception raised when writing at invalid address.</text>
				</image>
				<image>
					<thumbnail>
						<src>image03s.png</src>
						<width>83</width>
						<height>100</height>
					</thumbnail>
					<src>image03.png</src>
					<alt>Memory profile (Private Bytes) for exploit and pattern processing by IrfanView.</alt>
					<text>Memory profile (Private Bytes) for exploit and pattern processing by IrfanView.</text>
				</image>
			</images>
		</vulnerability>	
	
	</vulnerabilities>
</advisory>