Cygwin buffer overflow due to incorrect filename length check
Cygwin buffer overflow due to incorrect filename length checking.
Antecedentes
Cygwin is a Linux-like environment for Windows, consisting of a DLL (cygwin1.dll) that emulates the Linux API and a set of tools. Administrators sometimes rely on its security to expose daemons such as sshd, telnetd, or ftpd to the network.
Description
Linux file systems support 255-byte names, but Cygwin supports 239 and checks that they are not 240 or more. However, the dynamic memory buffer that stores the name is 232 bytes, so a name between 233 and 239 bytes passes the check and overflows the heap by up to 7 bytes. To exploit it, you must first upload the malicious file to the machine; if it is created with touch, Cygwin crashes.
Business impact
Systems could be compromised by exploiting this vulnerability.
Affected systems
All versions of cygwin1.dll up to 1.5.7. Versions from 1.5.7 to 1.5.19 may also be vulnerable due to improper use of path length constants.
Solución
The patch is available in the Cygwin snapshots. The latest version (1.5.24) does not have this issue.
Calendario de divulgación
References
The information contained within this advisory is supplied 'as-is' with no warranties or guarantees of fitness for use or otherwise. Internet Security Auditors accepts no responsibility for any damage caused by the use or misuse of this information.
Company based in Spain and Colombia, specializing in web application auditing, network security, penetration testing, and compliance implementation and assessment. Our clients include some of the largest finance, telecommunications, insurance, and ICT companies. A vendor-independent provider with in-depth experience since 2001. Our R&D efforts include vulnerability research, collaboration on open security projects, whitepapers, and participation in industry events.
Would you like us to review your product?
Contact usDo you need a security audit?
Tell us about your situation and our team will get in touch with you to provide guidance or schedule a technical call.
Request information
Our offices
Transversal 22 # 98-82, Porta 100 Building, Office 1003
110221 Bogotá (Colombia)
