# CVE-2012-0870: Memory corruption in n/a

> Remote attackers can cause denial of service or execute arbitrary code via a crafted Batched request in Samba's smbd daemon.

- **Severity:** High 7.9 (`AV:A/AC:M/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:** 23 Feb 2012
- **Updated:** 6 Aug 2024
- **Also known as:** DEBIAN-CVE-2012-0870, ECHO-d4ae-b892-b60e, GHSA-h6wh-2qjc-xjwm, RHSA-2012:0332

## What is CVE-2012-0870?

CVE-2012-0870 is a high-severity memory corruption vulnerability in Samba Samba, published on 23 Feb 2012. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

Heap-based buffer overflow in process.c in smbd in Samba 3.0, as used in the file-sharing service on the BlackBerry PlayBook tablet before 2.0.0.7971 and other products, allows remote attackers to cause a denial of service (daemon crash) or possibly execute arbitrary code via a Batched (aka AndX) request that triggers infinite recursion.

Weakness: CWE-119 (Improper Restriction of Operations within the Bounds of a Memory Buffer)

## Which versions are affected by CVE-2012-0870?

It affects 3 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `samba` | Red Hat:enterprise_linux:4::as | All versions | 0:3.0.33-0.35.el4 |
| `samba-client` | Red Hat:enterprise_linux:4::as | All versions | 0:3.0.33-0.35.el4 |
| `samba-common` | Red Hat:enterprise_linux:4::as | All versions | 0:3.0.33-0.35.el4 |
| `samba-debuginfo` | Red Hat:enterprise_linux:4::as | All versions | 0:3.0.33-0.35.el4 |
| `samba-swat` | Red Hat:enterprise_linux:4::as | All versions | 0:3.0.33-0.35.el4 |
| `samba` | Red Hat:enterprise_linux:4::desktop | All versions | 0:3.0.33-0.35.el4 |
| `samba-client` | Red Hat:enterprise_linux:4::desktop | All versions | 0:3.0.33-0.35.el4 |
| `samba-common` | Red Hat:enterprise_linux:4::desktop | All versions | 0:3.0.33-0.35.el4 |
| `samba-debuginfo` | Red Hat:enterprise_linux:4::desktop | All versions | 0:3.0.33-0.35.el4 |
| `samba-swat` | Red Hat:enterprise_linux:4::desktop | All versions | 0:3.0.33-0.35.el4 |
| `samba` | Red Hat:enterprise_linux:4::es | All versions | 0:3.0.33-0.35.el4 |
| `samba-client` | Red Hat:enterprise_linux:4::es | All versions | 0:3.0.33-0.35.el4 |
| `samba-common` | Red Hat:enterprise_linux:4::es | All versions | 0:3.0.33-0.35.el4 |
| `samba-debuginfo` | Red Hat:enterprise_linux:4::es | All versions | 0:3.0.33-0.35.el4 |
| `samba-swat` | Red Hat:enterprise_linux:4::es | All versions | 0:3.0.33-0.35.el4 |
| `samba` | Red Hat:enterprise_linux:4::ws | All versions | 0:3.0.33-0.35.el4 |
| `samba-client` | Red Hat:enterprise_linux:4::ws | All versions | 0:3.0.33-0.35.el4 |
| `samba-common` | Red Hat:enterprise_linux:4::ws | All versions | 0:3.0.33-0.35.el4 |
| `samba-debuginfo` | Red Hat:enterprise_linux:4::ws | All versions | 0:3.0.33-0.35.el4 |
| `samba-swat` | Red Hat:enterprise_linux:4::ws | All versions | 0:3.0.33-0.35.el4 |
| `libsmbclient` | Red Hat:enterprise_linux:5::client | All versions | 0:3.0.33-3.38.el5_8 |
| `samba` | Red Hat:enterprise_linux:5::client | All versions | 0:3.0.33-3.38.el5_8 |
| `samba-client` | Red Hat:enterprise_linux:5::client | All versions | 0:3.0.33-3.38.el5_8 |
| `samba-common` | Red Hat:enterprise_linux:5::client | All versions | 0:3.0.33-3.38.el5_8 |
| `samba-debuginfo` | Red Hat:enterprise_linux:5::client | All versions | 0:3.0.33-3.38.el5_8 |
| `samba-swat` | Red Hat:enterprise_linux:5::client | All versions | 0:3.0.33-3.38.el5_8 |
| `libsmbclient-devel` | Red Hat:enterprise_linux:5::client_workstation | All versions | 0:3.0.33-3.38.el5_8 |
| `samba` | Red Hat:enterprise_linux:5::client_workstation | All versions | 0:3.0.33-3.38.el5_8 |
| `samba-debuginfo` | Red Hat:enterprise_linux:5::client_workstation | All versions | 0:3.0.33-3.38.el5_8 |
| `libsmbclient` | Red Hat:enterprise_linux:5::server | All versions | 0:3.0.33-3.38.el5_8 |
| `libsmbclient-devel` | Red Hat:enterprise_linux:5::server | All versions | 0:3.0.33-3.38.el5_8 |
| `samba` | Red Hat:enterprise_linux:5::server | All versions | 0:3.0.33-3.38.el5_8 |
| `samba-client` | Red Hat:enterprise_linux:5::server | All versions | 0:3.0.33-3.38.el5_8 |
| `samba-common` | Red Hat:enterprise_linux:5::server | All versions | 0:3.0.33-3.38.el5_8 |
| `samba-debuginfo` | Red Hat:enterprise_linux:5::server | All versions | 0:3.0.33-3.38.el5_8 |
| `samba-swat` | Red Hat:enterprise_linux:5::server | All versions | 0:3.0.33-3.38.el5_8 |
| `libsmbclient` | Red Hat:rhel_eus:5.6 | All versions | 0:3.0.33-3.29.el5_6.4 |
| `libsmbclient-devel` | Red Hat:rhel_eus:5.6 | All versions | 0:3.0.33-3.29.el5_6.4 |
| `samba` | Red Hat:rhel_eus:5.6 | All versions | 0:3.0.33-3.29.el5_6.4 |
| `samba-client` | Red Hat:rhel_eus:5.6 | All versions | 0:3.0.33-3.29.el5_6.4 |

Products: Rim Blackberry Playbook Os, Rim Blackberry Playbook Tablet, Samba Samba.

## How do I fix CVE-2012-0870?

Upgrade to a fixed version.

## Is CVE-2012-0870 being exploited?

There is no known exploitation of CVE-2012-0870 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2012-0870 and fix it if it is affected.

What it is: CVE-2012-0870 is a high-severity memory corruption vulnerability in Samba Samba, published on 23 Feb 2012. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2012-0870 in the wild and no public exploit code.

Affected product: Samba Samba. 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-2012-0870/ (Markdown: https://insights.sbomify.com/CVE-2012-0870/index.md)
```

## Sources

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

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