Capstone Engine
CVE-2025-67873
HIGH
Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessCraft malicious input bytes
-
ExploitVictim disassembles via capstone skipdata path
-
ExecutionOversized memcpy overflows 24-byte cs_insn.bytes
-
ImpactHeap corruption enables potential code execution
Vulnerability Assessment
| Weakness |
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Heap buffer bounds checking
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 the host application embedding capstone to explicitly enable the skip-data feature (CS_OPT_SKIPDATA on) AND register a custom skipdata setup callback that returns a skip length greater than the 24-byte cs_insn.bytes buffer; the attacker must then supply input containing bytes that fail to decode (e.g. an invalid WASM opcode) so disassembly enters the skipdata path and performs the oversized memcpy. Limiting factors: this is a non-default configuration (skipdata with a large-returning callback is not enabled by default), exploitation is local (AV:L) via attacker-controlled input that a victim must choose to disassemble (UI:R), and no authentication is involved. Applications using capstone with default options or a bounded skip length are not affected. |
| Impact | Signals are mixed and point to a LOW real-world priority despite a 7.8 'High' CVSS. The CVSS vector (AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H) describes a local heap overflow (CWE-122) with full C/I/A impact but requiring user interaction - consistent with a victim disassembling an attacker-supplied binary. A proof-of-concept exists (publicly available exploit code exists, present as tests/integration/test_poc.c in the fix commit), which raises confidence the bug is genuine. However, EPSS is only 0.01% (3rd percentile) and there is no CISA KEV listing, indicating no observed widespread exploitation - classify as 'publicly available exploit code exists', NOT active exploitation. Crucially, the PoC and source diff show exploitation is NOT reachable in default configurations: it requires the host application to enable CS_OPT_SKIPDATA with a custom skipdata callback that returns a skip length larger than cs_insn.bytes (24 bytes). This conditionality is not reflected in the CVSS PR:N/AC:L metrics, so the raw score overstates realistic risk. Net: a legitimate memory-safety bug in a popular library, but low urgency outside applications that specifically use capstone's skipdata feature with a large-return callback. |
| Exploit ScenarioDerived | An attacker crafts a malicious binary/blob and convinces a victim (or an automated analysis pipeline) to disassemble it with a capstone-based tool that has the skipdata option enabled and a callback returning more than 24 bytes. When capstone hits undecodable bytes it enters the skipdata path and memcpy's the oversized skip length into the fixed 24-byte cs_insn.bytes buffer, overflowing the heap. A working PoC (test_poc.c, using CS_ARCH_WASM and a 1024-byte skip callback) is published in the fix commit, demonstrating the overflow in both cs_disasm and cs_disasm_iter. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv2 – Oct 13, 2026
Heap-based buffer overflow in the Capstone disassembly framework's skip-data path lets a malformed input corrupt memory in any host application that embeds the library. Exploitation requires the embedding application to have enabled the non-default CS_OPT_SKIPDATA option together with a custom skip-data callback that returns more than the 24-byte cs_insn.bytes buffer, and the victim must then disassemble attacker-supplied bytes that fail to decode; no authentication is required but the attack is local and user-interaction driven (CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H, 7.8). Publicly available exploit code exists in the form of a regression test shipped with the upstream fix, but there is no KEV-listed active exploitation and EPSS is only 0.01% (3rd percentile), so real-world priority is low; Alpine Linux shipped the fix in capstone 5.0.7-r0.
Earlier versions of this analysis (1)
Capstone disassembly framework on Alpine Linux received a security fix in package version 5.0.7-r0, addressing an unspecified vulnerability. The nature, impact class, and exploitability of the underlying flaw are not disclosed in the available intelligence - no CVSS score, CWE classification, or vulnerability description has been published. With an EPSS score of 0.01% (3rd percentile), exploitation probability is extremely low, and no public exploit or CISA KEV listing exists at time of analysis.
RemediationAI
Vendor-released patch: Alpine Linux capstone 5.0.7-r0 - upgrade with 'apk upgrade capstone' (or 'apk add capstone=5.0.7-r0') and rebuild/restart anything statically linked against it. For upstream and non-Alpine consumers, apply commit cbef767ab33b82166d263895f24084b75b316df3 or adopt the first tagged release containing it, and verify per vendor advisory GHSA-hj6g-v545-v7jg; packages that link Capstone statically must be rebuilt, since updating the shared library alone will not help. Where an immediate upgrade is not possible, the effective compensating controls are configuration-level: disable skip-data entirely by not setting CS_OPT_SKIPDATA (trade-off: disassembly stops or errors on undecodable bytes instead of emitting '.byte' placeholders, which degrades analysis of firmware and obfuscated code), or if skip-data is required, clamp every custom cs_skipdata callback so it never returns more than sizeof(cs_insn.bytes) (24 bytes) - skip-data still functions for short runs but long undecodable regions are fragmented into multiple pseudo-instructions and reported sizes no longer reflect the true byte run. Additionally, avoid disassembling untrusted or attacker-supplied binaries inside privileged processes, and treat any tool that lets a user register an arbitrary skip-data callback as the primary exposure surface. Note that EPSS is 0.01% and there is no KEV-listed active exploitation, so these controls are proportionate to a low real-world priority.
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 reverse-engineering tools, binary analyzers, and emulators. The flaw is classified as CWE-122 (heap-based buffer overflow) and lives in the skip-data feature: when a byte sequence cannot be decoded, capstone can emit a pseudo-instruction (default mnemonic '.byte') and advance by a length returned by a user-supplied cs_opt_skipdata callback. In cs_disasm() and cs_disasm_iter(), the code assigned that callback-returned skip length to insn_cache->size / insn->size and then performed memcpy(insn->bytes, buffer, skipdata_bytes) into the fixed-size cs_insn.bytes array (24 bytes) without validating the length against the destination size. The upstream fix (commit cbef767ab33b82166d263895f24084b75b316df3) clamps both the size assignment and the copy with MIN(skipdata_bytes, sizeof(insn->bytes)), and the same commit adds tests/integration/test_poc.c which drives the overflow by registering a callback returning 1024 bytes and feeding an invalid WASM opcode (0x06) to force the skip-data path. Because cs_insn structures are heap-allocated, an oversized skip length produces a controlled heap write of up to skipdata_bytes beyond the 24-byte inline buffer, with the C:H/I:H/A:H impact reflecting full loss of confidentiality, integrity, and availability in the hosting process rather than remote code execution on the target system.
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:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Local because the attacker-supplied blob is processed by a victim-run tool (UI:R); no auth needed (PR:N); a heap overflow yielding memory corruption supports C:H/I:H/A:H, though reachability depends on the skipdata configuration.
Primary rating from NVD.
CVSS VectorNVD
Lifecycle Timeline
3DescriptionNVD
Alpine Linux: capstone fixed in 5.0.7-r0
Executive ViewAI
Capstone disassembly framework, a library embedded in various security and development tools, contains a heap-based buffer overflow (CVE-2025-67873) that can corrupt memory in host applications. Exploitation requires a non-default configuration (CS_OPT_SKIPDATA with a custom callback returning more than 24 bytes) and local user interaction, but publicly available exploit code exists. While no active exploitation has been observed, organizations using affected applications should prioritize patching to capstone 5.0.7-r0 to prevent potential memory corruption and code execution risks.
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.
A heap overflow occurs when a program writes data beyond the bounds of a buffer allocated in the heap memory region.
Affected Products (CPE)NVD
Out-of-bounds read/write in the Capstone disassembly engine's SStream string-formatting path can be triggered when the i
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