This is the mail archive of the cygwin-developers mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: cygwin1.dll up to 1.5.22 overflow


Hello developers,

cygwin1.dll is vulnerable a dangerous buffer overflow that can be exploited
remotelly.

There are system administrators who use cygwin ssh to administrate their Windows
boxes. 

Is possible to make a remote secure copy with a long filename that will make the
following violation:

$ cat scp.exe.stackdump
Exception: STATUS_ACCESS_VIOLATION at eip=6109008D
eax=6167343A ebx=5959595A ecx=6167343C edx=04A96F89 esi=6E6C0055 edi=59595957
ebp=6E6C006C esp=0022E51B program=C:\sshd\bin\scp.exe
cs=001B ds=0023 es=0023 fs=0038 gs=0000 ss=0023

(in that case is scp client who crashes, but any program crash, touch and ssh
too)


$ gdb /usr/bin/touch.exe
GNU gdb 2003-09-20-cvs (cygwin-special)
...
(gdb) r AAAA ...
Program received signal SIGSEGV, Segmentation fault.
0x61091eea in getppid () from /usr/bin/cygwin1.dll
(gdb) x/i 0x61091eea
0x61091eea <getppid+2954>:      mov    0xc(%ebp),%eax
(gdb) i r ebp eax
ebp            0x22006b 0x22006b
eax            0xffffffff       -1

We can take control of ebp and edi  and  can redirect the execution flow.

I think the version is 1.5.7-1 and prior:

sha0:~# strings /root/backup2/cygwin/bin/cygwin1.dll | grep -i cygwin\-
/netrel/src/cygwin-1.5.7-1/winsup/cygwin/cygheap.cc
/netrel/src/cygwin-1.5.7-1/winsup/cygwin/dir.cc
...

It seems that the problem is at getppid(), but this debuger is inside cygwin,
maybe debugging from outside will see diferent things.

regards

-- 
_________________________________
Jesús Olmos González
Analista en Seguridad
OPST CEH
Dpto. de Auditoría
jolmos@isecauditors.com

Internet Security Auditors, S.L.
c. Santander, 101. Edif. A. 2º
08030 Barcelona
Tel: 93 305 13 18
Fax: 93 278 22 48
www.isecauditors.com
          ____________________________________
Este mensaje y los documentos que, en su caso lleve anexos, pueden
contener información CONFIDENCIAL. Por ello, se informa al
destinatario que la información contenida en el mismo es reservada y
su uso no autorizado, publicación o difusión, entera o parcialmente,
tanto en formato o medio físico como electrónico, sin el previo
consentimiento de Internet Security Auditors, está prohibida legalmente.

Si ha recibido este correo por error, le rogamos que nos lo comunique
por la misma vía o por teléfono (93 305 13 18), se abstenga de
realizar copias del mensaje o remitirlo o entregarlo a otra persona y
proceda a borrarlo de inmediato.

En cumplimiento de la Ley Orgánica 15/1999 de 13 de diciembre de
protección de datos de carácter personal, Internet Security Auditors
S.L., le informa de que sus datos personales se han incluido en
ficheros informatizados titularidad de Internet Security Auditors
S.L., que será el único destinatario de dichos datos, y cuya finalidad
exclusiva es la gestión de clientes y acciones de comunicación
comercial, y de que tiene la posibilidad de ejercer los derechos de
acceso, rectificación, cancelación y oposición previstos en la ley
mediante carta dirigida a Internet Security Auditors, c. Santander,
101. Edif. A. 2º 1ª, 08030 Barcelona, o vía e-mail a la siguiente
dirección de correo: legal@isecauditors.com






Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]