Critical severity

Cygwin buffer overflow due to incorrect filename length check

Cygwin buffer overflow due to incorrect filename length checking.

Original release date
May 2007
Discovered by
Jesús Olmos González
Severity
5 / 5 Scale 1–5
Affected product
cygwin1.dll up to version 1.5.7 (possibly up to 1.5.19)

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

23 May 2006 Vulnerability discovered by Jesús Olmos González (Internet Security Auditors).
Nov 8, 2007 Initial notification to the manufacturer and discussion on the development list regarding its impact. It is considered fixed as a side effect.
24 Nov 2007 Advisory publication.

References

Sobre Internet Security Auditors

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 us
Contact

Do 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

We will contact you as soon as possible.
Global Presence

Our offices

Barcelona

C. Santander, 101. Building A-2
E-08030 Barcelona (Spain)

+34 93 305 13 18
Madrid

Arequipa St., 1
28043 Madrid (Spain)

+34 91 763 40 47
Bogotá

Transversal 22 # 98-82, Porta 100 Building, Office 1003
110221 Bogotá (Colombia)

+57 601 638 68 88
25
years of experience in cybersecurity
Contact us