# CVE-2015-0235: Memory corruption in n/a

> Heap-based buffer overflow in glibc allows remote attackers to execute arbitrary code via crafted hostname inputs to gethostbyname functions.

- **Severity:** Critical 10.0 (`AV:N/AC:L/Au:N/C:C/I:C/A:C`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 28 Jan 2015
- **Updated:** 6 Aug 2024
- **Also known as:** DEBIAN-CVE-2015-0235, DLA-139-1, GHSA-jwcp-p679-fcr4, RHSA-2015:0090, RHSA-2015:0092, RHSA-2015:0099, RHSA-2015:0101

## What is CVE-2015-0235?

CVE-2015-0235 is a critical memory corruption vulnerability in Apple Mac Os X, published on 28 Jan 2015. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

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."

Weakness: CWE-787 (Out-of-bounds Write)

## Which versions are affected by CVE-2015-0235?

It affects 18 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `glibc` | Red Hat:enterprise_linux:5::client | All versions | 0:2.5-123.el5_11.1 |
| `glibc-common` | Red Hat:enterprise_linux:5::client | All versions | 0:2.5-123.el5_11.1 |
| `glibc-debuginfo` | Red Hat:enterprise_linux:5::client | All versions | 0:2.5-123.el5_11.1 |
| `glibc-debuginfo-common` | Red Hat:enterprise_linux:5::client | All versions | 0:2.5-123.el5_11.1 |
| `glibc-devel` | Red Hat:enterprise_linux:5::client | All versions | 0:2.5-123.el5_11.1 |
| `glibc-headers` | Red Hat:enterprise_linux:5::client | All versions | 0:2.5-123.el5_11.1 |
| `glibc-utils` | Red Hat:enterprise_linux:5::client | All versions | 0:2.5-123.el5_11.1 |
| `nscd` | Red Hat:enterprise_linux:5::client | All versions | 0:2.5-123.el5_11.1 |
| `glibc` | Red Hat:enterprise_linux:5::server | All versions | 0:2.5-123.el5_11.1 |
| `glibc-common` | Red Hat:enterprise_linux:5::server | All versions | 0:2.5-123.el5_11.1 |
| `glibc-debuginfo` | Red Hat:enterprise_linux:5::server | All versions | 0:2.5-123.el5_11.1 |
| `glibc-debuginfo-common` | Red Hat:enterprise_linux:5::server | All versions | 0:2.5-123.el5_11.1 |
| `glibc-devel` | Red Hat:enterprise_linux:5::server | All versions | 0:2.5-123.el5_11.1 |
| `glibc-headers` | Red Hat:enterprise_linux:5::server | All versions | 0:2.5-123.el5_11.1 |
| `glibc-utils` | Red Hat:enterprise_linux:5::server | All versions | 0:2.5-123.el5_11.1 |
| `nscd` | Red Hat:enterprise_linux:5::server | All versions | 0:2.5-123.el5_11.1 |
| `glibc` | Red Hat:enterprise_linux:6::client | All versions | 0:2.12-1.149.el6_6.5 |
| `glibc-common` | Red Hat:enterprise_linux:6::client | All versions | 0:2.12-1.149.el6_6.5 |
| `glibc-debuginfo` | Red Hat:enterprise_linux:6::client | All versions | 0:2.12-1.149.el6_6.5 |
| `glibc-debuginfo-common` | Red Hat:enterprise_linux:6::client | All versions | 0:2.12-1.149.el6_6.5 |
| `glibc-devel` | Red Hat:enterprise_linux:6::client | All versions | 0:2.12-1.149.el6_6.5 |
| `glibc-headers` | Red Hat:enterprise_linux:6::client | All versions | 0:2.12-1.149.el6_6.5 |
| `glibc-static` | Red Hat:enterprise_linux:6::client | All versions | 0:2.12-1.149.el6_6.5 |
| `glibc-utils` | Red Hat:enterprise_linux:6::client | All versions | 0:2.12-1.149.el6_6.5 |
| `nscd` | Red Hat:enterprise_linux:6::client | All versions | 0:2.12-1.149.el6_6.5 |
| `glibc` | Red Hat:enterprise_linux:6::computenode | All versions | 0:2.12-1.149.el6_6.5 |
| `glibc-common` | Red Hat:enterprise_linux:6::computenode | All versions | 0:2.12-1.149.el6_6.5 |
| `glibc-debuginfo` | Red Hat:enterprise_linux:6::computenode | All versions | 0:2.12-1.149.el6_6.5 |
| `glibc-debuginfo-common` | Red Hat:enterprise_linux:6::computenode | All versions | 0:2.12-1.149.el6_6.5 |
| `glibc-devel` | Red Hat:enterprise_linux:6::computenode | All versions | 0:2.12-1.149.el6_6.5 |
| `glibc-headers` | Red Hat:enterprise_linux:6::computenode | All versions | 0:2.12-1.149.el6_6.5 |
| `glibc-static` | Red Hat:enterprise_linux:6::computenode | All versions | 0:2.12-1.149.el6_6.5 |
| `glibc-utils` | Red Hat:enterprise_linux:6::computenode | All versions | 0:2.12-1.149.el6_6.5 |
| `nscd` | Red Hat:enterprise_linux:6::computenode | All versions | 0:2.12-1.149.el6_6.5 |
| `glibc` | Red Hat:enterprise_linux:6::server | All versions | 0:2.12-1.149.el6_6.5 |
| `glibc-common` | Red Hat:enterprise_linux:6::server | All versions | 0:2.12-1.149.el6_6.5 |
| `glibc-debuginfo` | Red Hat:enterprise_linux:6::server | All versions | 0:2.12-1.149.el6_6.5 |
| `glibc-debuginfo-common` | Red Hat:enterprise_linux:6::server | All versions | 0:2.12-1.149.el6_6.5 |
| `glibc-devel` | Red Hat:enterprise_linux:6::server | All versions | 0:2.12-1.149.el6_6.5 |
| `glibc-headers` | Red Hat:enterprise_linux:6::server | All versions | 0:2.12-1.149.el6_6.5 |

Products: Apple Mac Os X, Debian Debian Linux, Gnu Glibc, Ibm Pureapplication System, Ibm Security Access Manager for Enterprise Single Sign-On, Oracle Communications Application Session Controller, Oracle Communications Eagle Application Processor, Oracle Communications Eagle Lnp Application Processor, Oracle Communications Lsms, Oracle Communications Policy Management, Oracle Communications Session Border Controller, Oracle Communications User Data Repository, Oracle Communications Webrtc Session Controller, Oracle Exalogic Infrastructure, Oracle Linux, Oracle Vm Virtualbox, Php Php, Redhat Virtualization.

## How do I fix CVE-2015-0235?

Upgrade to a fixed version.

## Is CVE-2015-0235 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2015-0235 exists.

Public exploit code:

- Ansible playbook to check vulnerability for CVE-2015-0235 (github_poc): https://github.com/aaronfay/CVE-2015-0235-test
- Test wether you're exposed to ghost (CVE-2015-0235). All kudos go to Qualys Security (github_poc): https://github.com/fser/ghost-checker
- A shared library wrapper with additional checks for vulnerable functions gethostbyname2_r gethostbyname_r (GHOST vulnerability) (github_poc): https://github.com/makelinux/CVE-2015-0235-workaround
- CVE-2015-0235 EXIM ESTMP GHOST Glibc Gethostbyname() DoS Exploit/PoC (github_poc): https://github.com/arm13/ghost_exploit
- A chef cookbook to test the GHOST vulnerability (github_poc): https://github.com/mikesplain/CVE-2015-0235-cookbook
- https://github.com/furyutei/CVE-2015-0235_GHOST (github_poc): https://github.com/furyutei/CVE-2015-0235_GHOST

## Other vulnerabilities in Apple Mac Os X

- [CVE-2014-7169](https://insights.sbomify.com/CVE-2014-7169/): GNU Bourne-Again Shell (Bash) Arbitrary Code Execution (critical 9.8, exploited in the wild)
- [CVE-2014-6271](https://insights.sbomify.com/CVE-2014-6271/): GNU Bourne-Again Shell (Bash) Arbitrary Code Execution (critical 9.8, exploited in the wild)
- [CVE-2012-1823](https://insights.sbomify.com/CVE-2012-1823/): PHP-CGI Query String Parameter (critical 9.8, exploited in the wild)
- [CVE-2021-30713](https://insights.sbomify.com/CVE-2021-30713/): Apple macOS Unspecified (high 7.8, exploited in the wild)
- [CVE-2019-8526](https://insights.sbomify.com/CVE-2019-8526/): Apple macOS Use-After-Free (high 7.8, exploited in the wild)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2015-0235 and fix it if it is affected.

What it is: CVE-2015-0235 is a critical memory corruption vulnerability in Apple Mac Os X, published on 28 Jan 2015. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2015-0235 exists.

Affected product: Apple Mac Os X. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2015-0235/ (Markdown: https://insights.sbomify.com/CVE-2015-0235/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2015-0235
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2015-0235
- OSV: https://osv.dev/vulnerability/CVE-2015-0235

---
From sbomify Insights: https://insights.sbomify.com/CVE-2015-0235/
Summaries are generated and may contain mistakes; the official description above is the record.
