Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

buffer overflow in handle_received_frame_irq #11

Open
xidoo123 opened this issue Feb 6, 2024 · 0 comments
Open

buffer overflow in handle_received_frame_irq #11

xidoo123 opened this issue Feb 6, 2024 · 0 comments

Comments

@xidoo123
Copy link

xidoo123 commented Feb 6, 2024

Description

In handle_received_frame_irq, it reads mpdu content from MMIO

trx_frame_read(frame_ptr, LENGTH_FIELD_LEN + phy_frame_len +
			LQI_LEN);
receive_frame->mpdu = frame_ptr;
/* Add ED value at the end of the frame buffer. */
receive_frame->mpdu[phy_frame_len + LQI_LEN + ED_VAL_LEN] = ed_value;

The mpdu content is later parsed here, the first 32 bits is considered as length of the frame without any restriction. This makes frame_ptr accessing oob memory, causing data corruption, DoS and potientially RCE.

frame_len = last_frame_length = receive_frame->mpdu[0];
...
frame_ptr = &(receive_frame->mpdu[frame_len + LQI_LEN]);
lqi = *frame_ptr++;   <-- oob write
ed_level = *frame_ptr;

Fix

As all (or almost every) versions in thirdparty/wireless/avr2025_mac/source/tal/ can have the same issue, the best way to fix this might be adding length check in right before actually using the length at here.

This is discoverd by XinDistince and xdchase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant