CVE-2025-68114: 
NixOS vulnerability analysis and mitigation

Overview

CVE-2025-68114 is a stack buffer underflow/overflow vulnerability in the Capstone disassembly framework affecting versions 6.0.0-Alpha5 and all prior releases. The flaw exists in the SStream_concat function, where an unchecked return value from cs_vsnprintf allows a malicious cs_opt_mem.vsnprintf callback to drive SStream's internal index negative or past the buffer boundary, leading to memory corruption on the next write. It was disclosed on December 17, 2025, with a fix committed to the Capstone repository shortly after. The GitHub Security Advisory (GHSA-85f5-6xr3-q76r) rates this as Moderate with a CVSS v3.1 score of 4.8, while NVD assigns a higher score of 9.8 (Critical) based on a different attack vector assessment (GitHub Advisory, MSRC).

Technical details

The root cause is classified as CWE-120 (Buffer Copy without Checking Size of Input) and CWE-124 (Buffer Underwrite/Buffer Underflow). In SStream.c (lines 227–244), SStream_concat adds the return value of cs_vsnprintf directly to ss->index without validating that the return is non-negative or within the remaining buffer space. A negative return value (e.g., -1) causes an integer underflow of the index field (originally typed as int), and a subsequent call to SStream_concat1 then writes before or beyond ss->buffer, which is stack-allocated. The vsnprintf hook is attacker-controlled via cs_option(CS_OPT_MEM), meaning any embedding that permits untrusted code to install a custom cs_opt_mem callback can be exploited. A proof-of-concept using AddressSanitizer on macOS was included in the advisory, demonstrating a stack-buffer-overflow in SStream_concat1 (GitHub Advisory, Fix Commit).

Impact

Successful exploitation results in stack memory corruption, which can lead to information disclosure, data integrity violations, or denial of service within the process using Capstone. In the worst case, an attacker who can control the cs_opt_mem.vsnprintf callback may achieve arbitrary code execution in the context of the embedding application. The vulnerability is not reachable through untrusted binary input alone — it requires the ability to set Capstone's memory hooks, limiting the attack surface to scenarios where untrusted plugins or scripts can configure cs_option(CS_OPT_MEM) (GitHub Advisory).

Exploitability

A proof-of-concept demonstrating the stack buffer overflow via AddressSanitizer was published as part of the GitHub Security Advisory at the time of disclosure. There is no evidence of in-the-wild exploitation or threat actor attribution as of the time of this report. The EPSS score is approximately 0.013% (0.000130), indicating a very low probability of exploitation in the near term. The vulnerability is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog (GitHub Advisory).

Exploitation steps

  1. Identify a vulnerable embedding: Find an application that uses Capstone 6.0.0-Alpha5 or earlier and exposes the cs_option(CS_OPT_MEM) interface to untrusted code (e.g., a plugin system or scripting engine).
  2. Craft a malicious vsnprintf callback: Write a custom vsnprintf function that returns -1 (or another negative value) regardless of input, forcing SStream_concat to add a negative value to ss->index.
  3. Register the malicious callback: Call cs_option(0, CS_OPT_MEM, (size_t)&mem) with a cs_opt_mem struct pointing to the malicious vsnprintf implementation.
  4. Trigger SStream_concat: Cause the application to invoke any Capstone disassembly operation that internally calls SStream_concat (e.g., disassembling any instruction), which drives ss->index to underflow.
  5. Trigger the subsequent write: A follow-up call to SStream_concat1 uses the corrupted (underflowed) index to write a character before ss->buffer on the stack, causing memory corruption.
  6. Achieve objective: Depending on stack layout and application context, this corruption may overwrite return addresses or other stack data, potentially enabling code execution, crash (DoS), or information leakage (GitHub Advisory, Fix Commit).

Indicators of compromise

  • Process Behavior: Unexpected crashes or segmentation faults in applications embedding Capstone, particularly during disassembly operations; AddressSanitizer reports of stack-buffer-overflow in SStream_concat1.
  • Application Logs: Crash dumps or core files from processes using Capstone libraries, especially those with stack corruption signatures near SStream buffer regions.
  • Code/Configuration: Presence of custom cs_opt_mem callback registrations (cs_option(CS_OPT_MEM, ...)) in untrusted plugin or script code loaded by the application.
  • File System: Unexpected shared library files or plugin binaries loaded by Capstone-embedding applications that register custom memory hooks (GitHub Advisory).

Mitigation and workarounds

The fix is available in commit 2c7797182a1618be12017d7d41e0b6581d5d529e, which adds a negative-return check before updating ss->index and changes the index field type from int to size_t to prevent underflow. Users should upgrade to Capstone 6.0.0 (final release) or apply the patch commit. As a workaround where immediate patching is not possible, restrict or prohibit untrusted code from calling cs_option(CS_OPT_MEM) to install custom vsnprintf implementations. Downstream distributions including SUSE, Red Hat (RHSA-2026:4898, RHSA-2026:5125, RHSA-2026:5123, RHSA-2026:5224, RHSA-2026:6817), Amazon Linux (ALAS2023-2026-1772, ALAS2-2026-3351), and Debian have issued updated packages (Fix Commit, GitHub Advisory).

Community reactions

The vulnerability was reported by GitHub user Finder16 and published by maintainer Rot127 via GitHub Security Advisory. Coverage has appeared in Linux security news outlets including Pro-Linux.de and LinuxSecurity.com, primarily in the context of distribution security updates for SUSE, Red Hat, Oracle Linux, and AlmaLinux. No significant social media controversy or high-profile researcher commentary beyond the advisory itself has been observed (GitHub Advisory).

Additional resources

Linux Distribution fix status

Fix availability across major Linux distributions and their releases.

Debian

Fixed

bookworm

capstone

Affected

sid

capstone: 5.0.7-1

Fixed

trixie

capstone: 5.0.7-1~deb13u1

Fixed

Ubuntu

Unknown

bionic (esm-apps)

capstone

Unknown

devel

capstone

Unknown

focal (esm-apps)

capstone

Unknown

jammy

capstone

Unknown

jammy (esm-apps)

capstone

Unknown

noble

capstone

Unknown

noble (esm-apps)

capstone

Unknown

resolute

capstone

Unknown

RHEL / CentOS

Fixed

OpenShift

Not Affected

RHEL 8

Not Affected

RHEL 9

:appstream:capstone-0:4.0.2-5.el9_0.src

Fixed

RHEL 10

capstone-0:5.0.1-7.el10_0.src

Fixed

Alpine

Fixed

edge

capstone: 5.0.7-r0

Fixed

v3.23

capstone: 5.0.7-r0

Fixed

Source: This report was generated using AI

Related NixOS vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-116199CRITICAL9.2
  • NixOS logoNixOS
  • cpe:2.3:a:snipeitapp:snipe-it
NoYesOct 25, 2026
CVE-2026-116201HIGH8.7
  • NixOS logoNixOS
  • cpe:2.3:a:snipeitapp:snipe-it
NoYesOct 25, 2026
CVE-2026-116200HIGH8.2
  • NixOS logoNixOS
  • cpe:2.3:a:snipeitapp:snipe-it
NoYesOct 25, 2026
CVE-2026-2270MEDIUM5.9
  • NixOS logoNixOS
  • kubernetes
NoYesOct 26, 2026
CVE-2026-76654MEDIUM5.8
  • NixOS logoNixOS
  • cpe:2.3:a:kubernetes:kubernetes
NoYesOct 26, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Additional Wiz resources

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management