ПечатьA vulnerability discovered by Qualys security researchers has surfaced within the GNU C Library that affects virtually all Linux operating systems. The vulnerability lies within the various gethostbyname*() functions and, as such, has been dubbed “GHOST.” GHOST is particularly nasty considering remote, arbitrary code execution can be achieved. In an effort to avoid taxing DNS lookups, glibc developers introduced the __nss_hostname_digits_dots() function which makes a call to the infamous strcpy() function. As such, the array bounds are not limited by a size constraint and __nss_hostname_digits_dots() falls victim to a classic buffer overflow. That said, the only way to reach this vulnerable code path is through invoking calls to the gethostbyname*() function set, which many popular network applications utilize. In spite of this, there are some mitigating factors which help reduce the overall impact of the issue. For example, the gethostbyname*() functions are being slowly deprecated in favor of getaddrinfo() and some servers only utilize them to perform forward-confirmed reverse DNS lookups, meaning hostnames (which must adhere to strict formatting limitations, in order to reach the vulnerable code) oftentimes will be filtered and sanitized. Additionally, a patch has been around for a while because the bug was actually fixed in May of 2013. Although, at the time, it was not considered a security issue and the patch has since been left out of most stable and long-term-support Linux distributions. That’s not to say that GHOST should be taken lightly. Some of the most popular Linux applications are in fact vulnerable, such as the ping and arping utilities, along with the procmail and exim internet mailing software suites, just to name a few. As part of their analysis, Qualys demonstrated the severity of the issue by developing a working proof-of-concept exploit against the Exim mail server, bypassing existing protection mechanisms such as ASLR. They have indicated that they will be releasing a Metasploit module soon, which makes patching this vulnerability a priority for system administrators. Lastly, an interesting note worth mentioning is that the vulnerability was announced using coordinated disclosure, however, there was a discrepancy during the process in which someone leaked details prior to the coordinated release time. This, unfortunately, gave malicious hackers an opportunity to develop exploit code, which could have been used to attack vulnerable systems. All the more reason to scan your systems for potential GHOST vulnerabilities. As various Linux distributions catch up on releasing fixed packages, BeyondTrust will strive to provide the latest Retina audits concerning The GHOST Vulnerability. Audits release version 2872 provides the following audits: 44739 - RHSA-2015:0090 - glibc security update 44738 - RHSA-2015:0092 - glibc security update 44762 - RHSA-2015:0099 - glibc security update 44760 - RHSA-2015:0101 - glibc security update 44763 - CESA-2015:0090 - glibc security update 44764 - CESA-2015:0092 - glibc security update 44719 - DSA-3142-1: eglibc 44720 - USN-2485-1: GNU C Library 44767 - ELSA-2015-0090: glibc 44765 - ELSA-2015-0092: glibc - v7 44770 - ELSA-2015-0092: glibc - v6 44766 - SUSE-SU-2015:0158-1: glibc - SuSE 11 44768 - SUSE-SU-2015:0158-1: glibc - SuSE 10 44769 - SLSA-2015:0090-1: glibc 44771 - SLSA-2015:0092-1: glibc - SL6 44772 - SLSA-2015:0092-1: glibc - SL7