Capstone SH disassembler `set_reg_n` heap buffer overflow via crafted SH2A FPU bytecode
21Vexday Risk Score
No sign of exploitation. No public exploitation artifact known so far.
ssvc Trackcvss 7.3epss 0.2%
exploitation probability
0.2%top 93% of all CVEs
observed exploitation
nono source reports it
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.
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
Affected products
capstone-engine · capstoneReferences
https://github.com/capstone-engine/capstone/commit/09e76802380b9e94d9720c44458d9d5282219e7ehttps://github.com/capstone-engine/capstone/commit/e17ee44a8307ea33375b4727ac4f987650bf7bedhttps://github.com/capstone-engine/capstone/pull/2968https://github.com/capstone-engine/capstone/pull/2969https://github.com/capstone-engine/capstone/releases/tag/6.0.0-Alpha10https://github.com/capstone-engine/capstone/security/advisories/GHSA-3hpv-wr3j-rxwh