# CVE-2015-0240: Use after free in n/a

> Remote attackers can execute arbitrary code on Samba servers via crafted Netlogon packets exploiting an uninitialized stack pointer free operation.

- **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:** 24 Feb 2015
- **Updated:** 9 May 2025
- **Also known as:** DEBIAN-CVE-2015-0240, DLA-156-1, DSA-3171-1, ECHO-2110-1c89-9bef, GHSA-wjcr-wjqx-g6rq, MGASA-2015-0084, RHSA-2015:0249, RHSA-2015:0250, RHSA-2015:0251, RHSA-2015:0252, RHSA-2015:0253, RHSA-2015:0254, RHSA-2015:0255, RHSA-2015:0256, RHSA-2015:0257, SUSE-SU-2015:0353-1, SUSE-SU-2015:0371-1, UBUNTU-CVE-2015-0240, USN-2508-1

## What is CVE-2015-0240?

CVE-2015-0240 is a critical use after free vulnerability in Canonical Ubuntu Linux, published on 24 Feb 2015. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

The Netlogon server implementation in smbd in Samba 3.5.x and 3.6.x before 3.6.25, 4.0.x before 4.0.25, 4.1.x before 4.1.17, and 4.2.x before 4.2.0rc5 performs a free operation on an uninitialized stack pointer, which allows remote attackers to execute arbitrary code via crafted Netlogon packets that use the ServerPasswordSet RPC API, as demonstrated by packets reaching the _netr_ServerPasswordSet function in rpc_server/netlogon/srv_netlog_nt.c.

Weakness: CWE-17

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

It affects 6 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `samba3x` | Red Hat:enterprise_linux:5::client | All versions | 0:3.6.23-9.el5_11 |
| `samba3x-client` | Red Hat:enterprise_linux:5::client | All versions | 0:3.6.23-9.el5_11 |
| `samba3x-common` | Red Hat:enterprise_linux:5::client | All versions | 0:3.6.23-9.el5_11 |
| `samba3x-debuginfo` | Red Hat:enterprise_linux:5::client | All versions | 0:3.6.23-9.el5_11 |
| `samba3x-doc` | Red Hat:enterprise_linux:5::client | All versions | 0:3.6.23-9.el5_11 |
| `samba3x-domainjoin-gui` | Red Hat:enterprise_linux:5::client | All versions | 0:3.6.23-9.el5_11 |
| `samba3x-swat` | Red Hat:enterprise_linux:5::client | All versions | 0:3.6.23-9.el5_11 |
| `samba3x-winbind` | Red Hat:enterprise_linux:5::client | All versions | 0:3.6.23-9.el5_11 |
| `samba3x` | Red Hat:enterprise_linux:5::client_workstation | All versions | 0:3.6.23-9.el5_11 |
| `samba3x-debuginfo` | Red Hat:enterprise_linux:5::client_workstation | All versions | 0:3.6.23-9.el5_11 |
| `samba3x-winbind-devel` | Red Hat:enterprise_linux:5::client_workstation | All versions | 0:3.6.23-9.el5_11 |
| `samba3x` | Red Hat:enterprise_linux:5::server | All versions | 0:3.6.23-9.el5_11 |
| `samba3x-client` | Red Hat:enterprise_linux:5::server | All versions | 0:3.6.23-9.el5_11 |
| `samba3x-common` | Red Hat:enterprise_linux:5::server | All versions | 0:3.6.23-9.el5_11 |
| `samba3x-debuginfo` | Red Hat:enterprise_linux:5::server | All versions | 0:3.6.23-9.el5_11 |
| `samba3x-doc` | Red Hat:enterprise_linux:5::server | All versions | 0:3.6.23-9.el5_11 |
| `samba3x-domainjoin-gui` | Red Hat:enterprise_linux:5::server | All versions | 0:3.6.23-9.el5_11 |
| `samba3x-swat` | Red Hat:enterprise_linux:5::server | All versions | 0:3.6.23-9.el5_11 |
| `samba3x-winbind` | Red Hat:enterprise_linux:5::server | All versions | 0:3.6.23-9.el5_11 |
| `samba3x-winbind-devel` | Red Hat:enterprise_linux:5::server | All versions | 0:3.6.23-9.el5_11 |
| `libsmbclient` | Red Hat:enterprise_linux:6::client | All versions | 0:3.6.23-14.el6_6 |
| `libsmbclient-devel` | Red Hat:enterprise_linux:6::client | All versions | 0:3.6.23-14.el6_6 |
| `samba` | Red Hat:enterprise_linux:6::client | All versions | 0:3.6.23-14.el6_6 |
| `samba-client` | Red Hat:enterprise_linux:6::client | All versions | 0:3.6.23-14.el6_6 |
| `samba-common` | Red Hat:enterprise_linux:6::client | All versions | 0:3.6.23-14.el6_6 |
| `samba-debuginfo` | Red Hat:enterprise_linux:6::client | All versions | 0:3.6.23-14.el6_6 |
| `samba-doc` | Red Hat:enterprise_linux:6::client | All versions | 0:3.6.23-14.el6_6 |
| `samba-domainjoin-gui` | Red Hat:enterprise_linux:6::client | All versions | 0:3.6.23-14.el6_6 |
| `samba-glusterfs` | Red Hat:enterprise_linux:6::client | All versions | 0:3.6.23-14.el6_6 |
| `samba-swat` | Red Hat:enterprise_linux:6::client | All versions | 0:3.6.23-14.el6_6 |
| `samba-winbind` | Red Hat:enterprise_linux:6::client | All versions | 0:3.6.23-14.el6_6 |
| `samba-winbind-clients` | Red Hat:enterprise_linux:6::client | All versions | 0:3.6.23-14.el6_6 |
| `samba-winbind-devel` | Red Hat:enterprise_linux:6::client | All versions | 0:3.6.23-14.el6_6 |
| `samba-winbind-krb5-locator` | Red Hat:enterprise_linux:6::client | All versions | 0:3.6.23-14.el6_6 |
| `samba4` | Red Hat:enterprise_linux:6::client | All versions | 0:4.0.0-66.el6_6.rc4 |
| `samba4-client` | Red Hat:enterprise_linux:6::client | All versions | 0:4.0.0-66.el6_6.rc4 |
| `samba4-common` | Red Hat:enterprise_linux:6::client | All versions | 0:4.0.0-66.el6_6.rc4 |
| `samba4-dc` | Red Hat:enterprise_linux:6::client | All versions | 0:4.0.0-66.el6_6.rc4 |
| `samba4-dc-libs` | Red Hat:enterprise_linux:6::client | All versions | 0:4.0.0-66.el6_6.rc4 |
| `samba4-debuginfo` | Red Hat:enterprise_linux:6::client | All versions | 0:4.0.0-66.el6_6.rc4 |

Products: Canonical Ubuntu Linux, Novell Suse Linux Enterprise Desktop, Novell Suse Linux Enterprise Server, Novell Suse Linux Enterprise Software Development Kit, Redhat Enterprise Linux, Samba Samba.

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

Upgrade to a fixed version.

## Is CVE-2015-0240 being exploited?

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

Public exploit code:

- Samba < 3.6.2 (x86) - Denial of Service (PoC) (exploitdb)
- Samba _netr_ServerPasswordSet Uninitialized Credential State (metasploit)

## Other vulnerabilities in Canonical Ubuntu Linux

- [CVE-2020-11651](https://insights.sbomify.com/CVE-2020-11651/): SaltStack Salt Authentication Bypass (critical 9.8, exploited in the wild)
- [CVE-2020-7247](https://insights.sbomify.com/CVE-2020-7247/): OpenSMTPD Remote Code Execution (critical 9.8, exploited in the wild)
- [CVE-2019-16928](https://insights.sbomify.com/CVE-2019-16928/): Exim Out-of-bounds Write (critical 9.8, exploited in the wild)
- [CVE-2018-6789](https://insights.sbomify.com/CVE-2018-6789/): Exim Buffer Overflow (critical 9.8, exploited in the wild)
- [CVE-2015-2590](https://insights.sbomify.com/CVE-2015-2590/): Oracle Java SE and Java SE Embedded Remote Code Execution (critical 9.8, exploited in the wild)

## Fix prompt for AI coding agents

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

What it is: CVE-2015-0240 is a critical use after free vulnerability in Canonical Ubuntu Linux, published on 24 Feb 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-0240 exists.

Affected product: Canonical Ubuntu Linux. 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-0240/ (Markdown: https://insights.sbomify.com/CVE-2015-0240/index.md)
```

## Sources

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

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