Capstone
CVE-2025-68114
CRITICAL
Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessReach Capstone disassembly with controlled input
-
DeliveryCause vsnprintf to return negative
-
ExploitUnderflow signed SStream.index
-
ExecutionSStream_concat1 writes before buffer
-
ImpactOut-of-bounds read/write corrupts memory
Vulnerability Assessment
| Weakness |
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Buffer copy size validation
MITRE ATT&CK
1 technique across 1 tactic: Execution The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires reaching Capstone's SStream formatting path (SStream_concat) with the internal vsnprintf returning a negative value, which underflows the signed SStream.index and triggers out-of-bounds access on the next write. The demonstrated trigger depends on attacker control of Capstone's memory callbacks via cs_option(CS_OPT_MEM) to install a failing vsnprintf - a non-default configuration. Limiting factors: under default configuration vsnprintf virtually never returns negative, so the practical attack surface is narrow and largely confined to integrations that disassemble untrusted input and encounter a genuine formatting error, or that expose the custom-allocator API to untrusted control. Affected versions are capstone through the fix and the 6.0.0 alpha1-alpha5 pre-releases; fixed in Alpine 5.0.7-r0 and upstream. |
| Impact | The input CVSS base score of 9.8 (AV:N/AC:L/PR:N/UI:N, C:H/I:H/A:H) paints this as a critical, trivially-exploitable remote code execution flaw, but the corroborating signals strongly contradict that severity. EPSS is only 0.04% (12th percentile), there is no CISA KEV listing, and no independent exploit has surfaced. More importantly, the source-code evidence shows the actual root cause: an underflow of the signed SStream.index field (fixed by changing it to size_t and adding a return/overflow check when vsnprintf returns a negative value). The provided proof-of-concept test can only trigger the underflow by injecting a malicious vsnprintf via Capstone's CS_OPT_MEM custom-allocator callback (evil_vsnprintf returns -1). In normal deployments vsnprintf effectively never returns negative, so the AC:L rating in the input is questionable - reaching the underflow is NOT low-complexity under default configuration. This is best characterized as a genuine memory-safety defect with a high theoretical impact but low real-world exploitation probability: a high-CVSS-but-low-real-risk issue for most consumers, worth patching on normal maintenance cycles rather than emergency escalation. CONFLICT TO NOTE: CVSS claims AV:N/AC:L, yet the only demonstrated trigger requires attacker control over Capstone's memory/vsnprintf callback or an environment where vsnprintf legitimately fails - verify the realistic trigger path against your integration. |
| Exploit ScenarioDerived | An application links Capstone to disassemble attacker-supplied binary data; if a code path causes the internal vsnprintf to return a negative value (error), SStream.index underflows and a subsequent SStream_concat1 writes before the buffer, enabling out-of-bounds read/write that could corrupt memory or crash the process. The commit ships a demonstrating unit test (test_underflow_in_sstream) that forces the condition via a custom vsnprintf memory callback, but no weaponized public exploit exists; practical exploitation against a default configuration requires a realistic way to make vsnprintf fail, which is uncommon. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv2 – Oct 13, 2026
Out-of-bounds read/write in the Capstone disassembly engine's SStream string-formatting path can be triggered when the internal vsnprintf callback returns a negative value, underflowing the SStream index counter and causing subsequent writes to land before the buffer. Affected code spans Capstone releases through the fix plus the 6.0.0 alpha1-alpha5 pre-releases, with the Alpine Linux package corrected in capstone 5.0.7-r0 and the upstream fix landed in commit 2c7797182a1618be12017d7d41e0b6581d5d529e. The NVD base score of 9.8 (AV:N/AC:L/PR:N/UI:N) implies trivial unauthenticated remote code execution, but the corroborating signals contradict that: EPSS is only 0.04% (12th percentile), there is no CISA KEV listing or public exploit code identified at time of analysis, and the authoritative independent assessment rates the vector AV:N/AC:H/PR:N/UI:N because exploitation requires a non-default configuration in which an attacker controls Capstone's memory callbacks via cs_option(CS_OPT_MEM) - or a genuine vsnprintf formatting failure is reached - a narrow practical attack surface.
Earlier versions of this analysis (1)
Capstone disassembly framework on Alpine Linux received a security fix in package version 5.0.7-r0, though the nature and impact of the underlying vulnerability have not been publicly disclosed. The extremely terse CVE description - limited to a package version string - provides no detail on attack vector, affected component, or attacker-achievable impact. With an EPSS score of 0.04% (12th percentile), automated exploitation at scale appears unlikely, but the absence of disclosed technical detail prevents confident risk classification.
RemediationAI
Apply the vendor patch: on Alpine Linux, upgrade the capstone package to 5.0.7-r0 (apk upgrade capstone), and for upstream builds, update to a Capstone revision containing commit 2c7797182a1618be12017d7d41e0b6581d5d529e or a later tagged release that incorporates the SStream index type change and the ret < 0 early-return guard; verify against advisory GHSA-85f5-6xr3-q76r and the Alpine secdb entry for CVE-2025-68114 to confirm the exact version boundary for your distribution. Because the demonstrated trigger hinges on attacker influence over the custom memory callbacks set through cs_option(CS_OPT_MEM), the most effective compensating control for environments that cannot patch immediately is to ensure untrusted input never controls the allocator/vsnprintf callbacks - do not expose CS_OPT_MEM configuration to attacker-supplied data and keep the default memory interface in place; the trade-off is loss of custom allocator integration (for example sandboxed or instrumented allocators) until the upgrade is applied. Secondary hardening: run Capstone-based parsing of untrusted binaries in a sandboxed, least-privilege worker process with ASLR and memory-error detection (ASan, hardened allocators) enabled, and treat any Capstone crash while disassembling hostile input as a potentially exploitable memory-safety event; these controls reduce impact but do not eliminate the underlying bug and add measurable parsing overhead. No public exploit code has been identified at time of analysis and the EPSS probability is only 0.04%, so triage should be prioritized by exposure of the custom-allocator API and by whether untrusted binaries are regularly disassembled, rather than by the raw 9.8 NVD score.
Affects your stack
Find out whether the stacks and servers you run are on an affected version.
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
Capstone is a widely embedded multi-architecture disassembly framework used by debuggers, binary-analysis tools, reverse-engineering frameworks, and security products to translate machine code into assembly text. Internally, the SStream component (SStream.c/SStream.h) is the string-builder used to format that disassembly output; it writes through a caller-installable memory interface, including a vsnprintf callback set via cs_option(CS_OPT_MEM). The root cause maps to CWE-120 (buffer copy without checking size, a classic buffer overflow class): in SStream_concat, the return value of the internal vsnprintf was added to the stream index without validating it was non-negative, so a negative return underflows the index. When index was declared as a signed int, the underflow pushed the write cursor before the start of the buffer, and the next SStream_concat1 write performed an out-of-bounds access - precisely the scenario reproduced by the upstream unit test test_underflow_in_sstream, which installs an evil vsnprintf that always returns -1 (reported by Finder16). The upstream patch does three things: it early-returns when ret < 0, adds SSTREAM_OVERFLOW_CHECK(ss, ret), and changes the SStream.index field type from int to size_t to eliminate signed underflow, with matching printf format fixes (%zu) in the unit tests. CPE data lists cpe:2.3:a:capstone-engine:capstone covering all versions as well as the 6.0.0 alpha1 through alpha5 pre-releases.
Know when Capstone gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Library can process remote-delivered binaries (AV:N) but the index underflow requires a rare negative vsnprintf return or control of the memory callback, so AC:H; memory corruption yields full C/I/A impact.
Primary rating from NVD.
CVSS VectorNVD
Lifecycle Timeline
2DescriptionNVD
Alpine Linux: capstone fixed in 5.0.7-r0
Executive ViewAI
Organizations that embed the Capstone disassembly engine in security tooling, reverse-engineering platforms, or managed detection pipelines may face memory-corruption risk if they expose the library to untrusted input with attacker-controlled memory callbacks. Although NVD rates this as critical and unauthenticated, exploitation requires a non-default configuration, no public exploit code is identified at time of analysis, and EPSS is very low, so immediate business disruption is unlikely; nevertheless, unpatched deployments should be remediated promptly.
Apply vendor patch.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
A buffer overflow occurs when a program writes more data to a memory buffer than it was allocated to hold, causing the excess data to spill into adjacent memory regions.
Affected Products (CPE)NVD
Heap-based buffer overflow in the Capstone disassembly framework's skip-data path lets a malformed input corrupt memory
Integer overflow in the cs_winkernel_malloc function in winkernel_mm.c in Capstone 3.0.4 and earlier allows attackers to
Heap buffer overflow in Capstone's SuperH (SH) architecture floating-point disassembler affects all releases through 6.0
Out-of-bounds read in Capstone's SuperH (SH) architecture disassembler crashes the host process when fed crafted SH2A or
Capstone disassembly framework package in Alpine Linux has been patched at version 5.0.8-r0, addressing an unspecified v
Out-of-bounds read in Capstone's cs_insn_name() public API crashes host processes when the M68K or RISCV architecture ba
NVD
CVE.org
EPSS
GitHub
Exploit-DB