# CVE-2025-68114: Capstone doesn't check vsnprintf return in SStream_concat, allows stack buffer underflow and overflow

> A malicious vsnprintf callback in Capstone can cause stack buffer underflow or overflow, potentially leading to code execution or crashes.

- **Severity:** Medium 4.8 (`CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:L/I:L/A:L`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Local or same network only
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 17 Dec 2025
- **Updated:** 18 Dec 2025
- **Also known as:** ALSA-2026:39309, AZL-72697, AZL-72821, AZL-74805, BELL-CVE-2025-68114, CLSA-2026-1774347657, CLSA-2026-1774352914, DEBIAN-CVE-2025-68114, GHSA-85f5-6xr3-q76r, RHSA-2026:39309, RLSA-2026:39309, UBUNTU-CVE-2025-68114

## What is CVE-2025-68114?

CVE-2025-68114 is a medium-severity memory corruption vulnerability in capstone-engine capstone, published on 17 Dec 2025. 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 is a disassembly framework. In versions 6.0.0-Alpha5 and prior, an unchecked vsnprintf return in SStream_concat lets a malicious cs_opt_mem.vsnprintf drive SStream’s index negative or past the end, leading to a stack buffer underflow/overflow when the next write occurs. Commit 2c7797182a1618be12017d7d41e0b6581d5d529e fixes the issue.

Weakness: CWE-124 (Buffer Underwrite), CWE-120 (Buffer Copy without Checking Size of Input)

## Which versions are affected by CVE-2025-68114?

It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `capstone` | AlmaLinux:9 | All versions | 4.0.2-13.el9_8 |
| `capstone-devel` | AlmaLinux:9 | All versions | 4.0.2-13.el9_8 |
| `capstone-java` | AlmaLinux:9 | All versions | 4.0.2-13.el9_8 |
| `python3-capstone` | AlmaLinux:9 | All versions | 4.0.2-13.el9_8 |
| `capstone` | Red Hat:enterprise_linux:9::appstream | All versions | 0:4.0.2-13.el9_8 |
| `capstone-debuginfo` | Red Hat:enterprise_linux:9::appstream | All versions | 0:4.0.2-13.el9_8 |
| `capstone-debugsource` | Red Hat:enterprise_linux:9::appstream | All versions | 0:4.0.2-13.el9_8 |
| `python3-capstone-debuginfo` | Red Hat:enterprise_linux:9::appstream | All versions | 0:4.0.2-13.el9_8 |
| `capstone-debuginfo` | Red Hat:enterprise_linux:9::crb | All versions | 0:4.0.2-13.el9_8 |
| `capstone-debugsource` | Red Hat:enterprise_linux:9::crb | All versions | 0:4.0.2-13.el9_8 |
| `capstone-devel` | Red Hat:enterprise_linux:9::crb | All versions | 0:4.0.2-13.el9_8 |
| `capstone-java` | Red Hat:enterprise_linux:9::crb | All versions | 0:4.0.2-13.el9_8 |
| `python3-capstone` | Red Hat:enterprise_linux:9::crb | All versions | 0:4.0.2-13.el9_8 |
| `python3-capstone-debuginfo` | Red Hat:enterprise_linux:9::crb | All versions | 0:4.0.2-13.el9_8 |
| `capstone` | Rocky Linux:9 | All versions | 0:4.0.2-13.el9_8 |

Products: Capstone-Engine Capstone.

## How do I fix CVE-2025-68114?

Apply the vendor's patch.

## Is CVE-2025-68114 being exploited?

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

## Other vulnerabilities in capstone-engine capstone

- [CVE-2017-6952](https://insights.sbomify.com/CVE-2017-6952/): Capstone Integer overflow (high 8.8)
- [CVE-2016-7151](https://insights.sbomify.com/CVE-2016-7151/): Capstone SEGV caused by a read memory access (medium 5.5)
- [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)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2025-68114 and fix it if it is affected.

What it is: CVE-2025-68114 is a medium-severity memory corruption vulnerability in capstone-engine capstone, published on 17 Dec 2025. 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: It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-68114 exists.

Affected product: capstone-engine capstone. 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-2025-68114/ (Markdown: https://insights.sbomify.com/CVE-2025-68114/index.md)
```

## Sources

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

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