Re: [Full-disclosure] Windows Oday release
- From: "Joey Mengele" <joey.mengele@xxxxxxxxxxxx>
- Date: Wed, 13 Jun 2007 10:34:53 -0400
Dear all,
Gadi Evron is a brilliant genius, much smarter than Thomas Lim.
J
On Tue, 12 Jun 2007 16:21:56 -0400 ge@xxxxxxxxxxxx wrote:
On 2007-06-13 02:58+0800, Thomas Lim wrote:
dear all
Dear all, this is not a 0day, it is a public release of a
responsibly
disclosed vulnerability.
Thank you for sharing your research,
Gadi.
vulnerable to
SChannel Off-By-One Heap Corruption
===================================
Discovery Date:
28th August 2006
Date reported to Microsoft:
19th March 2007
Summary:
The Secure Channel (SChannel) library on WinXP-SP1/SP2 is
a off-by-one heap buffer overwrite. The SChannel libraryimplements
PCT/TLS/SSL protocols exported via the Security Service ProviderInterface
(SSPI). It is one of several Security Service Providers loaded-inand
supportedprotocol,
by the privileged Local Security Authority (Lsass.exe) process.
In SChannel's implementation of the client-side SSLv3 handshake
specifically in the processing of the server-key-exchange SSLhandshake
record, there is insufficient checks for malformed server-sentdigital
signature,
with its length-field set to 0. This results in a allocation of a
0-length heap
buffer (with a valid heap address). A reverse memory copy is then
performed toThis
copy-in the digital signature, by decrementing the 0-length by 1.
results indecrement
an integer-underflow, causing the heap-buffer pointer to
before its startof
address, ultimately leading to an overwrite of exactly one-byte
user-controlledof the
value, into the heap control-block. Depending on the robustness
applicationSP2, we
in question, this may lead to an unrecoverable heap corruption
condition, causing
the application to terminate. In the case of Lsass.exe on WinXP-
can crash
it locally after several iterations, from a less-privileged user,
causing a systemdoes
reboot. Vulnerable code although also exists in WinXP-SP1 but it
not cause anvia IE,
unrecoverable heap corruption in Lsass.exe.
Vendor Affected:
Microsoft
Systems Affected:
========
WinXP-SP2 (DOS/Reboot)
WinXP-SP1 (minimal impact)
Exploitation:
=============
1) For local machine reboot via normal user account, on WinXP-SP2
OR
For remote machine reboot by enticing user to visit HTTPS site
on WinXP-SP2 (but over 2000 iterations required)to
POC (crash-test/reboot):
========================
1) Run sctest.exe from a normal user account, on client machine
running WinXP-SP2.
2) sctest.exe will attempt to use SChannel's SSL implementation
parse pre-generated malformed SSL handshake records, overwith
several iterations, causing multiple off-by-one overwrites
0xFF byte, within the Lsass.exe process.notify
3) Attach Debugger to Lsass.exe to see crash. The system will
the user and perform a 60sec. reboot count-down, afterdetecting
the Lsass.exe crash.Internet
** Lsass.exe crash-test can also be done by forcing/enticing
Explorerhandshake
to access a HTTPS site, serving out the same malformed SSL
records (as shown in source code below). However, over 2000iterations
are needed (IE needs to access HTTPS site over 2000 times),before
Lsass.exeimplements the
heap corruption occurs.
Vuln Analysis:
==============
(Based on schannel.dll/v5.1.2600.2180/WinXP-SP2)
The vulnerability exists in schannel.dll component, that
SSPI-compliantinformation on
PCT/TLS/SSL protocol handling implementation. For more
SSPI andus/secauthn/security/authentication_packages.asp
how it relates to LSA, refer to
1)
http://msdn.microsoft.com/library/default.asp?url=/library/en-
2)us/secauthn/security/sspi.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-
schannel,
Essentially, in the case of SSPI authentication libraries like
kerberos, msv1_0 (ntlm),requring
data is exchanged between less-privileged user applications
authentication, and Lsass.exe.and the
With LSA providing the authentication back-end support. Both LSA
less-privileged applicationSSL
communicate indirectly via the SSPI interface. Specifically, in
authentication, untrusted SSLthe
record packets are passed from the less-privileged application to
privileged LSA. While extensiveversion
efforts are made in LSA to validate the SSL records, on WinXP's
of schannel, an off-by-oneused SSL
vulnerability exists in the parsing of the less-common and less-
server-key-exchange record.client
The vulnerability can hence be triggered via less-privileged
applications utilizing the
schannel's client-side SSL protocol implementation. This includes
Internet Explorer, whenever the useris
uses IE to browse a HTTPS site.
The vulnerable code exists in the _ReverseMemCopy() function and
reachable from Ssl3ParseServerKeyExchange():symbols
(via SPProcessHandshake()->PkcsGenerateClientExchangeValue())
; On WinXP-SP1, the code below is located at 0x767FF976 (no
available)
Ssl3ParseServerKeyExchange()
...
.text:767FFFC8 movzx ebx, byte ptr [esi] ;
MSB-byte of malformed signature length field
.text:767FFFCB movzx eax, byte ptr [esi+1] ;
LSB-byte of malformed signature length fieldsize=0
.text:767FFFCF shl ebx, 8
.text:767FFFD2 add ebx, eax
.text:767FFFD4 push ebx ;
.text:767FFFD5 call _SPExternalAlloc@4 ;
HeapAlloc will return a valid 0-length heap buffer addresssize=0
.text:767FFFDA test eax, eax
.text:767FFFDC mov [ebp+pbSignature], eax
.text:767FFFDF jz loc_768000B9
.text:767FFFE5 push ebx ;
.text:767FFFE6 lea ecx, [esi+2] ;
address of the signature data in our malformed record
;
containing 0xFF,0x41,0x41...
.text:767FFFE9 push ecx
.text:767FFFEA push eax ;
0-length heap buffer
.text:767FFFEB call _ReverseMemCopy@12
_ReverseMemCopy()
.text:767FF46F mov edi, edi
.text:767FF471 push ebp
.text:767FF472 mov ebp, esp
.text:767FF474 mov eax, [ebp+arg_8]
.text:767FF477 mov ecx, [ebp+arg_4]
.text:767FF47A push esi
.text:767FF47B mov esi, [ebp+arg_0]
.text:767FF47E lea eax, [esi+eax-1]
; EAX=0, ESI which points to 0-length heap buffer
; is decremented to, before start of heap buffer
.text:767FF482 mov dl, [ecx]
.text:767FF484 mov [eax], dl
; Off-by-one overwrite with 0xFF from our signature data
.text:767FF486 dec eax
.text:767FF487 inc ecx
.text:767FF488 cmp eax, esi
.text:767FF48A jnb short loc_767FF482
; Just one-byte overwrite!
.text:767FF48C pop esi
.text:767FF48D pop ebp
.text:767FF48E retn 0Ch
Discovered by:
Steven
Security Researcher
Vulnerability Research Lab
COSEINC
--
Thank you
Thomas Lim
COSEINC Private Limited
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: PGP 8.1 - not licensed for commercial use: www.pgp.com
mQGiBEQM9cARBADvlIe8Ck5/u2EtX3ikd/eKjI7uZKyIFHNLxEYBB1AaHmEvYCPi
VpvNr7ArKjbqlEpdsl6c9gQUY8vir5Lfk/p6siCD1aIYfCdPa64gKJQ66UVIUy7a
hIlE8sJ86mcbvVGzA4f1LjwPUPwymeKEQeDJy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xk97ca/z9Fz+2qS8Q3sz2QSkHcZgBBxTS07cvd2P60ecVECBKG+dgxGw
X13e5hgw2tzFRMqnty66lKXYEIUj4ZSl70UPAmy5xUaU4EahLURN29f3zM+EPy72
374v28ud28yO59iyRqoUGiHr3c87wumrDtjwm8qKIkWHsi+7AiES29nCqtm4zN45
3yXkalvQ/O97ZJSinzZb851ToowyFIkATAQYEQIADAUCRAz1wAUbDAAAAAAKCRC8
X3wPPSdH5MLbAKCIYtkvUPIoxm15I4UlvCIZjT8hdACdEWiQKWdlwZCJTePk4CF9
swkS3cQ=
=Q3SR
-----END PGP PUBLIC KEY BLOCK-----
--
--
"beepbeep it, i leave work, stop reading sec lists and im still
hearing
gadi"
- HD Moore to Gadi Evron on IM, on Gadi's interview on npr, March
2007.
_______________________________________________
Full-Disclosure - We believe in it.
Charter: http://lists.grok.org.uk/full-disclosure-charter.html
Hosted and sponsored by Secunia - http://secunia.com/
--
Click for a second home mortgage, fast & free, no fees, approval today
http://tagline.hushmail.com/fc/CAaCXv1QbNMsbmnDafSnVJtW3sm0Gn5o/
_______________________________________________
Full-Disclosure - We believe in it.
Charter: http://lists.grok.org.uk/full-disclosure-charter.html
Hosted and sponsored by Secunia - http://secunia.com/
- Follow-Ups:
- Re: [Full-disclosure] Windows Oday release
- From: crazy frog crazy frog
- Re: [Full-disclosure] Windows Oday release
- Prev by Date: [Full-disclosure] Apple Safari: cookie stealing
- Next by Date: Re: [Full-disclosure] Apple Safari: cookie stealing
- Previous by thread: Re: [Full-disclosure] Windows Oday release
- Next by thread: Re: [Full-disclosure] Windows Oday release
- Index(es):
Relevant Pages
|
|