Open Bug 1671169 Opened 2 years ago Updated 2 years ago

WebRTC RTCP Source description packet has invalid padding

Categories

(Core :: WebRTC: Networking, defect, P3)

Firefox 81
defect

Tracking

()

People

(Reporter: git, Unassigned)

References

Details

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36 OPR/71.0.3770.228

Steps to reproduce:

I'm currently working on a WebRTC library in rust and noticed a small when FF is creating Source Descriptions RTCP packets.

Actual results:

When creating a Rtcp Source Description packet, as described in https://tools.ietf.org/html/rfc3550#section-6.5, all descriptions SDES items should be padded to 32 bits ("Items are contiguous, i.e., items are not individually padded to a 32-bit boundary."). As it turns out, when padding the item, the type and length bytes are not taken into account, instead the value just gets padded to 32bits, which result in having padded to 32bit + 16bit. Somewhat later it seems another 2 bytes were added in order to bring the final package back to 4 bytes (including the over all RTCP packet length).

Example data I received from FF:
[129, 202, 0, 12, 77, 252, 33, 133, 1, 38, 123, 52, 98, 49, 100, 49, 100, 56, 54, 45, 100, 52, 98, 99, 45, 52, 52, 97, 50, 45, 97, 57, 50, 100, 45, 54, 101, 52, 55, 101, 101, 49, 101, 100, 54, 97, 51, 125, 0, 0, 0, 0]

The last four zeros should not exist.

Expected results:

Correctly pad the source description.
The result should look like this:
[129, 202, 0, 11, 77, 252, 33, 133, 1, 38, 123, 52, 98, 49, 100, 49, 100, 56, 54, 45, 100, 52, 98, 99, 45, 52, 52, 97, 50, 45, 97, 57, 50, 100, 45, 54, 101, 52, 55, 101, 101, 49, 101, 100, 54, 97, 51, 125]

Component: Untriaged → WebRTC: Networking
Product: Firefox → Core

Does this happen with Chrome also?

Flags: needinfo?(git)

No, an example packet from Chrome 86.0.4240.75 (Official Build) (64-bit)

Parsed packet: SourceDescription(RtcpPacketSourceDescription { descriptions: [(183626744, CName("sy/BjToOCh8u3dw4"))] })
Source:  [129, 202, 0, 6, 10, 241, 235, 248, 1, 16, 115, 121, 47, 66, 106, 84, 111, 79, 67, 104, 56, 117, 51, 100, 119, 52, 0, 0]

The last two zeros have been correctly padded.

Flags: needinfo?(git)

Maybe the webrtc.org update will fix this?

Flags: needinfo?(dminor)

Thank you for the bug report!

Almost certainly an update will fix this, we're planning to update to M86 of libwebrtc (or maybe newer). I'll mark this as depending on the update bug so we can check again after the update.

Severity: -- → S3
Status: UNCONFIRMED → NEW
Depends on: 1654112
Ever confirmed: true
Flags: needinfo?(dminor)
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.