Skip to content

STUN response buffer not initialized properly

High
misi published GHSA-c8r8-8vp5-6gcm Jun 29, 2020

Package

coturn (STUN, TURN, ICE, WebRTC)

Affected versions

<4.5.1.3

Patched versions

4.5.1.3

Description

Impact

First of all the issue found and reported by Felix Dörre all credits belongs to him.

The issue is that STUN/TURN response buffer is not initialized properly. CWE 665
This is a leak of information between different client connections. One client (an attacker) could use their connection to intelligently query coturn to get interesting bytes in the padding bytes from the connection of another client.

All coturn and so WebRTC community is impacted by this issue.

Patches

It is fixed in version 4.5.1.3.
Initializing to zero properly the stun buffer, in both case if it is newly allocated or if it is reused.

Workarounds

There is no known workaround.

References

When a turn answer requires padding, coturn does not set the padding explicitly to zero bytes, but sends the data that was previously in the send buffer.

This happens for example here, when the length is just adjusted and the previous contents are left untouched:

newlen=newlen+(4-newlenrem4);

*len = newlen;

The buffers seem to get shared between clients/connections using this mechanism:

stun_buffer_list_elem *ret = get_elem_from_buffer_list(&(e->bufs));

add_elem_to_buffer_list(&(e->bufs), buf_elem);

For more information

If you have any questions or comments about this advisory:

Severity

High

CVE ID

CVE-2020-4067

Weaknesses

No CWEs

Credits