Capstone
cpe:2.3:a:capstone-engine:capstone:*:*:*:*:*:*:*
- <= 6.0.0-Alpha5
A vulnerability exists in the Capstone disassembly framework, specifically in versions through 6.0.0-Alpha5. The issue arises from an unchecked return value of vsnprintf in the SStream_concat function, which allows a maliciously crafted vsnprintf return to manipulate the SStream index. This manipulation can drive the index negative or beyond the buffer's end, causing a stack buffer underflow or overflow during subsequent writes. The vulnerability can be exploited by any embedding that permits untrusted code to modify Capstone's memory handling options, particularly through the cs_option function.
Exploitation of this vulnerability leads to a stack buffer underflow or overflow, causing memory corruption. This could potentially allow for arbitrary code execution in the context of the application using Capstone.
The vulnerability can be reproduced by creating a Capstone SStream and using a custom vsnprintf function that returns -1, which underflows the SStream index. This can be done by setting up a Capstone memory options structure (cs_opt_mem) with the custom vsnprintf function, and then calling SStream_concat with a format string that triggers the index manipulation. After the underflow, a subsequent write operation can be performed that exploits the corrupted index, leading to a buffer overflow.
Users can update to Capstone version 6.0.0-Alpha6 or later, where this vulnerability has been fixed.
Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.