# CVE-2016-7151: Capstone SEGV caused by a read memory access

> An out-of-bounds read in the Capstone disassembly library can cause a segmentation fault, leading to denial of service.

- **Severity:** Medium 5.5 (`CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Local or same network only
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 15 May 2019
- **Updated:** 6 Aug 2024
- **Also known as:** DEBIAN-CVE-2016-7151, GHSA-xx4j-rvcc-2vhr, UBUNTU-CVE-2016-7151

## What is CVE-2016-7151?

CVE-2016-7151 is a medium-severity memory corruption vulnerability in n/a, published on 15 May 2019. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.

### Official description

Capstone 3.0.4 has an out-of-bounds vulnerability (SEGV caused by a read memory access) in X86_insn_reg_intel in arch/X86/X86Mapping.c.

Weakness: CWE-125 (Out-of-bounds Read)

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

2 open source packages ship an affected version, including capstone. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `capstone` | PyPI | All versions | 4.0.0 |
| `capstone` | PyPI | All versions | 4.0.0 |

Products: Capstone-Engine Capstone.

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

Upgrade capstone to 4.0.0 or later.

## Is CVE-2016-7151 being exploited?

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

## Other vulnerabilities in n/a

- [CVE-2017-6952](https://insights.sbomify.com/CVE-2017-6952/): Capstone Integer overflow (high 8.8)
- [CVE-2026-47143](https://insights.sbomify.com/CVE-2026-47143/): Capstone has a NULL Pointer Dereference with 3DNow! opcodes (medium 5.1)
- [CVE-2025-67873](https://insights.sbomify.com/CVE-2025-67873/): Capstone doesn't check Skipdata length, leading to cs_insn.bytes heap buffer overflow (medium 4.8)
- [CVE-2025-68114](https://insights.sbomify.com/CVE-2025-68114/): Capstone doesn't check vsnprintf return in SStream_concat, allows stack buffer underflow and overflow (medium 4.8)

## Fix prompt for AI coding agents

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

What it is: CVE-2016-7151 is a medium-severity memory corruption vulnerability in n/a, published on 15 May 2019. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2016-7151 in the wild and no public exploit code.

Affected packages and fixed versions:
- capstone (PyPI): affected all versions; fixed in 4.0.0
- capstone (PyPI): affected all versions; fixed in 4.0.0

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

## Sources

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

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