CVE-2026-55893

Capstone SH disassembler `set_reg_n` heap buffer overflow via crafted SH2A FPU bytecode

Published Aug 20, 2026 CVSS 4.0 · 7.3 High EPSS < 1% KEV · Not listed
Description
Capstone is a disassembly framework. In 6.0.0-Alpha9 and earlier, Capstone's arch/SH/SHDisassembler.c SH floating-point decoders such as opFADD, opFMUL, and opFSUB call set_reg() and set_reg_n() using sh_info.op.op_count without checking the fixed-size operands[] array. Repeated crafted instructions processed through cs_disasm_iter() or cs_disasm() with CS_ARCH_SH, CS_MODE_SH2A or CS_MODE_SH4A, CS_MODE_SHFPU, and CS_OPT_DETAIL can increment the operand count beyond the 176-byte sh_info allocation and perform a four-byte heap buffer overflow write. The corruption can crash the process and may enable code execution depending on heap layout. This issue is fixed in version 6.0.0-Alpha10.

Analysis

AI-generated

Technical impact

Capstone’s SH floating‑point decoders invoke set_reg() and set_reg_n() based on an operation count without bounding against the fixed‑size operand array. When a crafted series of SH2A/FPU instructions is parsed with cs_disasm_iter() or cs_disasm(), the operand count can exceed the allocated 176‑byte buffer, causing a four‑byte heap write past the end of the allocation. This corruption can crash the process or, depending on heap layout, may allow an attacker to inject and execute arbitrary code.

Affected Systems

The vulnerability exists in the Capstone disassembly framework provided by Capstone Engine, specifically in version 6.0.0‑Alpha9 and earlier. Any deployment of Capstone that decodes SH architecture instructions with SHFPU support (CS_MODE_SH2A or CS_MODE_SH4A) and enables detailed output (CS_OPT_DETAIL) is affected.

Risk and Exploitability

The CVSS score of 7.3 indicates high severity, while the EPSS score of < 1% suggests a low but non‑zero exploitation probability; the vulnerability is not listed in the CISA KEV catalog. Exploitation requires the ability to supply crafted SH instructions to the disassembler, which typically limits the attack to environments where Capstone processes untrusted machine code. However, if local code execution is possible, the risk is significant due to the potential for arbitrary code execution through the heap overflow.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade to Capstone Engine version 6.0.0‑Alpha10 or later, which contains the buffer overflow fix.
  • If an upgrade is not immediately possible, configure Capstone to avoid the vulnerable code paths by disabling SHFPU support (CS_MODE_SH2A/CS_MODE_SH4A) or setting CS_OPT_DETAIL to 0 when parsing potentially untrusted SH binary code.
  • Implement strict input validation for any guest SH code passed to Capstone, ensuring that operation counts do not exceed a safe threshold before invoking cs_disasm or cs_disasm_iter.

Generated by OpenCVE AI on August 25, 2026 at 15:40 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}

Type Values Removed Values Added
Weaknesses CWE-805
References
Metrics threat_severity

None

cvssV3_1

{'score': 7.0, 'vector': 'CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H'}

threat_severity

Moderate

Type Values Removed Values Added
First Time appeared Capstone-engine
Capstone-engine capstone
Vendors & Products Capstone-engine
Capstone-engine capstone
Type Values Removed Values Added
Description Capstone is a disassembly framework. In 6.0.0-Alpha9 and earlier, Capstone's arch/SH/SHDisassembler.c SH floating-point decoders such as opFADD, opFMUL, and opFSUB call set_reg() and set_reg_n() using sh_info.op.op_count without checking the fixed-size operands[] array. Repeated crafted instructions processed through cs_disasm_iter() or cs_disasm() with CS_ARCH_SH, CS_MODE_SH2A or CS_MODE_SH4A, CS_MODE_SHFPU, and CS_OPT_DETAIL can increment the operand count beyond the 176-byte sh_info allocation and perform a four-byte heap buffer overflow write. The corruption can crash the process and may enable code execution depending on heap layout. This issue is fixed in version 6.0.0-Alpha10.
Title Capstone SH disassembler `set_reg_n` heap buffer overflow via crafted SH2A FPU bytecode
Weaknesses CWE-122
References
Metrics cvssV4_0

{'score': 7.3, 'vector': 'CVSS:4.0/AV:L/AC:H/AT:P/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N'}

Weaknesses
  • CWE-122

    Heap-based Buffer Overflow

  • CWE-805

    Buffer Access with Incorrect Length Value

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Aug 21, 2026, 9:45 PM
Reserved
Jun 17, 2026, 4:59 PM
Status
Deferred
Published
Aug 20, 2026, 10:17 PM
Modified
Oct 18, 2026, 8:10 PM
Severity
Moderate
Public date
Aug 20, 2026, 9:32 PM