[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20071221200052.135a3e22.aluigi@autistici.org>
Date: Fri, 21 Dec 2007 20:00:52 +0100
From: Luigi Auriemma <aluigi@...istici.org>
To: bugtraq@...urityfocus.com, bugs@...uritytracker.com,
news@...uriteam.com, full-disclosure@...ts.grok.org.uk,
vuln@...unia.com, packet@...ketstormsecurity.org
Subject: Buffer-overflow in WinUAE 1.4.4
#######################################################################
Luigi Auriemma
Application: WinUAE
http://www.winuae.net
Versions: <= 1.4.4
Platforms: Windows
Bug: buffer-overflow
Exploitation: local
Date: 21 Dec 2007
Author: Luigi Auriemma
e-mail: aluigi@...istici.org
web: aluigi.org
#######################################################################
1) Introduction
2) Bug
3) The Code
4) Fix
#######################################################################
===============
1) Introduction
===============
WinUAE is the most known and used Amiga emulator for Windows.
A note about this advisory:
UAE (and consequently WinUAE) is affected by some design bugs which
introduce other security problems (as pointed by the same developer)
so I focused only on the following non-design security bug.
#######################################################################
======
2) Bug
======
WinUAE supports various types of compressed floppy disk images.
Gzip compression (images with gz, adz, roz and hdz extensions) is
handled by an internal function called zfile_gunzip in which is used a
stack buffer of 1000 (MAX_DPATH) bytes for including the name of the
file available in the gzipped archive.
The instructions which copy the name from the archive to the buffer
don't check it's length allowing an attacker to exploit the subsequent
buffer-overflow for executing malicious code.
>From zfile.c:
struct zfile *zfile_gunzip (struct zfile *z)
{
uae_u8 header[2 + 1 + 1 + 4 + 1 + 1];
z_stream zs;
int i, size, ret, first;
uae_u8 flags;
long offset;
char name[MAX_DPATH];
uae_u8 buffer[8192];
...
do {
zfile_fread (name + i, 1, 1, z);
} while (name[i++]);
...
#######################################################################
===========
3) The Code
===========
http://aluigi.org/poc/winuaebof.zip
#######################################################################
======
4) Fix
======
Version 1.4.5
#######################################################################
---
Luigi Auriemma
http://aluigi.org
Powered by blists - more mailing lists