Boost _ Firedancer v0.1 33348 - [Blockchain_DLT - Medium] Integer underflow leading to memory corrup
Submitted on Thu Jul 18 2024 11:01:49 GMT-0400 (Atlantic Standard Time) by @c4a4dda89 for Boost | Firedancer v0.1
Report ID: #33348
Report type: Blockchain/DLT
Report severity: Medium
Target: https://github.com/firedancer-io/firedancer/tree/e60d9a6206efaceac65a5a2c3a9e387a79d1d096
Impacts:
Process to process Memory Corruption between sandboxed tiles (may lead to code execution)
Description
Brief/Intro
The fd_mux_during_frag_fn
is called after the mux has received a new frag.
Specifically, the parameters seq
, sig
, chunk
, and sz
originate from the received mcache fragment. Since the producer could be compromised, these fields are considered untrusted.
In the during_frag
function within the fd_poh tile implementation (src/app/fdctl/run/tiles/fd_poh.c), there is insufficient validation of the sz field. The function only verifies that sz is less than USHORT_MAX
, but it does not check for a lower limit.
Specifically, consider the line:
If sz is less than the size of fd_microblock_trailer_t, attempting to subtract its size will result in an integer underflow. This can lead to memory corruption, potentially allowing an attacker to compromise the target tile.
Vulnerability Details
In the definition of fd_mux_during_frag_fn
, it’s clearly described that the inputs are not trusted because the producer could put arbitrary values in a frag.
during_frag in fd_poh.c
Impact Details
Process-to-process memory corruption may lead to the process-to-process RCE between sandboxed tiles.
References
https://github.com/firedancer-io/firedancer/blob/e60d9a6206efaceac65a5a2c3a9e387a79d1d096/src/app/fdctl/run/tiles/fd_poh.c#L1393
https://github.com/firedancer-io/firedancer/blob/e60d9a6206efaceac65a5a2c3a9e387a79d1d096/src/app/fdctl/run/tiles/fd_poh.c#L1398
Proof of concept
Proof of Concept
Last updated