CVE-2015-0235 – How to secure against Glibc Ghost Vulnerability

SecureLayer7 Launches Information Security Testing Services
January 31, 2015

January 29, 2015

CVE-2015-0235 Ghost (glibc gethostbyname buffer overflow) Vulnerability is serious cause for all Linux servers. In effect, this vulnerability is leveraged to execute remote end code execution on the victim Linux server. The vulnerability was found By Qualys Researcher and patched in GNU.

What is the cause ?

The bug is in __nss_hostname_digits_dots() function of the GNU C Library (glibc). Correspondingly, the location of the path file for  non-reentrant version is nss/getXXbyYY.c. The gethostbyname() function uses this. The vulnerability can be exploited both via locally and remotely.  In order to trigger this vulnerability attacker needs to be able to feed specially crafted ‘host name’ to the service. Also, the service needs to process it without validating it first.

Following are the potentially exploitable services

  1. procmail
  2. Exim
  3. pppd
  4. clockdiff

You can find the list of services which are rely on the GNU C libraries by executing following command

lsof | grep libc | awk '{print $1}' | sort | uni

Fix for Centos/RHEL/Fedora 5,6,7

yum update glibc 
sudo restart

Fix for Ubuntu

sudo apt-get update

sudo apt-get dist-upgrade sudo restart

Finally, for a Quick test , you can run this code

Enable Notifications OK No thanks