Boost _ Firedancer v0.1 33669 - [Blockchain_DLT - Medium] fd_quic_process_packet out of bounds read
Description
Brief/Intro
Vulnerability Details
void
fd_quic_process_packet( fd_quic_t * quic,
uchar * data,
ulong data_sz ) {
fd_quic_state_t * state = fd_quic_get_state( quic );
ulong rc = 0;
/* holds the remainder of the packet*/
uchar * cur_ptr = data;
ulong cur_sz = data_sz;
if( FD_UNLIKELY( data_sz > 0xffffu ) ) {
/* sanity check */
return;
}
fd_quic_pkt_t pkt = { .datagram_sz = (uint)data_sz };
pkt.rcv_time = state->now;
rc = fd_quic_decode_eth( pkt.eth, cur_ptr, cur_sz );
if( FD_UNLIKELY( rc == FD_QUIC_PARSE_FAIL ) ) {
/* TODO count failure, log-debug failure */
return;
}
if( FD_UNLIKELY( pkt.eth->net_type != FD_ETH_HDR_TYPE_IP ) ) {
FD_DEBUG( FD_LOG_DEBUG(( "Invalid ethertype: %4.4x", pkt.eth->net_type )) );
return;
}
cur_ptr += rc;
cur_sz -= rc;
rc = fd_quic_decode_ip4( pkt.ip4, cur_ptr, cur_sz );
if( FD_UNLIKELY( rc == FD_QUIC_PARSE_FAIL ) ) {
/* TODO count failure, log-debug failure */
return;
}
if( FD_UNLIKELY( pkt.ip4->protocol != FD_IP4_HDR_PROTOCOL_UDP ) ) {
return;
}
if( FD_UNLIKELY( pkt.ip4->net_tot_len > cur_sz ) ) {
return;
}
cur_ptr += rc;
cur_sz -= rc;
1. rc = fd_quic_decode_udp( pkt.udp, cur_ptr, cur_sz );
if( FD_UNLIKELY( rc == FD_QUIC_PARSE_FAIL ) ) {
return;
}
if( FD_UNLIKELY( pkt.udp->net_len > cur_sz ) ) {
return;
}
cur_ptr += rc;
2. cur_sz = pkt.udp->net_len - rc;
...
int long_pkt = !!( (uint)cur_ptr[0] & 0x80u );
uint version = 0;
if( long_pkt ) {
version = DECODE_UINT32( cur_ptr + 1 );
...
3. while(1) {
if( FD_UNLIKELY( cur_sz < FD_QUIC_SHORTEST_PKT ) ) return;
int short_pkt = !( (uint)cur_ptr[0] & 0x80u );
if( FD_UNLIKELY( short_pkt ) ) break;
uint cur_version = DECODE_UINT32( cur_ptr + 1 );
...
...Impact Details
Proof of concept
Proof of Concept
PreviousBoost _ Firedancer v0.1 33586 - [Blockchain_DLT - Insight] fd_ebpf_static_link - possible disclosureNextBoost _ Firedancer v0.1 33717 - [Blockchain_DLT - Medium] Memory corruption caused by fully controll
Last updated
Was this helpful?