Boost _ Firedancer v0.1 33936 - [Blockchain_DLT - Medium] shred tile fails to process zero sized udp
Submitted on Fri Aug 02 2024 02:05:48 GMT-0400 (Atlantic Standard Time) by @gln for Boost | Firedancer v0.1
Report ID: #33936
Report type: Blockchain/DLT
Report severity: Medium
Target: https://github.com/firedancer-io/firedancer/tree/e60d9a6206efaceac65a5a2c3a9e387a79d1d096
Impacts:
Any bug leading to loss of funds or acceptance of forged / invalid signatures
Description
Brief/Intro
There is an issue in fd_shred.c, when it tries to process packets from net tile - if it sees a zero-sized UDP packet it will call abort().
Vulnerability Details
There is a net_shred link, meaning that shred tile can process data from net tile.
To do so shred tile calls during_frag() function https://github.com/firedancer-io/firedancer/blob/main/src/app/fdctl/run/tiles/fd_shred.c#L297
Let's look at the code:
What we are interested here are these 2 lines:
header size is pulled from frame signature
it is compared against packet size by using FD_TEST macro
Let's look at the definition of FD_TEST macro:
Thus, if hdr_sz is equal to sz, which is the case when UDP packet with no data arrives, shred tile eventually calls abort() and exists.
As a result firedancer will stop working.
Impact Details
Attacker will be able to crash firedancer remotely.
Proof of concept
Proof of Concept
How to reproduce:
get firedancer source
change fd_net.c , after line https://github.com/firedancer-io/firedancer/blob/main/src/app/fdctl/run/tiles/fd_net.c#L259 , add the following code:
It simulates the FD_TEST call of shred tile.
edit fd_mux.c, comment out line #166 https://github.com/firedancer-io/firedancer/blob/main/src/disco/mux/fd_mux.c#L166
edit config.c, change these calls to FD_LOG_ERR to FD_LOG_WARNING:
https://github.com/firedancer-io/firedancer/blob/main/src/app/fdctl/config.c#L546
https://github.com/firedancer-io/firedancer/blob/main/src/app/fdctl/config.c#L653
After that you have to build firedancer with 'make -j fdctl'
run net tile, config.toml can be found here - https://gist.github.com/gln7/d0a699b3e09d52cdc2881705e8983378
download t1.py by using gist link and run it
net tile exits:
Last updated
Was this helpful?