Skip to content

rtcp: account for fixed header size in report block validation - #2235

Closed
TristanInSec wants to merge 1 commit into
sipwise:masterfrom
TristanInSec:fix-rtcp-report-block-oob
Closed

TristanInSec wants to merge 1 commit into
sipwise:masterfrom
TristanInSec:fix-rtcp-report-block-oob

Conversation

@TristanInSec

Copy link
Copy Markdown
Contributor

rtcp_Xr() validates that el->len can hold count * sizeof(report_block), but the report blocks start after the fixed SR/RR header, not at offset 0. A Sender Report has 28 bytes of header before the blocks, a Receiver Report has 8. Without subtracting the header, a minimal-length packet with count >= 1 passes the check and the block iteration reads past the buffer.

This passes the header size into the check so it covers header + blocks.

rtcp_Xr() checks that el->len can hold count * sizeof(report_block)
but does not subtract the fixed header that precedes the report
blocks. A Sender Report has a 28-byte header before the blocks, a
Receiver Report has 8 bytes. Without accounting for this, a packet
just large enough for the header but with count=1 passes the check
and the report block read goes past the buffer.

Pass the header size into the validation so the check covers
header + blocks.
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

Successfully merging this pull request may close these issues.

1 participant