> For the complete documentation index, see [llms.txt](https://prosbcdocs.telcobridges.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://prosbcdocs.telcobridges.com/tmedia-documentation/server-and-os-administration/ghost-the-glibcs-gethostbyname-vulnerability.md).

# GHOST: The glibc's gethostbyname vulnerability

On January 27, 2015, a vulnerability named "GHOST" in the glibc library was publicly announced. GHOST is also referred as **CVE-2015-0235**. The vulnerability is a buffer overflow in the gethostbyname family of functions that can allow arbitrary code execution.

## Affected Products

* TMG800, TMG3200, TMG7800-CTRL
* Tdev Linux server with (CentOS, RedHat, etc) running Toolpack software

## Details

The impact of this vulnerability on TelcoBridges products depends on their configuration. The vulnerability may only be triggered through requests for domain name resolution. Therefore, only units that enable such services may be exposed to the issue.

## Software Versions and Fixes

The TelcoBridges CentOS 5 repository has been updated with the latest glibc version. Services that use glibc must be restarted. Because glibc is thoroughly used in the Linux operating system, it is highly recommended to reboot the unit.

## Update procedure

The operator can use one of the two methods available: GUI/WebPortal or command line interface.

### WebPortal - TMG unit or Linux server **with access to Internet** (i.e. with DNS configured)

1. login onto the WebPortal
2. Select the 'Hosts' section
3. Click on the hostname
4. Click on the 'Status' tab
5. Select 'Upgrade Linux packages' into the host 'Action'
6. Click on the 'Apply action' button
7. Refresh the page until the packages are updated as indicated in the 'Action Log' (you may use the 'Now' button to update the page). The results should appear within a minute.
8. Select 'Shutdown' into the host 'Action'
9. Select 'Reboot' into the 'Shutdown Type'
10. Click on the 'Apply action' button
11. Repeat the process for all hosts listed

### Command line interface

* login with root account \[root\@TB011107 \~]# uname -m x86\_64
* If the result is not "x86\_64", [please contact TelcoBridges](https://github.com/telcobridges-main/tmedia-wiki/tree/main/reference/misc/contacting-telcobridges-technical-support/README.md) support, otherwise you can proceed with either method below.
* Follow one of the two options depending if Internet is accessible from the unit

#### Option #1 - TMG unit or Linux server **with access to Internet** (i.e. with DNS configured)

* update OS packages with yum yum clean all yum update
* reboot the unit reboot

#### Option #2 - TMG unit or Linux server **without access to Internet**

* download the following packages to your PC:
  * <http://repo.telcobridges.com/centos/5.7/updates/x86\\_64/RPMS/glibc-2.5-123.el5\\_11.1.x86\\_64.rpm>
  * <http://repo.telcobridges.com/centos/5.7/updates/x86\\_64/RPMS/glibc-common-2.5-123.el5\\_11.1.x86\\_64.rpm>
  * <http://repo.telcobridges.com/centos/5.7/updates/x86\\_64/RPMS/glibc-devel-2.5-123.el5\\_11.1.x86\\_64.rpm>
  * <http://repo.telcobridges.com/centos/5.7/updates/x86\\_64/RPMS/glibc-headers-2.5-123.el5\\_11.1.x86\\_64.rpm>
  * <http://repo.telcobridges.com/centos/5.7/updates/x86\\_64/RPMS/nscd-2.5-123.el5\\_11.1.x86\\_64.rpm>
* Using WinSCP or similar tool, upload the files to the TMG unit using the root account
* login with root account
* Install packages yum localinstall glibc-2.5-123.el5\_11.1.x86\_64.rpm\
  glibc-common-2.5-123.el5\_11.1.x86\_64.rpm\
  glibc-devel-2.5-123.el5\_11.1.x86\_64.rpm\
  glibc-headers-2.5-123.el5\_11.1.x86\_64.rpm\
  nscd-2.5-123.el5\_11.1.x86\_64.rpm
* **Note**: that operation might take a long time since yum will probably experience timeouts when trying to access the external repositories.
* Reboot the unit reboot

## How to verify if the vulnerability is fixed?

* login with root account
* execute the following to create a test script cat > rhel-GHOST-test.sh << FOF

1. !/bin/bash
2. rhel-GHOST-test.sh - GHOST vulnerability tester. Only for CentOS/RHEL based servers. #
3. Version 3
4. Credit : Red Hat, Inc - <https://access.redhat.com/labs/ghost/> # echo "Installed glibc version(s)"

   rv=0 for glibc\_nvr in $( rpm -q --qf '%{name}-%{version}-%{release}.%{arch}\n' glibc ); do glibc\_ver=$( echo "$glibc\_nvr" | awk -F- '{ print $2 }' ) glibc\_maj=$( echo "$glibc\_ver" | awk -F. '{ print $1 }') glibc\_min=$( echo "$glibc\_ver" | awk -F. '{ print $2 }')

   echo -n "- $glibc\_nvr: " if \[ "$glibc\_maj" -gt 2 -o ( "$glibc\_maj" -eq 2 -a "$glibc\_min" -ge 18 ) ]; then
5. fixed upstream version echo 'not vulnerable' else
6. all RHEL updates include CVE in rpm %changelog if rpm -q --changelog "$glibc\_nvr" | grep -q 'CVE-2015-0235'; then echo "not vulnerable" else echo "vulnerable" rv=1 fi fi done

   if \[ $rv -ne 0 ]; then cat <\<EOF

   This system is vulnerable to CVE-2015-0235. <https://access.redhat.com/security/cve/CVE-2015-0235> Please refer to <https://access.redhat.com/articles/1332213> for remediation steps EOF fi

   exit $rv

   FOF

* Execute the script chmod +x rhel-GHOST-test.sh ./rhel-GHOST-test.sh
* **You should not see the 'vulnerable' string displayed**

## Verify system timezone

We found that some systems got the timezone reset to EST time after the GHOST patch procedures

* Verify the timezone on the system date

If it differs from the original, reset the timezone using the [tbtimezone](https://github.com/telcobridges-main/tmedia-wiki/tree/main/tmedia/platforms/change-time-zone/README.md) script.

## References

* <https://www.qualys.com/research/security-advisories/GHOST-CVE-2015-0235.txt>
* <https://access.redhat.com/articles/1332213>
* <http://www.cyberciti.biz/faq/cve-2015-0235-patch-ghost-on-debian-ubuntu-fedora-centos-rhel-linux/>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://prosbcdocs.telcobridges.com/tmedia-documentation/server-and-os-administration/ghost-the-glibcs-gethostbyname-vulnerability.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
