So the big panic in the past week or so has been about this GHOST vulnerability in glibc which under certain circumstances can allow remote code execution (serious business!).
So we’ve had Heartbleed, POODLE and Shellshock and now we have awfully cute GHOST.
What is it?
The CVE for GHOST is – CVE-2015-0235, the technical explanation:
Heap-based buffer overflow in the __nss_hostname_digits_dots function in glibc 2.2, and other 2.x versions before 2.18, allows context-dependent attackers to execute arbitrary code via vectors related to the (1) gethostbyname or (2) gethostbyname2 function, aka “GHOST.”
The patches were released by major vendors on January 27th, so most people should be patched by now. It’s pretty widespread because basically every Linux system has GNU C Library or glibc, so before patching pretty much every Linux system is vulnerable (apart from Ubuntu 14.04 LTS which is safe out of the box).
This server is still on Ubuntu 10.04 LTS, the patching looks as below, this was the output before patching:
1 2 3 4 5 6 |
ldd --version ldd (Ubuntu EGLIBC 2.11.1-0ubuntu7.19) 2.11.1 Copyright (C) 2009 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Written by Roland McGrath and Ulrich Drepper. |
And after:
1 2 3 4 5 6 |
ldd --version ldd (Ubuntu EGLIBC 2.11.1-0ubuntu7.20) 2.11.1 Copyright (C) 2009 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Written by Roland McGrath and Ulrich Drepper. |
Which is the patched version for Ubuntu 10.04 LTS.
Qualys managed to develop an actual working exploit for this by sending a specially crafted e-mail to an unpatched machine they could get a remote Linux shell. They claim that this bypasses all existing protections (like ASLR, PIE and NX) on both 32-bit and 64-bit systems.
The full technical analysis can be found here: GHOST-CVE-2015-0235.txt
Who is affected?
The first vulnerable version of the GNU C Library affected by this is glibc-2.2, released on November 10, 2000. It was fixed on May 21, 2013 (between the releases of glibc-2.17 and glibc-2.18). Unfortunately, it was not recognized as a security threat; as a result, most stable and long-term-support distributions were left exposed including Debian 7 (wheezy), Red Hat Enterprise Linux 6 & 7, CentOS 6 & 7, Ubuntu 12.04, for example.
They also tested a lot of software and found most of the major ones are not vulnerable (so stop panicking) – apache, cups, dovecot, gnupg, isc-dhcp, lighttpd, mariadb/mysql, nfs-utils, nginx, nodejs, openldap, openssh, postfix, proftpd, pure-ftpd, rsyslog, samba, sendmail, sysklogd, syslog-ng, tcp_wrappers, vsftpd, and xinetd are not vulnerable to GHOST.
So yah, it’s not that easy to exploit, it’s not the end of the Internet as we know it.
What should we do?
Update your packages ASAP! On Ubuntu/Debian based systems that’s as easy as:
1 |
aptitude update; aptitude safe-upgrade -y |
You can check the version using the command:
1 |
ldd --version |
Honestly if you’re unpatched, you’re not super likely to get hit by this – but there is a small risk so if you can, do patch.
Gunstick says
I bet you cannot exploit this by sending an email. with all special craftiness in the world, this is impossible.