Boost _ Firedancer v0.1 33586 - [Blockchain_DLT - Insight] fd_ebpf_static_link - possible disclosure
Submitted on Wed Jul 24 2024 00:05:29 GMT-0400 (Atlantic Standard Time) by @gln for Boost | Firedancer v0.1
Report ID: #33586
Report type: Blockchain/DLT
Report severity: Insight
Target: https://github.com/firedancer-io/firedancer/tree/e60d9a6206efaceac65a5a2c3a9e387a79d1d096
Impacts:
Process to process RCE between sandboxed tiles
Description
Brief/Intro
The function fd_ebpf_static_link() is being used to parse and load BPF programs which are basically hooks for XDP packet processing.
The code is being used by fd_net tile.
Vulnerability Details
There is an uninitialized memory issue in fd_ebpf_static_link() function which could lead to disclosure of some parts of stack memory.
Let's look at this function:
Note that sym_mapping array is not initialized
During execution of loop on line 2. it is possible that sym_mapping still will not be initialized
On line 3. unitialized value from sym_mapping array will be used and after some modifications written back to a buffer containing bpf program.
As a result it is possible to obtain the access to parts of stack memory.
Impact Details
Could be used to bypass ASLR/DEP protections from fd_net tile.
Proof of concept
Proof of Concept
How to reproduce:
get the archive from provided gist link, it contains slightly modified fd_ebpf.c file and testcase.
You need to run base64 decoder to unpack it:
That is we crash if we notice the use of unitialized values from sym_mapping array.
copy new fd_ebpf.c over src/waltz/ebpf/fd_ebpf.c file and build fuzzers
run fuzz_ebpf fuzzer and observe it crash:
Last updated