# CVE-2016-2851: Integer overflow in n/a

> Remote attackers can execute arbitrary code or cause denial of service via integer overflow leading to heap buffer overflow in libotr.

- **Severity:** Critical 9.8 (`CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 7 Apr 2016
- **Updated:** 5 Aug 2024
- **Also known as:** DEBIAN-CVE-2016-2851, DSA-3512-1, GHSA-p3jg-fm9x-hc9c, MGASA-2016-0117, SUSE-SU-2016:0706-1, SUSE-SU-2016:0707-1, UBUNTU-CVE-2016-2851, openSUSE-SU-2024:10546-1

## What is CVE-2016-2851?

CVE-2016-2851 is a critical vulnerability in Debian Debian Linux, published on 7 Apr 2016. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

Integer overflow in proto.c in libotr before 4.1.1 on 64-bit platforms allows remote attackers to cause a denial of service (memory corruption and application crash) or execute arbitrary code via a series of large OTR messages, which triggers a heap-based buffer overflow.

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

## Which versions are affected by CVE-2016-2851?

It affects 4 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `libotr` | SUSE:Linux Enterprise Desktop 11 SP4 | All versions | 3.2.0-10.5.1 |
| `libotr` | SUSE:Linux Enterprise Desktop 12 | All versions | 4.0.0-9.1 |
| `libotr` | SUSE:Linux Enterprise Desktop 12 SP1 | All versions | 4.0.0-9.1 |
| `libotr` | SUSE:Linux Enterprise Server 11 SP4 | All versions | 3.2.0-10.5.1 |
| `libotr` | SUSE:Linux Enterprise Server 12 | All versions | 4.0.0-9.1 |
| `libotr` | SUSE:Linux Enterprise Server 12 SP1 | All versions | 4.0.0-9.1 |
| `libotr` | SUSE:Linux Enterprise Server for SAP Applications 11 SP4 | All versions | 3.2.0-10.5.1 |
| `libotr` | SUSE:Linux Enterprise Server for SAP Applications 12 | All versions | 4.0.0-9.1 |
| `libotr` | SUSE:Linux Enterprise Server for SAP Applications 12 SP1 | All versions | 4.0.0-9.1 |
| `libotr` | SUSE:Linux Enterprise Software Development Kit 11 SP4 | All versions | 3.2.0-10.5.1 |
| `libotr` | SUSE:Linux Enterprise Software Development Kit 12 | All versions | 4.0.0-9.1 |
| `libotr` | SUSE:Linux Enterprise Software Development Kit 12 SP1 | All versions | 4.0.0-9.1 |

Products: Cypherpunks Libotr, Debian Debian Linux, Opensuse Leap, Opensuse Opensuse.

## How do I fix CVE-2016-2851?

Upgrade to a fixed version.

## Is CVE-2016-2851 being exploited?

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

Public exploit code:

- libotr 4.1.0 - Memory Corruption (exploitdb)

## Other vulnerabilities in Debian Debian Linux

- [CVE-2012-3461](https://insights.sbomify.com/CVE-2012-3461/): Memory corruption in n/a (medium 4.3)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2016-2851 and fix it if it is affected.

What it is: CVE-2016-2851 is a critical vulnerability in Debian Debian Linux, published on 7 Apr 2016. 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-2016-2851 in the wild and no public exploit code.

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

## Sources

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

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