Skip to content

[BUG] Fixed OOB read in ACK payload parsing#3325

Open
mszatmary-netflix wants to merge 1 commit into
Haivision:masterfrom
mszatmary-netflix:fix/ack-oob-read
Open

[BUG] Fixed OOB read in ACK payload parsing#3325
mszatmary-netflix wants to merge 1 commit into
Haivision:masterfrom
mszatmary-netflix:fix/ack-oob-read

Conversation

@mszatmary-netflix

@mszatmary-netflix mszatmary-netflix commented May 21, 2026

Copy link
Copy Markdown
Contributor

CUDT::processCtrlAckreads twoint32_t` fields out of the control packet
payload without validating its length:

  • ackdata[ACKD_RCVLASTACK] (index 0) is dereferenced up front, OOB for
    0–3 byte payloads.
  • ackdata[ACKD_BUFFERLEFT] (index 3) is dereferenced on the non-lite path,
    OOB for 5–15 byte payloads.

A peer can send an ACK control packet with an arbitrary intermediate
payload length and cause the receiver to read up to 15 bytes past the
allocated packet buffer. The value at index 3 is then assigned into
m_iFlowWindowSize, so the leaked memory directly perturbs send-side
flow control.

REPLACED BY: #3323

Comment thread srtcore/core.cpp
LOGC(inlog.Warn, log << CONID() << "ACK: payload " << pktlen
<< " bytes is shorter than LITE (" << SEND_LITE_ACK << ") - rejecting");
return;
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If all earlier checks are already there, then for every command packet it's checked if it contains at least a payload of 4 bytes (commands that don't use arguments have at least the 4-byte padding). So this part should be checked anyway before even calling this function. If so, this one is redundant.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The mentioned changes is in #3323 - so when this one is merged, the check for "LITE" ACK correct size is not necessary.

@ethouris ethouris added Type: Maintenance Work required to maintain or clean up the code [core] Area: Changes in SRT library core Resolution: Replaced The same fix or problem description is provided by another one. labels Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[core] Area: Changes in SRT library core Resolution: Replaced The same fix or problem description is provided by another one. Type: Maintenance Work required to maintain or clean up the code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants