Date: Sat, 8 Mar 2008 22:39:37 +0100 (MET)
To: [email protected]
From: "Tobias Klein" <tk@trapkit.de.>
Subject: [TKADV2008-001] Panda Internet Security/Antivirus+Firewall 2008 cpoint.sys Kernel Driver Memory Corruption Vulnerability
X-Priority: 3
X-Abuse: 219619 / 62.214.220.194
X-RZG-MBID: 1aSB+Ne3I7Nw+w==
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable
X-Virus-Scanned: antivirus-gw at tyumen.ru
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Advisory: Panda Internet Security/Antivirus+Firewall 2008=20
cpoint.sys Kernel Driver Memory Corruption Vulnerab=
ility
Advisory ID: TKADV2008-001
Revision: 1.0
Release Date: 2008/03/08
Last Modified: 2008/03/08
Date Reported: 2008/01/08
Author: Tobias Klein (tk at trapkit.de)
Affected Software: Panda Internet Security 2008
Panda Antivirus+Firewall 2008
Remotely Exploitable: No
Locally Exploitable: Yes
Vendor URL: http://www.pandasecurity.com
Vendor Status: Vendor has released a hotfix
Patch development time: 60 days
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
Vulnerability details:
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
The kernel driver cpoint.sys shipped with Panda Internet Security and Antiv=
irus+=20
Firewall 2008 contains a vulnerability in the code that handles IOCTL reque=
sts.=20
Exploitation of this vulnerability can result in:
1) local denial of service attacks (system crash due to a kernel panic), or
2) local execution of arbitrary code at the kernel level (complete system=
=20
compromise)
The issue can be triggered by sending a specially crafted IOCTL request.
No special user rights are necessary to exploit the vulnerability.
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
Technical description:
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
The IOCTL call 0xba002848 of the cpoint.sys kernel driver shipped with Pand=
a=20
Internet Security/Antivirus+Firewall 2008 accepts user supplied input that=
=20
doesn't get validated enough. In consequence it is possible to cause an=20
out-of-bound write in kernel memory.
Disassembly of cpoint.sys (Windows Vista 32bit version):
[...]
.text:00012633 loc_12633:
.text:00012633 mov edx, 0BA002848h <-- (1)
.text:00012638 cmp ecx, edx
.text:0001263A ja loc_12946
[...]
.text:00012640 jz loc_128BE
[...]
.text:000128BE loc_128BE:
.text:000128BE cmp [ebp+IOCTL_INPUT_SIZE], 1008h <-- (2=
)
.text:000128C5 jb loc_12A7D
[...]
.text:000128CB mov esi, [ebp+IOCTL_INPUT_DATA] <-- (3)
.text:000128CE cmp dword ptr [esi], 3F256B9Ah <-- (4)
.text:000128D4 jnz loc_12A7D
[...]
.text:000128FF xor eax, eax
.text:00012901 cmp [esi+8], eax <-- (5)
.text:00012904 jbe short loc_1291B=20
[...]
(1) Vulnerable IOCTL call
(2) IOCTL input size check
(3) The user supplied data is copied into esi
(4) + (5) Minor input data checks
- From this point there are two different vulnerable code paths. Both will =
be=20
described in the following:
Vulnerable code path 1:
[...]
.text:00012906 lea ecx, [esi+0Ch] <-- (6)
[...]
.text:00012909 loc_12909:
.text:00012909 mov edx, [ecx] <-- (7)
.text:0001290B mov OVERWRITTEN_DATA[eax*4], edx <-- (8)
.text:00012912 inc eax
.text:00012913 add ecx, 4
.text:00012916 cmp eax, [esi+8] <-- (9)
.text:00012919 jb short loc_12909
[...]
(6) Some user controlled data is copied into ecx
(7) The user controlled data is copied into edx
(8) The user controlled data is copied (as dwords) at the memory location=
=20
OVERWRITTEN_DATA
(9) The size of the copied data (loop counter in eax) can be controlled by =
the=20
user
This leads to an out-of-bound write in kernel memory.
Vulnerable code path 2:
[...]
.text:0001291B loc_1291B:
.text:0001291B xor eax, eax
.text:0001291D cmp [esi+10Ch], eax <-- (10)
.text:00012923 jbe loc_129B4
[...]
.text:00012929 lea ecx, [esi+110h] <-- (11)
[...]
.text:0001292F loc_1292F:
.text:0001292F mov edx, [ecx] <-- (12)
.text:00012931 mov OVERWRITTEN_DATA2[eax*4], edx <-- (1=
3)
.text:00012938 inc eax
.text:00012939 add ecx, 4
.text:0001293C cmp eax, [esi+10Ch] <-- (14)
.text:00012942 jb short loc_1292F
[...]
(10) Minor check of the user controlled data
(11) Some user controlled data is copied into ecx
(12) The user controlled data is copied into edx
(13) The user controlled data is copied (as dwords) at the memory location=
=20
OVERWRITTEN_DATA2
(14) The size of the copied data (loop counter in eax) can be controlled by=
the=20
user
This leads to an out-of-bound write in kernel memory.
In both cases it is possible to write an arbitrary amount of user controlle=
d=20
data into kernel memory. As the data that gets overwritten is in the data=
=20
section of the cpoint.sys kernel driver it is possible to control adjacent =
data=20
structures (e.g. some KEVENT structures). If these structures are overwritt=
en=20
with carefully crafted data it is possible to force the windows kernel into=
=20
performing a memory corruption that leads to full control of the kernel=20
execution flow.
=3D=3D=3D=3D=3D=3D=3D=3D=3D
Solution:
=3D=3D=3D=3D=3D=3D=3D=3D=3D
Hotfix for Panda Internet Security 2008:
http://www.pandasecurity.com/homeusers/support/card?id=3D41337&idIdioma=
=3D2&ref=3DProdExp
Hotfix for Panda Antivirus+Firewall 2008:
http://www.pandasecurity.com/homeusers/support/card?id=3D41231&idIdioma=
=3D2&ref=3DProdExp
=3D=3D=3D=3D=3D=3D=3D=3D
History:
=3D=3D=3D=3D=3D=3D=3D=3D
2008/01/08 - Vendor notified using [email protected]
2008/01/13 - Vendor response with PGP key
2008/01/14 - Detailed vulnerability information sent to the vendor
2008/01/14 - Vendor acknowledges receipt of the information
2008/01/16 - Vendor confirms the vulnerability
2008/02/12 - Status update request sent to vendor
2008/02/15 - Vendor response stating that a hotfix was developed
2008/03/03 - Vendor sends time schedule for releasing the hotfix
2008/03/07 - Vendor releases hotfix
2008/03/08 - Full technical details released to general public
=3D=3D=3D=3D=3D=3D=3D=3D
Credits:
=3D=3D=3D=3D=3D=3D=3D=3D
Vulnerability found and advisory written by Tobias Klein.
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
References:
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
[1] http://www.pandasecurity.com/homeusers/support/card?id=3D41337&idIdio=
ma=3D2&ref=3DProdExp
[2] http://www.pandasecurity.com/homeusers/support/card?id=3D41231&idIdio=
ma=3D2&ref=3DProdExp
[3] http://www.trapkit.de/advisories/TKADV2008-001.txt
=3D=3D=3D=3D=3D=3D=3D=3D
Changes:
=3D=3D=3D=3D=3D=3D=3D=3D
Revision 0.1 - Initial draft release to the vendor
Revision 1.0 - Public release
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
Disclaimer:
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
The information within this advisory may change without notice. Use=20
of this information constitutes acceptance for use in an AS IS=20
condition. There are no warranties, implied or express, with regard=20
to this information. In no event shall the author be liable for any=20
direct or indirect damages whatsoever arising out of or in connection=20
with the use or spread of this information. Any use of this=20
information is at the user's own risk.=20
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
PGP Signature Key:
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
http://www.trapkit.de/advisories/tk-advisories-signature-key.asc
Copyright 2008 Tobias Klein. All rights reserved.
-----BEGIN PGP SIGNATURE-----
Version: PGP 8.1
iQA/AwUBR9MFvJF8YHACG4RBEQIyvwCfeHXTTG67guMO9n9qt/yGee4boVcAoMEF
GXvwksOZ+whfcj4q9sNn+CXP
=3DkIXg
-----END PGP SIGNATURE-----