Skip to main content

Capstone CVE-2025-68114

CRITICAL
Classic Buffer Overflow (CWE-120)
N/A vendor:alpine
9.8
CVSS 3.1 · NVD
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Reach Capstone disassembly with controlled input
  2. Delivery
    Cause vsnprintf to return negative
  3. Exploit
    Underflow signed SStream.index
  4. Execution
    SStream_concat1 writes before buffer
  5. Impact
    Out-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.

Act Now Prioritize within 24-48h. Why: CRITICAL severity.
Patch available 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv2 – 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)
v1 May 27, 2026 - 22:57

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

NVD PRIMARY 9.8 CRITICAL
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
vuln.today AI 8.1 HIGH

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.

3.1 AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
4.0 AV:N/AC:H/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

Primary rating from NVD.

CVSS VectorNVD

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

Lifecycle Timeline

2
Patch released
Oct 13, 2026 - 11:22 NVD
https://github.com/capstone-engine/capstone/commit/2c7797182a1618be12017d7d41e0b6581d5d529e
CVSS changed
Oct 13, 2026 - 11:22 NVD
9.8 (CRITICAL)

DescriptionNVD

Alpine Linux: capstone fixed in 5.0.7-r0

Executive ViewAI

Why It Matters

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.

Business Impact: Medium
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

EPSS Score
0.0%
Top 88% exploitable
Prevalence
Medium
popular disassembly library embedded in many reverse-engineering and security tools
Data Quality
3 sources
Confidence: Low

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.

SignalValue
Severity CRITICAL
CISA KEV No
Public POC No
EPSS 0.0%
Patch available Yes
Active threat No
Deciding rule
CRITICAL severity
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
Yes
Human Impact
Medium

Priority Score

49
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +49
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

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

cpe:2.3:a:capstone-engine:capstone:*:*:*:*:*:*:*:*
cpe:2.3:a:capstone-engine:capstone:6.0.0:alpha1:*:*:*:*:*:*
cpe:2.3:a:capstone-engine:capstone:6.0.0:alpha2:*:*:*:*:*:*
cpe:2.3:a:capstone-engine:capstone:6.0.0:alpha3:*:*:*:*:*:*
cpe:2.3:a:capstone-engine:capstone:6.0.0:alpha4:*:*:*:*:*:*
cpe:2.3:a:capstone-engine:capstone:6.0.0:alpha5:*:*:*:*:*:*

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy